You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A shared font atlas has some incompatibility with the rendering backend being destroyed for a context. In the example below if you close one of the two windows the imgui widgets in the other window becomes black and the following message is printed:
UNSUPPORTED (log once): POSSIBLE ISSUE: unit 0 GLD_TEXTURE_INDEX_2D is unloadable and bound to sampler type (Float) - using zero texture because texture unloadable
If you do not use a shared font atlas everything works as expected. The metal backend also exhibits similar behavior. I believe it might have something to do with backend context specific data being stored in the globally shared Fonts structure:
Regardless of sharing an atlas, many of default backends don't support multi-context at all, I don't even think the GLFW one does.
On your specific issue: I am not going to aim to look for an immediate fix right now, because my work-in-progress rework of the atlas system doesn't have this issue. You can share an atlas between contexts as long as the same backends are used for all.
For now I suggest you use two atlases.
The only reason I didn't hit this issue years ago is because I was not ever shutting down the backends when closing windows, but now ImGui::DestroyContext asserts that the backend is shutdown.
I think an alternative would be to use a single imgui context with multi viewports but I believe I would need these to be figured out first?
My application needs to be able to programmatically open multiple glfw windows with their native host decorations and be able to close/open them in any order (aka there is no "main" one). Being able to drag imgui windows between the two glfw windows would be awesome but I don't want the glfw windows to be able to be merged.
Version/Branch of Dear ImGui:
master/docking
Back-ends:
imgui_impl_glfw.cpp + imgui_impl_metal.cpp/imgui_impl_opengl3.cpp
Compiler, OS:
macOS + Clang
Details:
A shared font atlas has some incompatibility with the rendering backend being destroyed for a context. In the example below if you close one of the two windows the imgui widgets in the other window becomes black and the following message is printed:
If you do not use a shared font atlas everything works as expected. The metal backend also exhibits similar behavior. I believe it might have something to do with backend context specific data being stored in the globally shared
Fonts
structure:imgui/backends/imgui_impl_opengl3.cpp
Line 695 in 6982ce4
Minimal, Complete and Verifiable Example code:
The text was updated successfully, but these errors were encountered: