-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImGui Dockspace not working when viewports are enabled #7609
Comments
This is most likely an issue on your end. You should use a graphics debugger like RenderDoc to investigate. |
@PathogenDavid Why does it start working as soon as I disable ImGui::DockSpaceOverViewport();? |
Hard to say without debugging your app, which is why I recommended looking at a graphics debugger. |
It seems like my program doesn't allow: |
It's possibly an issue in your code and you may be not sharing the relevant code. |
OpenGL uses a bunch of global state, so it is possible that some of the state we alter inside |
Again, this can means different things and is very ambiguous to read without code. We still don't know how you are rendering the things that breaks. If you have a texture working, then you can submit your framebuffer using I also don't know if by texture you are referring to the texture used as part of the render toward generating your framebuffer-rendered-to-texture, or if you are talking about your framebuffer-rendered-to-texture. Without code we can only guess. |
I managed to fix the issue, it was an issue with how I setup my rotation Matrix and how it was applying to the model matrix. It ended up exploding everything. Thanks for helping me, even though it wasn't an issue with your codebase :) |
Version/Branch of Dear ImGui:
Branch: docking
Back-ends:
imgui_impl_glfw.cpp
imgui_impl_opengl3.cpp
Compiler, OS:
Windows 10
Full config/build information:
No response
Details:
I'm setting up imgui docking and multi-viewports, I'm trying to create a viewport window that renders my game's graphics in an imgui window. However when I use:
if (ImGui::GetIO().ConfigFlags & ImGuiConfigFlags_DockingEnable)
{
ImGui::DockSpaceOverViewport();
}
it causes my render textures to clear and erase themselves so nothing gets rendered to screen or the viewport.
Screenshots/Video:
with ImGui::Dockspace
![image](https://private-user-images.githubusercontent.com/82027284/332162291-18f0b442-d0bf-4d80-83d6-4c6e6a2391ee.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2NDE5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5VDA2MTQ1MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVmNzg1MjVmMDZkNjkxMjAzM2E0MjZlMDE3Y2M5YWI0YWRiZjQzZDQwNjlhZjJiYmNlOTQwMzVmMDJiOGIxOTMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.RE9IvfQKxrbxl4eRzsGbgg5YYyBeO9x7MGweKKHtptE)
without ImGui::Dockspace
Minimal, Complete and Verifiable Example code:
ImGui_ImplOpenGL3_NewFrame();
ImGui_ImplGlfw_NewFrame();
ImGui::NewFrame();
if (ImGui::GetIO().ConfigFlags & ImGuiConfigFlags_DockingEnable)
{
ImGui::DockSpaceOverViewport();
}
ImGui::Render();
glClear(GL_COLOR_BUFFER_BIT);
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
if (ImGui::GetIO().ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
{
GLFWwindow* backup_current_context = glfwGetCurrentContext();
ImGui::UpdatePlatformWindows();
ImGui::RenderPlatformWindowsDefault();
glfwMakeContextCurrent(backup_current_context);
}
The text was updated successfully, but these errors were encountered: