-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
Application crash after selecting "io.ConfigFlags: ViewportsEnable" checkbox from inside Dear ImGui Demo > Configuration > Configuration #5371
Comments
Looks good to me, thanks a lot for filling out the template! Short version: The easiest way for you to work around this for now is to enable viewports before calling (If you want your app to start with them disabled you should be able to turn them back off right after initialization.) I can repro this in imgui/examples/example_glfw_opengl3/main.cpp Lines 70 to 71 in 7b5a8e4
Basically what's happening is the backends are initializing without configuring their viewport support internals and don't initialize it when you enable it later. Not sure if we want to support this scenario, but it seems to me like the backends should just call |
Thanks both for your report and analysis.
I wanted to strongly convey that this backend code was optional for people trying to study and reimplement backends.
|
I do worry slightly that this might be misleading in the other direction though: It might imply that your backend should support lazy initialization. There's already quite a few comments in the backends that state when things are optional. Is that not enough in this case too?
It's slightly better in context: Lines 8617 to 8627 in 7b5a8e4
Might just be a matter of moving that first assert to the bottom? |
Sorry if I've misunderstood, but after trying your work around, the same issue persists, except that the application crashes when the program executes For completeness my code looks like this now:
|
In this case simply read what the assert says and compare your code to the examples. You are not calling a function.
|
…wportsEnable after initialization. (#5371)
Pushed 22503bf which makes it possible to enable ImGuiConfigFlags_ViewportsEnable after backend initialization. This should be solved. |
From Config/build Information
Dear ImGui 1.88 WIP (18724)
Branch https://github.com/ocornut/imgui/tree/7b5a8e4f2bbc06eac3b913a7f7df67edff99c538
(Sorry I don't know how to link branches properly)
My Issue/Question:
After checking out the latest docking branch, I was exploring the demo window, after checking the "io.ConfigFlags: ViewportsEnable" checkbox inside Configuration>Configuration of the demo window., the program crashes.
All other checkboxs in the configuration menu work as intended.
This is the error that gets printed:
Screenshots/Video
_
Standalone, minimal, complete and verifiable example:
I haven't actually writtten any code, this bug happened while using ImGui::ShowDemoWindow(), below is all of the imgui code I used in my project
This is my first time submitting a bug report on github so I hope I've done everything right
The text was updated successfully, but these errors were encountered: