From 58db28ea8309adae9412583b2ca93580bab411b7 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 8 Sep 2011 22:52:58 +0200 Subject: [PATCH] Moved clear to refresh callback. --- tests/events.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/events.c b/tests/events.c index 2577c638..b1590185 100644 --- a/tests/events.c +++ b/tests/events.c @@ -236,6 +236,9 @@ static int window_close_callback(GLFWwindow window) static void window_refresh_callback(GLFWwindow window) { 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) @@ -371,11 +374,7 @@ int main(void) printf("Main loop starting\n"); while (glfwIsWindow(window) == GL_TRUE) - { - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(); glfwWaitEvents(); - } glfwTerminate(); exit(EXIT_SUCCESS);