Moved clear to refresh callback.

This commit is contained in:
Camilla Berglund 2011-09-08 22:52:58 +02:00
parent bca0283fdd
commit 58db28ea83

View File

@ -236,6 +236,9 @@ static int window_close_callback(GLFWwindow window)
static void window_refresh_callback(GLFWwindow window) static void window_refresh_callback(GLFWwindow window)
{ {
printf("%08x at %0.3f: Window refresh\n", counter++, glfwGetTime()); printf("%08x at %0.3f: Window refresh\n", counter++, glfwGetTime());
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers();
} }
static void window_focus_callback(GLFWwindow window, int activated) static void window_focus_callback(GLFWwindow window, int activated)
@ -371,11 +374,7 @@ int main(void)
printf("Main loop starting\n"); printf("Main loop starting\n");
while (glfwIsWindow(window) == GL_TRUE) while (glfwIsWindow(window) == GL_TRUE)
{
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers();
glfwWaitEvents(); glfwWaitEvents();
}
glfwTerminate(); glfwTerminate();
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);