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

Assertion failed: g.frameCount == 0 #7767

Closed
TheSlugInTub opened this issue Jul 4, 2024 · 2 comments
Closed

Assertion failed: g.frameCount == 0 #7767

TheSlugInTub opened this issue Jul 4, 2024 · 2 comments

Comments

@TheSlugInTub
Copy link

Version/Branch of Dear ImGui:

docking

Back-ends:

imgui_impl_opengl3.cpp + imgui_impl_glfw.cpp

Compiler, OS:

Windows 10 + MSVC

Full config/build information:

No response

Details:

I switched from the master branch to the docking branch in my C++ project and now it's giving me this error which it didn't give before: Assertion failed: (g.FrameCount == 0 || g.FrameCount == g.FrameCountPlatformEnded) && "Forgot to call UpdatePlatformWindows() in main loop after EndFrame()? My config flags are set to this:

	io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;  
	io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;      
	io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;

How do I fix this?

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

No response

@GamingMinds-DanielC
Copy link
Contributor

Part of the assertion message:
Forgot to call UpdatePlatformWindows() in main loop after EndFrame()?

So that is probably the source of the problem already. You should take a look at the example projects of the docking branch and pay special attention to the parts that are not in the example projects of the master branch. Building the basic app framework with an example project as a reference is the usual way, so you have to adjust your implementation accordingly.

@ocornut
Copy link
Owner

ocornut commented Jul 8, 2024

What the assert message says.. If you enable ImGuiConfigFlags_ViewportsEnable you need to be calling ImGui::UpdatePlatformWindows() and likely ImGui::RenderPlatformWindowsDefault() in your main loop. Refer to example code.

@ocornut ocornut closed this as completed Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants