Ugh, GLUT idle func was chewing up CPU

- ugh, why is the millis parameter to glutTimerFunc() an int?! 1000ms/60Hz = 17ms
This commit is contained in:
Aaron Culliney 2015-01-14 23:17:50 -08:00
parent 87a2d081d3
commit 882eae4818

View File

@ -585,9 +585,10 @@ static void gldriver_shutdown(void) {
// update, render, reshape // update, render, reshape
// //
#if USE_GLUT #if USE_GLUT
static void gldriver_update(void) { static void gldriver_update(int unused) {
c_keys_handle_input(-1, 0, 0); c_keys_handle_input(-1, 0, 0);
glutPostRedisplay(); glutPostRedisplay();
glutTimerFunc(17, gldriver_update, 0);
} }
#endif #endif
@ -707,7 +708,7 @@ static void gldriver_init_glut(GLuint fbo) {
gldriver_init_common(); gldriver_init_common();
glutIdleFunc(gldriver_update); glutTimerFunc(16, gldriver_update, 0);
glutDisplayFunc(gldriver_render); glutDisplayFunc(gldriver_render);
glutReshapeFunc(gldriver_reshape); glutReshapeFunc(gldriver_reshape);