From 7a536f1bd2138c47933f8c26f49ebf9e45139bdc Mon Sep 17 00:00:00 2001 From: Richard Mitton Date: Fri, 1 Mar 2019 18:55:55 -0800 Subject: [PATCH] Examples + Viewport: GLFW: context wasn't set when using multiple windows. (#2392) --- examples/imgui_impl_glfw.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/imgui_impl_glfw.cpp b/examples/imgui_impl_glfw.cpp index 45b2d0e78..8fae67ccb 100644 --- a/examples/imgui_impl_glfw.cpp +++ b/examples/imgui_impl_glfw.cpp @@ -602,8 +602,11 @@ static void ImGui_ImplGlfw_RenderWindow(ImGuiViewport* viewport, void*) static void ImGui_ImplGlfw_SwapBuffers(ImGuiViewport* viewport, void*) { ImGuiViewportDataGlfw* data = (ImGuiViewportDataGlfw*)viewport->PlatformUserData; - if (g_ClientApi == GlfwClientApi_OpenGL) + if (g_ClientApi == GlfwClientApi_OpenGL) + { + glfwMakeContextCurrent(data->Window); glfwSwapBuffers(data->Window); + } } //--------------------------------------------------------------------------------------------------------