Skip to content

Commit

Permalink
intall/restore glfw callbacks depending on the imgui context
Browse files Browse the repository at this point in the history
  • Loading branch information
cpichard committed Mar 5, 2023
1 parent 2daba08 commit 39b18be
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,13 @@ int main(int argc, char *const *argv) {
glfwPollEvents();

// Render the viewports first as textures
ImGui_ImplGlfw_RestoreCallbacks(window);
ImGui::SetCurrentContext(hydraUIContext);
editor.HydraRender(); // RenderViewports

// Render GUI next
ImGui::SetCurrentContext(mainUIContext);
ImGui_ImplGlfw_InstallCallbacks(window);
glfwGetFramebufferSize(window, &width, &height);
glViewport(0, 0, width, height);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
Expand Down

0 comments on commit 39b18be

Please sign in to comment.