mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-23 02:38:52 -05:00
Don't call OpenGL functions until there's a context.
This commit is contained in:
parent
3f34b091b8
commit
06700e62bf
|
@ -242,8 +242,11 @@ 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);
|
if (glfwGetCurrentContext())
|
||||||
glfwSwapBuffers(window);
|
{
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
glfwSwapBuffers(window);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void window_focus_callback(GLFWwindow window, int activated)
|
static void window_focus_callback(GLFWwindow window, int activated)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user