Each context creates its own
ImFontAtlas by default. You can share a font atlas between contexts by passing it to CreateContext().CreateContext
Creates a new Dear ImGui context.Parameters
Optional font atlas to share between contexts. If NULL, a new font atlas will be created.
Returns
ImGuiContext*
Pointer to the newly created context.
Example
DestroyContext
Destroys a Dear ImGui context and frees all associated resources.Parameters
ImGuiContext*
default:"NULL"
The context to destroy. If NULL, destroys the current context.
Example
Always destroy contexts before application shutdown to prevent memory leaks.
GetCurrentContext
Retrieves the currently active Dear ImGui context.Returns
ImGuiContext*
Pointer to the current context, or NULL if no context is set.
Example
SetCurrentContext
Sets the active Dear ImGui context. All subsequent ImGui calls will operate on this context.Parameters
ImGuiContext*
required
The context to make active.