* Just the current frame in the display. */
| 165 | * Just the current frame in the display. |
| 166 | */ |
| 167 | void Engine::DrawFrame() { |
| 168 | float fps; |
| 169 | if (monitor_.Update(fps)) { |
| 170 | UpdateFPS(fps); |
| 171 | } |
| 172 | renderer_.Update(monitor_.GetCurrentTime()); |
| 173 | |
| 174 | // Just fill the screen with a color. |
| 175 | glClearColor(0.5f, 0.5f, 0.5f, 1.f); |
| 176 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
| 177 | renderer_.Render(); |
| 178 | |
| 179 | // Swap |
| 180 | if (EGL_SUCCESS != gl_context_->Swap()) { |
| 181 | UnloadResources(); |
| 182 | LoadResources(); |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | /** |
| 187 | * Tear down the EGL context currently associated with the display. |
no test coverage detected