Skip to content

Global context GImGui is not available in C API #115

@memononen

Description

@memononen

This code seems to be omitted from the C API:

#ifndef GImGui
extern IMGUI_API ImGuiContext* GImGui;  // Current implicit context pointer
#endif

I ran into it while trying to implement editable selectable from here: ocornut/imgui#2718 (comment)

I'm not sure if that would require some cast magic to work. I guess a getter function could work too.

This works as workaround:

ImGuiWindow* win = ImGui_GetCurrentWindow();
ImGuiContext* g = win->Ctx;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions