Problem in ImGui::NewFrame CRASH when calls internal GetDefaultFont() #6063
Replies: 2 comments 3 replies
-
Your repo is private so we can't see it. I suspect you're calling something in the wrong order. Crashes there implies to me that you might be calling Ensure you're running a debug build. You shouldn't be able to get this far without an assert going bang and giving you some info about what you're doing wrong. Carefully compare your code with It'd be a good idea to run both the example and your code at the same time in a debugger and step through each one's initialization one at function at a time to ensure things are happening in the same order. (Or put breakpoints on relevant function calls in each and make sure they're hit in the same order.)
Ideally you should just let the backend use the embedded loader. IE: Don't use
You can still use Glad for your code. |
Beta Was this translation helpful? Give feedback.
-
Version: 1.89.2
Branch: master
Back-ends: custom (GLFW3 + GLAD)
Compiler: Clang
Operating System: MacOS
Trying to follow The Chermo game engine tutorial but I can't make ImGui work
Im trying to follow the chermo tutorial, I noticed that he was using old version of ImGui.
So in the newer I get I need to setIMGUI_IMPL_OPENGL_LOADER_CUSTOM to load my custom GL loader with Glad etc
Im building ImGui and I can see the GLFW OpenGL3 examples working well
So, I think I did every initial setup correctly and Im adding ImGui to my personal engine lib with Add_Subdirectory and linking that correctly. Im about 4 days now trying to fix it or something I did wrong.
I follow every step in Internal new frame and I see ImGui IO getting every info correctly, until this reaches GetDefaultFont() from imgui_internal.h
I got this:
EXC_BAD_ACCESS (code=1, address=0x68)
Everyone tells me is something bad in my code but I review everithing like many many times and im going crazy
Maybe is a newbie error im doing here but im completely stuck so help me please
My Repo Complete:
https://github.com/RodrigoBrombatti/NuloEngine
GL Loader: (just like copy and paste of backends/imgui_impl_opengl3.h and .cpp with glad added)
https://github.com/RodrigoBrombatti/NuloEngine/blob/master/Nulo/src/Nulo/Platform/OpenGL/ImGuiOpenGLRenderer.cpp
Trying to load:
https://github.com/RodrigoBrombatti/NuloEngine/blob/master/Nulo/src/Nulo/ImGui/ImGuiLayer.cpp
What I did to build ImGui:
1 - add submodule
2 - got this CMakeLists.txt for Build image
https://gist.github.com/rokups/f771217b2d530d170db5cb1e08e9a8f4
1 - mkdir build
2 - cmake .. inside imgui with CMakeLists.txt
3 - cmake --build . inside vendor/imgui/build
4 - target my engine lib with imgui and include_directories(vendor/imgui/)
also, my principal CMakeLists.txt
https://github.com/RodrigoBrombatti/NuloEngine/blob/master/CMakeLists.txt
Im using:
Apple MacBook M1 Pro with Apple Silicon (ARM64)
If someone can help me because I don't know what to do anymore
Thanks and have a great new year
Beta Was this translation helpful? Give feedback.
All reactions