Invalid ImGuiContext when it should be valid #6258
Closed
MilanDierick
started this conversation in
New Users Build/Link/Run issues ONLY!
Replies: 2 comments
-
|
Probably because you are using DLL. Globals are unique to each DLL boundaries so you need to first set the context in each of them. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Thank you for the swift response. You are right, this was the issue. Doing this in my sandbox layer resolved the issue: ImGui::SetCurrentContext(fl::imgui_layer::get_context());
ImGuiMemAllocFunc alloc_func = nullptr;
ImGuiMemFreeFunc free_func = nullptr;
void* user_data = nullptr;
fl::imgui_layer::get_allocator_callbacks(&alloc_func, &free_func, &user_data);
ImGui::SetAllocatorFunctions(alloc_func, free_func, user_data); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have 2 layers with the same base type. These two layers override a
virtual void on_imgui_render() {}. Both layers are added to the same vector, and are iterated on one after the other. Inimgui_layer, the following code returns a valid context, but insandbox_layer, this code returns null.In full:
Beta Was this translation helpful? Give feedback.
All reactions