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

ImGui assertion fails at resize event on macOS #2173

Open
miko007 opened this issue Jun 3, 2020 · 4 comments
Open

ImGui assertion fails at resize event on macOS #2173

miko007 opened this issue Jun 3, 2020 · 4 comments
Labels

Comments

@miko007
Copy link

miko007 commented Jun 3, 2020

If one resizes the window on macOS and ImGui is used, the cinder app crashes, because the assertion g.WithinFrameScope fails. To fix this, line 528 (commit cd1d701) in src/cinder/CinderImGui.cpp

sWindowConnections[window] += ci::app::App::get()->getSignalUpdate().connect( std::bind( ImGui_ImplCinder_NewFrameGuard, window ) );
hast to be changed to

    sWindowConnections[window] += window->getSignalDraw().connect( std::bind( ImGui_ImplCinder_NewFrameGuard, window ) );

As of the huge backlog of pull requests, i will not open another one. Maybe one of the developers can implement this little fix directly.

@num3ric
Copy link
Contributor

num3ric commented Jun 9, 2020

Hi @miko007, thanks for the report. Unfortunately, I don't have access to a mac with Xcode to replicate this issue at the moment.

However, using the window's draw signal would prevent the use of Dear ImGui in the app update() function (a common pattern for small apps/samples). Using ImGui:: functions there would then also result in the same g.WithinFrameScope assertion error.

A platform-specific fix may instead affect the ImGui_ImplCinder_Resize or the ImGui_ImplCinder_NewFrameGuard functions, but hard to tell from afar.

@miko007
Copy link
Author

miko007 commented Jun 9, 2020

that is correct, while i am not shure why one could not do the gui in App::draw() instead, because thats what it is for, right?

But if that is a concern, i am not really shure how to proceed from here, as ImGui is pretty much not usable on macOS without the fix...

@num3ric
Copy link
Contributor

num3ric commented Jun 10, 2020

Got my hands on a Mac so I'll be able to take a look soon.

@davidgranstrom
Copy link

davidgranstrom commented Sep 17, 2020

I also noticed this issue on macOS when trying out Cinder. I rebuilt the library with the patch from #2178 and resizing (with ImGui) seem to work fine now!

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

4 participants