Skip to content
Juna edited this page Aug 4, 2026 · 3 revisions

Frequently Asked Questions

Before opening an issue on GitHub, please first check whether your question has already been answered here.


"Missing" functions, overloads or enums

Q: Why are there missing functions or overloads in ImGui?

A: The missing functions or overloads you may encounter in ImGui are due to certain functionalities being classified as internal to the library. These internal functions are not exposed through the main ImGui interface.

To access these functions, you should use ImGuiP instead. ImGuiP includes these internal functionalities that are not part of the standard ImGui interface.

Common issue: When using ImGuiP functions, you may run into confusing cases such as missing overloads, type mismatches, or “weird casts.” For example:

ImGuiP.DockBuilderAddNode(dock, (ImGuiDockNodeFlags)ImGuiDockNodeFlagsPrivate.Space);

At first glance this looks odd, but what’s happening is that ImGuiDockNodeFlagsPrivate is effectively the same enum as ImGuiDockNodeFlags — the “Private” version is just an internal extension that lives outside the public API. That’s why you need to cast it when calling functions that expect the public enum.

This design choice ensures a clear separation between public and internal APIs. For more details on why this decision was made, refer to this issue: #16.


Common custom Backend issues

Multi-Viewport related issues

Due to ABI issues on windows the function signatures GetWindowPos and GetWindowSize differ from other Operation systems

Windows signatures:

        private static unsafe Vector2* GetWindowPos(Vector2* size, ImGuiViewport* viewport)
        {
            ViewportData* vd = (ViewportData*)viewport->PlatformUserData;
            int x = 0, y = 0;
            SDL.GetWindowPosition(vd->Window, &x, &y);
            *size = new Vector2(x, y);
            return size;
        }

        private static unsafe Vector2* GetWindowSize(Vector2* size, ImGuiViewport* viewport)
        {
            ViewportData* vd = (ViewportData*)viewport->PlatformUserData;
            int w = 0, h = 0;
            SDL.GetWindowSize(vd->Window, &w, &h);
            *size = new Vector2(w, h);
            return size;
        }

Linux (and others) signatures:

        private static unsafe Vector2 GetWindowPos(ImGuiViewport* viewport)
        {
            ViewportData* vd = (ViewportData*)viewport->PlatformUserData;
            int x = 0, y = 0;
            SDL.GetWindowPosition(vd->Window, &x, &y);
            return new Vector2(x, y);
        }

        private static unsafe Vector2 GetWindowSize(ImGuiViewport* viewport)
        {
            ViewportData* vd = (ViewportData*)viewport->PlatformUserData;
            int w = 0, h = 0;
            SDL.GetWindowSize(vd->Window, &w, &h);
            return new Vector2(w, h);
        }

for more information on this, visit those issues: #9 #9-line


Why does backend initialization crash with 0xC0000005 or an ExecutionEngineException?

Each Hexa.NET.ImGui backend must be explicitly assigned the ImGui context it should use.

Backends do not automatically inherit the context currently set through ImGui. Calling SetCurrentContext for every platform and renderer backend is therefore mandatory and must happen before backend initialization or any other backend function is called.

ImGuiImplGLFW.SetCurrentContext(guiContext);

if (!ImGuiImplGLFW.InitForOpenGL(Unsafe.BitCast<GLFWwindowPtr, Hexa.NET.ImGui.Backends.GLFW.GLFWwindowPtr>(window), true))
{
    Console.WriteLine("Failed to initialize the GLFW backend.");
    GLFW.Terminate();
    return;
}

ImGuiImplOpenGL3.SetCurrentContext(guiContext);

if (!ImGuiImplOpenGL3.Init(glslVersion))
{
    Console.WriteLine("Failed to initialize the OpenGL 3 backend.");
    return;
}

This applies independently to every backend in use, including platform backends such as GLFW, SDL, or Win32 and renderer backends such as OpenGL 3, DirectX 11, DirectX 12, or Vulkan.

If the context is not set, the backend may dereference an invalid or null context pointer. This typically results in a native access violation with exception code 0xC0000005, which may surface in .NET as an ExecutionEngineException.

Creating and setting the main ImGui context is not sufficient:

ImGui.SetCurrentContext(guiContext);

The same context must also be assigned explicitly to every backend:

ImGuiImplGLFW.SetCurrentContext(guiContext);
ImGuiImplOpenGL3.SetCurrentContext(guiContext);