GameDevTecnico / cubos

A still very barebones game engine focused on voxels and data-oriented programming
https://gamedevtecnico.github.io/cubos/
MIT License
83 stars 23 forks source link

ImGui::SetCurrentContext should be called on all DLLs/apps that use it #1144

Open RiscadoA opened 4 months ago

RiscadoA commented 4 months ago

Description

Turns out ImGui::SetCurrentContext needs to be called with the created context across DLLs, as the global variables are private to each DLL/app. For example, if the tesseratos library code never calls this function, it will fail when calling an ImGui function.

See https://github.com/ocornut/imgui/issues/2292.

Reproduce

Run tesseratos in some machines with BUILD_ENGINE_SHARED set to TRUE. Will crash due to the ImGui context not being set.

Expected behaviour

It be called once for each execution.