Skip to content
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

Closed
LittleCoinCoin opened this issue Feb 27, 2023 · 5 comments

Comments

@LittleCoinCoin
Copy link

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 until ImGui::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() but ImGuiConfigFlags_ViewportsEnable is immediately set back to false.

Could anyone point out my mistake?

Thank you in advance!

Screenshots/Video

  1. Temp-ImGui-mvp-AfterStyling
  2. Temp-ImGui-mvp-update
  3. Temp-ImGui-mvp-log
@ocornut
Copy link
Owner

ocornut commented Feb 27, 2023 via email

@ocornut
Copy link
Owner

ocornut commented Feb 27, 2023

It is unclear from your code snippets where the backends are initialized.

@ocornut
Copy link
Owner

ocornut commented Feb 27, 2023

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.

@LittleCoinCoin
Copy link
Author

Thank you very much for your reactivity and investment in every issues @ocornut. 🙏
I will investigate in this direction and report later.

@LittleCoinCoin
Copy link
Author

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! 🙇‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants