mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 04:54:35 +00:00
Moved clear to refresh callback.
This commit is contained in:
parent
bca0283fdd
commit
58db28ea83
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user