Пример #1
0
void DisplayGL()
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear currenr render target /buffers
	//change rendering scene based on globals value
	switch(g_eCurrentScene)
	{
	case ST_Scene1:
		{
			RenderScene1();
		}
		break;

	case ST_Scene2:
		{
			RenderScene2();
		}
		break;
	case ST_Scene3:
		{
			RenderScene3();
		}
		break;
	case ST_Scene4:
		{
			RenderScene4();
		}
		break;
	}

	glutSwapBuffers(); //flip buffers (current buffer to off-screen buffer
	glutPostRedisplay(); //tell GLUT that we are ready to render another frame. Marks current window to be redisplayed

}
Пример #2
0
void DisplayGL() {
  glClear(GL_COLOR_BUFFER_BIT |
          GL_DEPTH_BUFFER_BIT);  // Clean up the colour of the window
  // and the depth buffer

  switch (g_eCurrentScene) {
    case 1: {
      RenderScene1();
    } break;
    case 2: {
      RenderScene2();
    } break;
    case 3: {
      RenderScene3();
    } break;
    case 4: {
      RenderScene4();
    } break;
    case 5: {
      RenderScene5();
    } break;
    case 6: {
      RenderScene6();
    } break;
  }

  glutSwapBuffers();
  // All drawing commands applied to the
  // hidden buffer, so now, bring forward
  // the hidden buffer and hide the visible one
}