From df6f2e46e158ef29ab59577664b88cea35617b38 Mon Sep 17 00:00:00 2001 From: Super Date: Fri, 18 Nov 2022 14:02:22 +0800 Subject: [PATCH] fix glfw context --- backend.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend.cpp b/backend.cpp index dc00c5b2b..556bda48d 100644 --- a/backend.cpp +++ b/backend.cpp @@ -133,7 +133,7 @@ GLFWwindow *igCreateGLFWWindow(const char *title, int width, int height, GLFWWin // Install extra callback glfwSetWindowRefreshCallback(window, glfw_window_refresh_callback); - + glfwMakeContextCurrent(NULL); return window; } @@ -181,6 +181,7 @@ void glfw_render(GLFWwindow *window, VoidCallback renderLoop) { void igRunLoop(GLFWwindow *window, VoidCallback loop, VoidCallback beforeRender, VoidCallback afterRender, VoidCallback beforeDestroyContext) { + glfwMakeContextCurrent(window); ImGuiIO *io = igGetIO(); // Load Fonts