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

Some samples with ImGui crash on macOS when window is resized #2236

Open
gaborpapp opened this issue Apr 6, 2021 · 2 comments
Open

Some samples with ImGui crash on macOS when window is resized #2236

gaborpapp opened this issue Apr 6, 2021 · 2 comments
Labels

Comments

@gaborpapp
Copy link
Contributor

When the window is resized or made full screen the following assertion is thrown:

Assertion failed: (g.WithinFrameScope), function Begin, file /cinder/src/imgui/imgui.cpp, line 5380.

It is reproducible with PickingFBO (resized or full screen), DeferredShading (full screen), but it does not happen with other ImGui samples like DeferredShadingAdvanced, ClothSimulation, NormalMapping, ShadowMapping.

macOS Catalina 10.15.7, latest cinder HEAD bb15730

@simongeilfus
Copy link
Contributor

As far as I can tell, the new implementation doesn't have the same safeguards we had in Cinder-ImGui to prevent crashes when ImGui functions are called inside the draw function. This is probably the reason it crashes in some samples but not others.

I don't think this is a macosx issue as I can reproduce that on Windows with any code in the App draw function. The assert is usually triggered when moving or resizing the window. An easy way to reproduce this is to grab the window and drag it all the way to the side of the screen.

@simongeilfus
Copy link
Contributor

simongeilfus commented Feb 16, 2022

Actually I think @num3ric 's PR here: https://github.com/cinder/Cinder/pull/2178/files would fix the issue on all platforms (with some small edit / removing the ifdef). The app draw function is not guarantied to be called only once for each call to the update function. This is true on Windows and on Mac (probably on Linux too?).

This in turns produces sometimes calls to ImGui::Render that are not paired with their respective ImGui::NewFrame. This produces more or less the same thing as calling ImGui::Begin without calling ImGui::End.

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

No branches or pull requests

3 participants