Moved clear to refresh callback.

master
Camilla Berglund ago%!(EXTRA string=14 years)
parent bca0283fdd
commit 58db28ea83
  1. 7
      tests/events.c

@ -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);

Loading…
Cancel
Save