-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
ImGuiConfigFlags_ViewportsEnable apparently reseted after ImGui::NewFrame(); #6201
Comments
It is disabled if not supported by both backends. The flag needs to be initially set at the time of initializing both backends.
|
It is unclear from your code snippets where the backends are initialized. |
Apologies for one liners answers, I guess I shouldn’t be reading on my phone. You can set a data write breakpoint in Visual Studio debugger, or step in ErrorCheckNewFrameSanityChecks() to find where the flag is being disabled, there are various possible reasons for the disabling. |
Thank you very much for your reactivity and investment in every issues @ocornut. 🙏 |
Well, as expected this was entirely my fault: I simply had forgotten to update the backend code (imgui_impl_glfw.h/cpp + imgui_impl_vulkan.h/cpp) of the project since I was initially running a "non-multi-viewport". I'm ashamed... (I spent 4 hours yesterday rechecking everything and, everytime,I forgot the same step). Sorry to have polluted the issues for that. Thank you again for putting me back on track! 🙇♂️ |
Version/Branch of Dear ImGui:
Version: 1.88
Branch: docking
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_glfw.cpp + imgui_impl_vulkan.cpp
Operating System: Win 10
My Issue/Question:
I doubt this is an ImGui bug otherwise I think there would be more people talking about it. So, this is probably my fault and I sincerely apologize for the bother.
I am trying to switch from a project that was not using multi-viewport to a project that is using multi-viewport.
I read this post and this thread.
I added the relevant config flag (
ImGuiConfigFlags_ViewportsEnable
) in the initialization part of my code before at the same place as in provided example for glfw and vulkan. (see screenshot 1).As far as I can tell, the rest of my "initialization code" is also identical to the provided example for glfw and vulkan.
Then, according to my debug information,
ImGuiConfigFlags_ViewportsEnable
stays true untilImGui::NewFrame();
is called in my update loop (see screenshot 2 and 3).As a result, multiviewport is never accessible at runtime.
Also, if I try to forcefully add the flag via the Demo Window, I can see the Demo Window jiterring, trying to deisplay the additional
CheckBoxFlags()
butImGuiConfigFlags_ViewportsEnable
is immediately set back to false.Could anyone point out my mistake?
Thank you in advance!
Screenshots/Video
The text was updated successfully, but these errors were encountered: