# Multiple Viewports/Windows Dear IMGUI c++

How do I use IMGUI with multiple GLFW windows? I know Dear IMGUI already has a virtual viewport system going in the viewport branch but I found that to be lacking a bit on how to use this new system.

To accomplish this would you share a single GLFWwindow context and using that for a single IMGUI context? Would there be any disadvantages to using this approach?

• I haven't tried this but I would start by making an ImGuiContext for each and initialising with the GLFWwindow per gui context. It looks like the major factor is font resources across contexts. – Jay Jan 19 at 3:40
• You wouldn't share a unique window context to imgui if you have multiple GLFWwindows. You would probably need to create a unique Imgui context and share it between windows – Gabriele Vierti Jan 19 at 7:37