Don't call OpenGL functions until there's a context.

master
Camilla Berglund ago%!(EXTRA string=13 years)
parent 3f34b091b8
commit 06700e62bf
  1. 3
      tests/events.c

@ -242,9 +242,12 @@ 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());
if (glfwGetCurrentContext())
{
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers(window); glfwSwapBuffers(window);
} }
}
static void window_focus_callback(GLFWwindow window, int activated) static void window_focus_callback(GLFWwindow window, int activated)
{ {

Loading…
Cancel
Save