Clean up camera code.

This commit is contained in:
2017-10-27 12:05:53 +02:00
parent 33af59b8a5
commit b781960632
3 changed files with 52 additions and 22 deletions

View File

@@ -48,7 +48,9 @@ static void render()
// Clear Color and Depth Buffers
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
configureCamera();
auto& camera = Camera::instance();
camera.configureRenderingContext();
glBegin(GL_TRIANGLES);
glVertex3f(-2.0f, -2.0f, 0.0f);
@@ -56,6 +58,9 @@ static void render()
glVertex3f(0.0f, 2.0f, 0.0);
glEnd();
// Draw the status line on screen
glRasterPos2i(0, 0);
glutSwapBuffers();
}
@@ -109,7 +114,8 @@ int main(int argc, char *argv[])
glutDisplayFunc(render);
glutIdleFunc(render);
glutReshapeFunc(changeWindowSize);
registerCameraControls();
Camera::instance().registerControls();
glewInit();
if (!GLEW_VERSION_2_0) {