Open gaborpapp opened 3 years ago
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.
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
.
When the window is resized or made full screen the following assertion is thrown:
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