Beispiel #1
0
/**
 * Just the current frame in the display.
 */
void Engine::DrawFrame()
{
 
    renderer_.Update( monitor_.GetCurrentTime() );

    // Just fill the screen with a color.
    glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
    renderer_.Render();

    // Swap
    if( EGL_SUCCESS != gl_context_->Swap() )
    {
        UnloadResources();
        LoadResources();
    }
}
/**
 * Just the current frame in the display.
 */
void Engine::DrawFrame() {
  float fps;
  if (monitor_.Update(fps)) {
    UpdateFPS(fps);
  }
  double dTime = monitor_.GetCurrentTime();
  renderer_.Update(dTime);

  // Just fill the screen with a color.
  glClearColor(0.5f, 0.5f, 0.5f, 1.f);
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  renderer_.Render();

  // Swap
  if (EGL_SUCCESS != gl_context_->Swap()) {
    UnloadResources();
    LoadResources();
  }
}