Imgui: Runtime error with glfw3

Created on 8 Aug 2016  Â·  6Comments  Â·  Source: ocornut/imgui

Hi, I'm trying to get ImGui to work. I've successfully got it to compile, but when I run my app, it crashes with the following output:

Assertion failed: (g.IO.DisplaySize.x >= 0.0f && g.IO.DisplaySize.y >= 0.0f), function NewFrame, file <path-to-source>/imgui.cpp, line 2073.
fish: './main' terminated by signal SIGABRT (Abort)

I haven't been able to locate the source of this problem. I'm using ImGui with glfw3 and gl3w on macOS with a retina screen. Could the highdpi screen be the problem?

opengl

Most helpful comment

Sorry for the delay! I've been digging through my app and rewriting it from the ground up because of some other issues. I've added ImGui again according to the opengl3 GLFW example and everything seems to be in order now. This issue can be closed.

Thanks for the support!

All 6 comments

I've found that it was due to the fact i wasn't calling the newframe function from imgui_impl_glfw_gl3.cpp. However, though I now have a window, it doesn't respond to any cursor input. I've passed true to the init function to install callbacks, but I don't see any further problems :(

Is there a reason why this functionality isn't part of ImGui, when ImGui cannot work without this boilerplate?

As the OpenGL sample uses glfw (and works fine with inputs) you should be able to follow that code and do the same in yours.

Are you using the glfw3 bindings/examples as is or are you reintegrating it yourself ?

Have you read what this assert says, the comment on the same line as the assert, and the documentation about how to integrate imgui? (comments in imgui.cpp and the example app). You need to setup this value.

On 8 Aug 2016, at 23:14, Jiří Å ebele [email protected] wrote:

Hi, I'm trying to get ImGui to work. I've successfully got it to compile, but when I run my app, it crashes with the following output:

Assertion failed: (g.IO.DisplaySize.x >= 0.0f && g.IO.DisplaySize.y >= 0.0f), function NewFrame, file /imgui.cpp, line 2073.
fish: './main' terminated by signal SIGABRT (Abort)
I haven't been able to locate the source of this problem. I'm using ImGui with glfw3 and gl3w on macOS with a retina screen. Could the highdpi screen be the problem?

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Sorry I answered to your first message before seeing the second one. That code can't be part of imgui because it isnt portable, there are different ways of doing it depending on your engine, etc. If you use Glfw3 you can just copy the two imgui_impl_glfw* files into your project and do the same as main.cpp in the example. You may call the glfw inputs callbacks yourself if you need to chain them.

@jiri Any update on this? Could you provide more data, sources, or shall we close this issue?

Sorry for the delay! I've been digging through my app and rewriting it from the ground up because of some other issues. I've added ImGui again according to the opengl3 GLFW example and everything seems to be in order now. This issue can be closed.

Thanks for the support!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BlackWatersInc picture BlackWatersInc  Â·  3Comments

Folling picture Folling  Â·  3Comments

namuda picture namuda  Â·  3Comments

GrammarLord picture GrammarLord  Â·  3Comments

noche-x picture noche-x  Â·  3Comments