Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

imgui.h

Dear ImGui: the immediate mode GUI library, on which every other module of the bundle builds.

The C++ API of Dear ImGui: the signatures and the documentation of its headers. This page is generated by litgen, the engine behind the Python bindings of Dear ImGui Bundle. Functions without Python bindings are not listed.

imgui.h

Forward declarations and basic types

Scalar data types

Forward declarations: ImDrawList, ImFontAtlas layer

Forward declarations: ImGui layer

Enumerations

Flags (declared as int to allow using as flags without overhead, and to not pollute the top of this file)

Character types (we generally use UTF-8 encoded string in the API. This is storage specifically for a decoded character used for keyboard input and display)

Callback and functions types

ImVec2 (struct)

struct ImVec2
Member
float x,
y;
ImVec2::ImVec2
constexpr inline ImVec2() : x(0.0f), y(0.0f);
constexpr inline ImVec2(float _x, float _y) : x(_x), y(_y);

ImVec4 (struct)

struct ImVec4

ImVec4: 4D vector used to store clipping rectangles, colors etc. [Compile-time configurable type]

Member
float x,
y,
z,
w;
ImVec4::ImVec4
constexpr inline ImVec4() : x(0.0f), y(0.0f), z(0.0f), w(0.0f);
constexpr inline ImVec4(float _x, float _y, float _z, float _w) : x(_x), y(_y), z(_z), w(_w);

Texture identifiers

ImTextureRef (struct)

struct ImTextureRef
Member
ImTextureData* _TexData;A texture, generally owned by a ImFontAtlas. Will convert to ImTextureID during render loop, after texture has been uploaded.
ImTextureID _TexID;OR Low-level backend texture identifier, if already uploaded or created by user/app. Generally provided to e.g. ImGui::Image() calls.
ImTextureRef::ImTextureRef
ImTextureRef();
ImTextureRef(ImTextureID tex_id);
ImTextureRef::GetTexID
inline ImTextureID GetTexID() const;

(private API)

== (_TexData ? _TexData->TexID : _TexID) // Implemented below in the file.

Dear ImGui end-user API functions

(Note that ImGui:: being a namespace, you can add extra ImGui:: functions in your own separate file. Please don’t modify imgui source files!)

Context creation and access

ImGui::CreateContext

IMGUI_API ImGuiContext* CreateContext(ImFontAtlas* shared_font_atlas = NULL);

ImGui::DestroyContext

IMGUI_API void DestroyContext(ImGuiContext* ctx = NULL);

None = destroy current context

ImGui::GetCurrentContext

IMGUI_API ImGuiContext* GetCurrentContext();

ImGui::SetCurrentContext

IMGUI_API void SetCurrentContext(ImGuiContext* ctx);

Main

ImGui::GetIO

IMGUI_API ImGuiIO& GetIO();

access the ImGuiIO structure (mouse/keyboard/gamepad inputs, time, various configuration options/flags)

ImGui::GetPlatformIO

IMGUI_API ImGuiPlatformIO& GetPlatformIO();

access the ImGuiPlatformIO structure (mostly hooks/functions to connect to platform/renderer and OS Clipboard, IME etc.)

ImGui::GetStyle

IMGUI_API ImGuiStyle& GetStyle();

See it live: Tools › Style Editor (also used in 24 other sections)

Tools › Style Editor
Code from the demo
ImGuiStyle& style = GetStyle();

access the Style structure (colors, sizes). Always use PushStyleColor(), PushStyleVar() to modify style mid-frame!

ImGui::NewFrame

IMGUI_API void NewFrame();

start a new Dear ImGui frame, you can submit any command from this point until Render()/EndFrame().

ImGui::EndFrame

IMGUI_API void EndFrame();

ends the Dear ImGui frame. automatically called by Render(). If you don’t need to render data (skipping rendering) you may call EndFrame() without Render()... but you’ll have wasted CPU already! If you don’t need to render, better to not create any windows and not call NewFrame() at all!

ImGui::Render

IMGUI_API void Render();

ends the Dear ImGui frame, finalize the draw data. You can then get call GetDrawData().

ImGui::GetDrawData

IMGUI_API ImDrawData* GetDrawData();

valid after Render() and until the next call to NewFrame(). Call ImGui_ImplXXXX_RenderDrawData() function in your Renderer Backend to render.

Demo, Debug, Information

ImGui::ShowDemoWindow

IMGUI_API void ShowDemoWindow(bool* p_open = NULL);

See it live: Help

Help

create Demo window. demonstrate most ImGui features. call this to learn about the library! try to make it always available in your application!

ImGui::ShowDemoWindow_MaybeDocked

IMGUI_API void ShowDemoWindow_MaybeDocked(bool create_window, bool* p_open = NULL, ImGuiWindowFlags initial_extra_flags = 0, ImVec2 window_pos = ImVec2(0, 0), ImVec2 window_size = ImVec2(0, 0));

ImGui::ShowMetricsWindow

IMGUI_API void ShowMetricsWindow(bool* p_open = NULL);

create Metrics/Debugger window. display Dear ImGui internals: windows, draw commands, various internal state, etc.

[/ADAPT_IMGUI_BUNDLE]

ImGui::ShowDebugLogWindow

IMGUI_API void ShowDebugLogWindow(bool* p_open = NULL);

create Debug Log window. display a simplified log of important dear imgui events.

ImGui::ShowIDStackToolWindow

IMGUI_API void ShowIDStackToolWindow(bool* p_open = NULL);

create Stack Tool window. hover items with mouse to query information about the source of their unique ID.

ImGui::ShowAboutWindow

IMGUI_API void ShowAboutWindow(bool* p_open = NULL);

create About window. display Dear ImGui version, credits and build/system information.

ImGui::ShowStyleEditor

IMGUI_API void ShowStyleEditor(ImGuiStyle* ref = NULL);

add style editor block (not a window). you can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it uses the default style)

ImGui::ShowStyleSelector

IMGUI_API bool ShowStyleSelector(const char* label);

See it live: Tools › Style Editor

Tools › Style Editor
Code from the demo
if (ShowStyleSelector("Colors##Selector"))
    ref_saved_style = style;

add style selector block (not a window), essentially a combo listing the default styles.

ImGui::ShowFontSelector

IMGUI_API void ShowFontSelector(const char* label);

See it live: Tools › Style Editor

Tools › Style Editor
Code from the demo
ShowFontSelector("Fonts##Selector");

add font selector block (not a window), essentially a combo listing the loaded fonts.

ImGui::ShowUserGuide

IMGUI_API void ShowUserGuide();

See it live: Help

Help
Code from the demo
ImGui::SeparatorText("USER GUIDE:");
ImGui::ShowUserGuide();

add basic help/info block (not a window): how to manipulate ImGui as an end-user (mouse/keyboard controls).

ImGui::GetVersion

IMGUI_API const char* GetVersion();

get the compiled version string e.g. “1.80 WIP” (essentially the value for IMGUI_VERSION from the compiled version of imgui.cpp)

Styles

ImGui::StyleColorsDark

IMGUI_API void StyleColorsDark(ImGuiStyle* dst = NULL);

new, recommended style (default)

ImGui::StyleColorsLight

IMGUI_API void StyleColorsLight(ImGuiStyle* dst = NULL);

best used with borders and a custom, thicker font

ImGui::StyleColorsClassic

IMGUI_API void StyleColorsClassic(ImGuiStyle* dst = NULL);

classic imgui style

Windows

ImGui::Begin

IMGUI_API bool Begin(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0);

Python: returns (expanded, p_open): p_open becomes False when the close button is clicked. Without a close button, begin_simple() returns expanded alone.

ImGui::End

IMGUI_API void End();

Child Windows

     BeginChild("Name", size, False)   -> Begin("Name", size, 0); or Begin("Name", size, ImGuiChildFlags_None);
     BeginChild("Name", size, True)    -> Begin("Name", size, ImGuiChildFlags_Borders);

ImGui::BeginChild

IMGUI_API bool BeginChild(const char* str_id, const ImVec2& size = ImVec2(0, 0), ImGuiChildFlags child_flags = 0, ImGuiWindowFlags window_flags = 0);
IMGUI_API bool BeginChild(ImGuiID id, const ImVec2& size = ImVec2(0, 0), ImGuiChildFlags child_flags = 0, ImGuiWindowFlags window_flags = 0);

See it live: Layout › Child windows (also used in 24 other sections)

Layout › Child windows
Code from the demo
static bool disable_mouse_wheel = false;
static bool disable_menu = false;
ImGui::Checkbox("Disable Mouse Wheel", &disable_mouse_wheel);
ImGui::Checkbox("Disable Menu", &disable_menu);

ImGui::EndChild

IMGUI_API void EndChild();

See it live: Layout › Child windows (also used in 23 other sections)

Layout › Child windows
Code from the demo
ImGui::EndChild();

Windows Utilities

ImGui::IsWindowAppearing

IMGUI_API bool IsWindowAppearing();

See it live: Widgets › Combo (also used in 1 other section)

Widgets › Combo
Code from the demo
if (ImGui::BeginCombo("combo 2 (w/ filter)", combo_preview_value, flags))
{
    static ImGuiTextFilter filter;
    if (ImGui::IsWindowAppearing())
    {
        ImGui::SetKeyboardFocusHere();
        filter.Clear();
    }
    ImGui::SetNextItemShortcut(ImGuiMod_Ctrl | ImGuiKey_F);
    ImGui::SetNextItemWidth(-FLT_MIN);
    filter.DrawWithHint("##Filter", "Filter (incl -excl)");

    for (int n = 0; n < IM_COUNTOF(items); n++)
    {
...

ImGui::IsWindowCollapsed

IMGUI_API bool IsWindowCollapsed();

ImGui::IsWindowFocused

IMGUI_API bool IsWindowFocused(ImGuiFocusedFlags flags=0);

See it live: Widgets › Querying Window Status (Focused,Hovered etc.) (also used in 1 other section)

Widgets › Querying Window Status (Focused,Hovered etc.)
Code from the demo
ImGui::BulletText(
    "IsWindowFocused() = %d\n"
    "IsWindowFocused(_ChildWindows) = %d\n"
    "IsWindowFocused(_ChildWindows|_NoPopupHierarchy) = %d\n"
    "IsWindowFocused(_ChildWindows|_DockHierarchy) = %d\n"
    "IsWindowFocused(_ChildWindows|_RootWindow) = %d\n"
    "IsWindowFocused(_ChildWindows|_RootWindow|_NoPopupHierarchy) = %d\n"
    "IsWindowFocused(_ChildWindows|_RootWindow|_DockHierarchy) = %d\n"
    "IsWindowFocused(_RootWindow) = %d\n"
    "IsWindowFocused(_RootWindow|_NoPopupHierarchy) = %d\n"
    "IsWindowFocused(_RootWindow|_DockHierarchy) = %d\n"
    "IsWindowFocused(_AnyWindow) = %d\n",
    ImGui::IsWindowFocused(),
    ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows),
...

is current window focused? or its root/child, depending on flags. see flags for options.

ImGui::IsWindowHovered

IMGUI_API bool IsWindowHovered(ImGuiHoveredFlags flags=0);

See it live: Widgets › Querying Window Status (Focused,Hovered etc.) (also used in 1 other section)

Widgets › Querying Window Status (Focused,Hovered etc.)
Code from the demo
ImGui::BulletText(
    "IsWindowHovered() = %d\n"
    "IsWindowHovered(_AllowWhenBlockedByPopup) = %d\n"
    "IsWindowHovered(_AllowWhenBlockedByActiveItem) = %d\n"
    "IsWindowHovered(_ChildWindows) = %d\n"
    "IsWindowHovered(_ChildWindows|_NoPopupHierarchy) = %d\n"
    "IsWindowHovered(_ChildWindows|_DockHierarchy) = %d\n"
    "IsWindowHovered(_ChildWindows|_RootWindow) = %d\n"
    "IsWindowHovered(_ChildWindows|_RootWindow|_NoPopupHierarchy) = %d\n"
    "IsWindowHovered(_ChildWindows|_RootWindow|_DockHierarchy) = %d\n"
    "IsWindowHovered(_RootWindow) = %d\n"
    "IsWindowHovered(_RootWindow|_NoPopupHierarchy) = %d\n"
    "IsWindowHovered(_RootWindow|_DockHierarchy) = %d\n"
    "IsWindowHovered(_ChildWindows|_AllowWhenBlockedByPopup) = %d\n"
...

is current window hovered and hoverable (e.g. not blocked by a popup/modal)? See ImGuiHoveredFlags_ for options. IMPORTANT: If you are trying to check whether your mouse should be dispatched to Dear ImGui or to your underlying app, you should not use this function! Use the ‘io.WantCaptureMouse’ boolean for that! Refer to FAQ entry “How can I tell whether to dispatch mouse/keyboard to Dear ImGui or my application?” for details.

ImGui::GetWindowDrawList

IMGUI_API ImDrawList* GetWindowDrawList();

See it live: Examples › Custom rendering › Primitives (also used in 10 other sections)

Examples › Custom rendering › Primitives
Code from the demo
ImGui::PushItemWidth(-ImGui::GetFontSize() * 15);
ImGui::PushItemFlag(ImGuiItemFlags_LiveEditOnInput, true);
ImDrawList* draw_list = ImGui::GetWindowDrawList();

get draw list associated to the current window, to append your own drawing primitives

ImGui::GetWindowDpiScale

IMGUI_API float GetWindowDpiScale();

get DPI scale currently associated to the current window’s viewport.

ImGui::GetWindowPos

IMGUI_API ImVec2 GetWindowPos();

See it live: Examples › Custom rendering › BG & FG draw lists (also used in 1 other section)

Code from the demo
ImGui::SameLine(); HelpMarker("The Background draw list will be rendered below every Dear ImGui windows.");
ImGui::Checkbox("Draw in Foreground draw list", &draw_fg);
ImGui::SameLine(); HelpMarker("The Foreground draw list will be rendered over every Dear ImGui windows.");
ImVec2 window_pos = ImGui::GetWindowPos();

get current window position in screen space (IT IS UNLIKELY YOU EVER NEED TO USE THIS. Consider always using GetCursorScreenPos() and GetContentRegionAvail() instead)

ImGui::GetWindowSize

IMGUI_API ImVec2 GetWindowSize();

See it live: Examples › Custom rendering › BG & FG draw lists

Code from the demo
ImGui::Checkbox("Draw in Foreground draw list", &draw_fg);
ImGui::SameLine(); HelpMarker("The Foreground draw list will be rendered over every Dear ImGui windows.");
ImVec2 window_pos = ImGui::GetWindowPos();
ImVec2 window_size = ImGui::GetWindowSize();

get current window size (IT IS UNLIKELY YOU EVER NEED TO USE THIS. Consider always using GetCursorScreenPos() and GetContentRegionAvail() instead)

ImGui::GetWindowWidth

IMGUI_API float GetWindowWidth();

See it live: Tools › Style Editor

Tools › Style Editor
Code from the demo
PushItemWidth(GetWindowWidth() * 0.50f);

get current window width (IT IS UNLIKELY YOU EVER NEED TO USE THIS). Shortcut for GetWindowSize().x.

ImGui::GetWindowHeight

IMGUI_API float GetWindowHeight();

get current window height (IT IS UNLIKELY YOU EVER NEED TO USE THIS). Shortcut for GetWindowSize().y.

ImGui::GetWindowViewport

IMGUI_API ImGuiViewport*GetWindowViewport();

get viewport currently associated to the current window.

Window manipulation

ImGui::SetNextWindowPos

IMGUI_API void SetNextWindowPos(const ImVec2& pos, ImGuiCond cond = 0, const ImVec2& pivot = ImVec2(0, 0));

See it live: Popups › Modals (also used in 4 other sections)

Popups › Modals
Code from the demo
ImVec2 center = ImGui::GetMainViewport()->GetCenter();
ImGui::SetNextWindowPos(center, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));

set next window position. call before Begin(). use pivot=(0.5,0.5) to center on given point, etc.

ImGui::SetNextWindowSize

IMGUI_API void SetNextWindowSize(const ImVec2& size, ImGuiCond cond = 0);

See it live: Examples › Console (also used in 1 other section)

Examples › Console

set next window size. set axis to 0.0 to force an auto-fit on this axis. call before Begin()

ImGui::SetNextWindowSizeConstraints

IMGUI_API void SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& size_max, ImGuiSizeCallback custom_callback = NULL, void* custom_callback_data = NULL);

See it live: Layout › Child windows (also used in 1 other section)

Layout › Child windows
Code from the demo
ImGui::SetNextWindowSizeConstraints(ImVec2(0.0f, ImGui::GetTextLineHeightWithSpacing() * 1), ImVec2(FLT_MAX, ImGui::GetTextLineHeightWithSpacing() * max_height_in_lines));

set next window size limits. use 0.0 or FLT_MAX if you don’t want limits. Use -1 for both min and max of same axis to preserve current size (which itself is a constraint). Use callback to apply non-trivial programmatic constraints.

ImGui::SetNextWindowContentSize

IMGUI_API void SetNextWindowContentSize(const ImVec2& size);

See it live: Widgets › Selection State › Multi-Select (with deletion) (also used in 4 other sections)

Widgets › Selection State › Multi-Select (with deletion)
Code from the demo
const float items_height = ImGui::GetTextLineHeightWithSpacing();
ImGui::SetNextWindowContentSize(ImVec2(0.0f, items.Size * items_height));

set next window content size (~ scrollable client area, which enforce the range of scrollbars). Not including window decorations (title bar, menu bar, etc.) nor WindowPadding. set an axis to 0.0 to leave it automatic. call before Begin()

ImGui::SetNextWindowCollapsed

IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiCond cond = 0);

set next window collapsed state. call before Begin()

ImGui::SetNextWindowFocus

IMGUI_API void SetNextWindowFocus();

set next window to be focused / top-most. call before Begin()

ImGui::SetNextWindowScroll

IMGUI_API void SetNextWindowScroll(const ImVec2& scroll);

set next window scrolling value (use < 0.0 to not affect a given axis).

ImGui::SetNextWindowBgAlpha

IMGUI_API void SetNextWindowBgAlpha(float alpha);

set next window background color alpha. helper to easily override the Alpha component of ImGuiCol_WindowBg/ChildBg/PopupBg. you may also use ImGuiWindowFlags_NoBackground.

ImGui::SetNextWindowViewport

IMGUI_API void SetNextWindowViewport(ImGuiID viewport_id);

set next window viewport

ImGui::SetWindowPos

IMGUI_API void SetWindowPos(const ImVec2& pos, ImGuiCond cond = 0);
IMGUI_API void SetWindowPos(const char* name, const ImVec2& pos, ImGuiCond cond = 0);

(not recommended) set current window position - call within Begin()/End(). prefer using SetNextWindowPos(), as this may incur tearing and side-effects.

ImGui::SetWindowSize

IMGUI_API void SetWindowSize(const ImVec2& size, ImGuiCond cond = 0);
IMGUI_API void SetWindowSize(const char* name, const ImVec2& size, ImGuiCond cond = 0);

See it live: Examples › Constrained Resizing window

Examples › Constrained Resizing window
Code from the demo
if (ImGui::Button("Set 200x200")) { ImGui::SetWindowSize(ImVec2(200, 200)); } ImGui::SameLine();

(not recommended) set current window size - call within Begin()/End(). set to ImVec2(0, 0) to force an auto-fit. prefer using SetNextWindowSize(), as this may incur tearing and minor side-effects.

ImGui::SetWindowCollapsed

IMGUI_API void SetWindowCollapsed(bool collapsed, ImGuiCond cond = 0);
IMGUI_API void SetWindowCollapsed(const char* name, bool collapsed, ImGuiCond cond = 0);

(not recommended) set current window collapsed state. prefer using SetNextWindowCollapsed().

Windows Scrolling

ImGui::GetScrollX

IMGUI_API float GetScrollX();

See it live: Layout › Scrolling › Horizontal (also used in 3 other sections)

Layout › Scrolling › Horizontal
Code from the demo
float scroll_x = ImGui::GetScrollX();

get scrolling amount [0 .. GetScrollMaxX()]

ImGui::GetScrollY

IMGUI_API float GetScrollY();

See it live: Layout › Scrolling › Vertical (also used in 3 other sections)

Layout › Scrolling › Vertical
Code from the demo
float scroll_y = ImGui::GetScrollY();

get scrolling amount [0 .. GetScrollMaxY()]

ImGui::SetScrollX

IMGUI_API void SetScrollX(float scroll_x);

See it live: Layout › Scrolling › Horizontal (also used in 1 other section)

Layout › Scrolling › Horizontal
Code from the demo
ImGuiWindowFlags child_flags = ImGuiWindowFlags_HorizontalScrollbar | (enable_extra_decorations ? ImGuiWindowFlags_AlwaysVerticalScrollbar : 0);
ImGuiID child_id = ImGui::GetID((void*)(intptr_t)i);
bool child_is_visible = ImGui::BeginChild(child_id, ImVec2(-100, child_height), ImGuiChildFlags_Borders, child_flags);
if (scroll_to_off)
    ImGui::SetScrollX(scroll_to_off_px);

set scrolling amount [0 .. GetScrollMaxX()]

ImGui::SetScrollY

IMGUI_API void SetScrollY(float scroll_y);

See it live: Layout › Scrolling › Vertical (also used in 1 other section)

Layout › Scrolling › Vertical
Code from the demo
if (scroll_to_off)
    ImGui::SetScrollY(scroll_to_off_px);

set scrolling amount [0 .. GetScrollMaxY()]

ImGui::GetScrollMaxX

IMGUI_API float GetScrollMaxX();

See it live: Layout › Scrolling › Horizontal (also used in 3 other sections)

Layout › Scrolling › Horizontal
Code from the demo
float scroll_x = ImGui::GetScrollX();
float scroll_max_x = ImGui::GetScrollMaxX();

get maximum scrolling amount ~~ ContentSize.x - WindowSize.x - DecorationsSize.x

ImGui::GetScrollMaxY

IMGUI_API float GetScrollMaxY();

See it live: Layout › Scrolling › Vertical (also used in 3 other sections)

Layout › Scrolling › Vertical
Code from the demo
float scroll_y = ImGui::GetScrollY();
float scroll_max_y = ImGui::GetScrollMaxY();

get maximum scrolling amount ~~ ContentSize.y - WindowSize.y - DecorationsSize.y

ImGui::SetScrollHereX

IMGUI_API void SetScrollHereX(float center_x_ratio = 0.5f);

See it live: Layout › Scrolling › Horizontal

Layout › Scrolling › Horizontal
Code from the demo
if (enable_track && item == track_item)
{
    ImGui::TextColored(ImVec4(1, 1, 0, 1), "Item %d", item);
    ImGui::SetScrollHereX(i * 0.25f); // 0.0f:left, 0.5f:center, 1.0f:right
}

adjust scrolling amount to make current cursor position visible. center_x_ratio=0.0: left, 0.5: center, 1.0: right. When using to make a “default/current item” visible, consider using SetItemDefaultFocus() instead.

ImGui::SetScrollHereY

IMGUI_API void SetScrollHereY(float center_y_ratio = 0.5f);

See it live: Layout › Scrolling › Vertical (also used in 1 other section)

Layout › Scrolling › Vertical
Code from the demo
if (enable_track && item == track_item)
{
    ImGui::TextColored(ImVec4(1, 1, 0, 1), "Item %d", item);
    ImGui::SetScrollHereY(i * 0.25f); // 0.0f:top, 0.5f:center, 1.0f:bottom
}

adjust scrolling amount to make current cursor position visible. center_y_ratio=0.0: top, 0.5: center, 1.0: bottom. When using to make a “default/current item” visible, consider using SetItemDefaultFocus() instead.

ImGui::SetScrollFromPosX

IMGUI_API void SetScrollFromPosX(float local_x, float center_x_ratio = 0.5f);

See it live: Layout › Scrolling › Horizontal

Layout › Scrolling › Horizontal
Code from the demo
if (scroll_to_pos)
    ImGui::SetScrollFromPosX(ImGui::GetCursorStartPos().x + scroll_to_pos_px, i * 0.25f);

adjust scrolling amount to make given position visible. Generally GetCursorStartPos() + offset to compute a valid position.

ImGui::SetScrollFromPosY

IMGUI_API void SetScrollFromPosY(float local_y, float center_y_ratio = 0.5f);

See it live: Layout › Scrolling › Vertical (also used in 1 other section)

Layout › Scrolling › Vertical
Code from the demo
if (scroll_to_pos)
    ImGui::SetScrollFromPosY(ImGui::GetCursorStartPos().y + scroll_to_pos_px, i * 0.25f);

adjust scrolling amount to make given position visible. Generally GetCursorStartPos() + offset to compute a valid position.

Parameters stacks (font)

 - PushFont(font, 0.0)                       // Change font and keep current size
 - PushFont(None, 20.0)                      // Keep font and change current size
 - PushFont(font, 20.0)                      // Change font and set size to 20.0
 - PushFont(font, style.FontSizeBase * 2.0)  // Change font and set size to be twice bigger than current size.
 - PushFont(font, font->LegacySize)           // Change font and set size to size passed to AddFontXXX() function. Same as pre-1.92 behavior.

IMPORTANT before 1.92, fonts had a single size. They can now be dynamically be adjusted.

 - CORRECT:   PushFont(None, style.FontSizeBase)         // use current unscaled size    == does nothing
 - CORRECT:   PushFont(None, style.FontSizeBase * 2.0)  // use current unscaled size x2 == make text twice bigger
 - INCORRECT: PushFont(None, GetFontSize())              // INCORRECT! using size after global factors already applied == GLOBAL SCALING FACTORS WILL APPLY TWICE!
 - INCORRECT: PushFont(None, GetFontSize() * 2.0)       // INCORRECT! using size after global factors already applied == GLOBAL SCALING FACTORS WILL APPLY TWICE!

ImGui::PopFont

IMGUI_API void PopFont();

See it live: Widgets › Text › Font Size

Widgets › Text › Font Size
Code from the demo
ImGui::Text("ImGui::PushFont(nullptr, custom_size);");
ImGui::PushFont(NULL, custom_size);
ImGui::Text("FontSize = %.2f (== %.2f * global_scale)", ImGui::GetFontSize(), custom_size);
ImGui::PopFont();

ImGui::GetFont

IMGUI_API ImFont* GetFont();

See it live: Layout › Text Clipping

Layout › Text Clipping
Code from the demo
case 2:
    ImVec4 clip_rect(p0.x, p0.y, p1.x, p1.y); // AddText() takes a ImVec4* here so let's convert.
    draw_list->AddRectFilled(p0, p1, IM_COL32(90, 90, 120, 255));

get current font

ImGui::GetFontSize

IMGUI_API float GetFontSize();

See it live: Widgets › Text › Font Size (also used in 25 other sections)

Widgets › Text › Font Size
Code from the demo
ImGui::Text("style.FontScaleMain = %0.2f", style.FontScaleMain);
ImGui::Text("style.FontScaleDpi = %0.2f", style.FontScaleDpi);
ImGui::Text("global_scale = ~%0.2f", global_scale); // This is not technically accurate as internal scales may apply, but conceptually let's pretend it is.
ImGui::Text("FontSize = %0.2f", ImGui::GetFontSize());

get current scaled font size (= height in pixels). AFTER global scale factors applied. IMPORTANT DO NOT PASS THIS VALUE TO PushFont()! Use ImGui::GetStyle().FontSizeBase to get value before global scale factors.

ImGui::GetFontBaked

IMGUI_API ImFontBaked* GetFontBaked();

get current font bound at current size // == GetFont()->GetFontBaked(GetFontSize())

Parameters stacks (shared)

ImGui::PushStyleColor

IMGUI_API void PushStyleColor(ImGuiCol idx, ImU32 col);
IMGUI_API void PushStyleColor(ImGuiCol idx, const ImVec4& col);

See it live: Widgets › Basic › Buttons (Colored) (also used in 7 other sections)

Widgets › Basic › Buttons (Colored)
Code from the demo
for (int i = 0; i < 7; i++)
{
    if (i > 0)
        ImGui::SameLine();
    ImGui::PushID(i);
    ImGui::PushStyleColor(ImGuiCol_Button, (ImVec4)ImColor::HSV(i / 7.0f, 0.6f, 0.6f));
    ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV(i / 7.0f, 0.7f, 0.7f));
    ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(i / 7.0f, 0.8f, 0.8f));
    ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 1.0f, 1.0f));
    ImGui::Button("Click");
    ImGui::PopStyleColor(4);
    ImGui::PopID();
}

modify a style color. always use this if you modify the style after NewFrame().

ImGui::PopStyleColor

IMGUI_API void PopStyleColor(int count = 1);

See it live: Widgets › Basic › Buttons (Colored) (also used in 7 other sections)

Widgets › Basic › Buttons (Colored)
Code from the demo
ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(i / 7.0f, 0.8f, 0.8f));
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 1.0f, 1.0f));
ImGui::Button("Click");
ImGui::PopStyleColor(4);

ImGui::PushStyleVar

IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val);
IMGUI_API void PushStyleVar(ImGuiStyleVar idx, const ImVec2& val);

See it live: Widgets › Selectables › Alignment (also used in 15 other sections)

Widgets › Selectables › Alignment
Code from the demo
for (int x = 0; x < 3; x++)
{
    ImVec2 alignment = ImVec2((float)x / 2.0f, (float)y / 2.0f);
    char name[32];
    sprintf(name, "(%.1f,%.1f)", alignment.x, alignment.y);
    if (x > 0) ImGui::SameLine();
    ImGui::PushStyleVar(ImGuiStyleVar_SelectableTextAlign, alignment);
    ImGui::Selectable(name, &selected[3 * y + x], ImGuiSelectableFlags_None, ImVec2(size, size));
    ImGui::PopStyleVar();
}

modify a style float variable. always use this if you modify the style after NewFrame()!

ImGui::PushStyleVarX

IMGUI_API void PushStyleVarX(ImGuiStyleVar idx, float val_x);

See it live: Widgets › Vertical Sliders

Widgets › Vertical Sliders
Code from the demo
ImGui::PushStyleVarX(ImGuiStyleVar_ItemSpacing, (float)(int)(style.ItemSpacing.x * 0.5f));

modify X component of a style ImVec2 variable. "

ImGui::PushStyleVarY

IMGUI_API void PushStyleVarY(ImGuiStyleVar idx, float val_y);

See it live: Widgets › Selection State › Multi-Select (advanced) (also used in 2 other sections)

Widgets › Selection State › Multi-Select (advanced)
Code from the demo
ImVec2 color_button_sz(ImGui::GetFontSize(), ImGui::GetFontSize());
if (widget_type == WidgetType_TreeNode)
    ImGui::PushStyleVarY(ImGuiStyleVar_ItemSpacing, 0.0f);

modify Y component of a style ImVec2 variable. "

ImGui::PopStyleVar

IMGUI_API void PopStyleVar(int count = 1);

See it live: Widgets › Selectables › Alignment (also used in 18 other sections)

Widgets › Selectables › Alignment
Code from the demo
if (x > 0) ImGui::SameLine();
ImGui::PushStyleVar(ImGuiStyleVar_SelectableTextAlign, alignment);
ImGui::Selectable(name, &selected[3 * y + x], ImGuiSelectableFlags_None, ImVec2(size, size));
ImGui::PopStyleVar();

ImGui::PushItemFlag

IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled);

See it live: Widgets › Basic › Buttons (Repeating) (also used in 7 other sections)

Widgets › Basic › Buttons (Repeating)
Code from the demo
static int counter = 0;
float spacing = ImGui::GetStyle().ItemInnerSpacing.x;
ImGui::PushItemFlag(ImGuiItemFlags_ButtonRepeat, true);

modify specified shared item flag, e.g. PushItemFlag(ImGuiItemFlags_NoTabStop, True)

ImGui::PopItemFlag

IMGUI_API void PopItemFlag();

See it live: Widgets › Basic › Buttons (Repeating) (also used in 7 other sections)

Widgets › Basic › Buttons (Repeating)
Code from the demo
ImGui::PopItemFlag();

Parameters stacks (current window)

ImGui::PushItemWidth

IMGUI_API void PushItemWidth(float item_width);

See it live: Tables › Item width (also used in 10 other sections)

Tables › Item width
Code from the demo
ImGui::TableNextRow();
if (row == 0)
{
    // Setup ItemWidth once (instead of setting up every time, which is also possible but less efficient)
    ImGui::TableSetColumnIndex(0);
    ImGui::PushItemWidth(TEXT_BASE_WIDTH * 3.0f); // Small
    ImGui::TableSetColumnIndex(1);
    ImGui::PushItemWidth(-ImGui::GetContentRegionAvail().x * 0.5f);
    ImGui::TableSetColumnIndex(2);
    ImGui::PushItemWidth(-FLT_MIN); // Right-aligned
}

push width of items for common large “item+label” widgets. >0.0: width in pixels, <0.0 align xx pixels to the right of window (so -FLT_MIN always align width to the right side).

ImGui::PopItemWidth

IMGUI_API void PopItemWidth();

See it live: Layout › Widgets Width (also used in 10 other sections)

Layout › Widgets Width
Code from the demo
ImGui::PopItemWidth();

ImGui::SetNextItemWidth

IMGUI_API void SetNextItemWidth(float item_width);

See it live: Widgets › Color › ColorPicker (also used in 19 other sections)

Widgets › Color › ColorPicker
Code from the demo
ImGui::Text("Both types:");
float w = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.y) * 0.40f;
ImGui::SetNextItemWidth(w);

set width of the next common large “item+label” widget. >0.0: width in pixels, <0.0 align xx pixels to the right of window (so -FLT_MIN always align width to the right side)

ImGui::CalcItemWidth

IMGUI_API float CalcItemWidth();

See it live: Examples › Custom rendering › Primitives

Examples › Custom rendering › Primitives
Code from the demo
ImGui::Text("Gradients");
ImVec2 gradient_size = ImVec2(ImGui::CalcItemWidth(), ImGui::GetFrameHeight());

width of item given pushed settings and current cursor position. NOT necessarily the width of last item unlike most ‘Item’ functions.

ImGui::PushTextWrapPos

IMGUI_API void PushTextWrapPos(float wrap_local_pos_x = 0.0f);

See it live: Widgets › Text › Word Wrapping

Widgets › Text › Word Wrapping
Code from the demo
ImDrawList* draw_list = ImGui::GetWindowDrawList();
for (int n = 0; n < 2; n++)
{
    ImGui::Text("Test paragraph %d:", n);
    ImVec2 pos = ImGui::GetCursorScreenPos();
    ImVec2 marker_min = ImVec2(pos.x + wrap_width, pos.y);
    ImVec2 marker_max = ImVec2(pos.x + wrap_width + 10, pos.y + ImGui::GetTextLineHeight());
    ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + wrap_width);
    if (n == 0)
        ImGui::Text("The lazy dog is a good dog. This paragraph should fit within %.0f pixels. Testing a 1 character word. The quick brown fox jumps over the lazy dog.", wrap_width);
    else
        ImGui::Text("aaaaaaaa bbbbbbbb, c cccccccc,dddddddd. d eeeeeeee   ffffffff. gggggggg!hhhhhhhh");

    // Draw actual text bounding box, following by marker of our expected limit (should not overlap!)
...

push word-wrapping position for Text*() commands. < 0.0: no wrapping; 0.0: wrap to end of window (or column); > 0.0: wrap at ‘wrap_pos_x’ position in window local space

ImGui::PopTextWrapPos

IMGUI_API void PopTextWrapPos();

See it live: Widgets › Text › Word Wrapping

Widgets › Text › Word Wrapping
Code from the demo
draw_list->AddRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), IM_COL32(255, 255, 0, 255));
draw_list->AddRectFilled(marker_min, marker_max, IM_COL32(255, 0, 255, 255));
ImGui::PopTextWrapPos();

Style read access

ImGui::GetFontTexUvWhitePixel

IMGUI_API ImVec2 GetFontTexUvWhitePixel();

get UV coordinate for a white pixel, useful to draw custom shapes via the ImDrawList API

ImGui::GetColorU32

IMGUI_API ImU32 GetColorU32(ImGuiCol idx, float alpha_mul = 1.0f);
IMGUI_API ImU32 GetColorU32(const ImVec4& col);
IMGUI_API ImU32 GetColorU32(ImU32 col, float alpha_mul = 1.0f);

See it live: Tables › Background color (also used in 6 other sections)

Tables › Background color
Code from the demo
if (row_bg_type != 0)
{
    ImU32 row_bg_color = ImGui::GetColorU32(row_bg_type == 1 ? ImVec4(0.7f, 0.3f, 0.3f, 0.65f) : ImVec4(0.2f + row * 0.1f, 0.2f, 0.2f, 0.65f)); // Flat or Gradient?
    ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0 + row_bg_target, row_bg_color);
}

retrieve given style color with style alpha applied and optional extra alpha multiplier, packed as a 32-bit value suitable for ImDrawList

Layout cursor positioning

   - Absolute coordinate:        GetCursorScreenPos(), SetCursorScreenPos(), all ImDrawList:: functions. -> this is the preferred way forward.
   - Window-local coordinates:   SameLine(offset), GetCursorPos(), SetCursorPos(), GetCursorStartPos(), PushTextWrapPos()
   - Window-local coordinates:   GetContentRegionMax(), GetWindowContentRegionMin(), GetWindowContentRegionMax() --> all obsoleted. YOU DON'T NEED THEM.

ImGui::GetCursorScreenPos

IMGUI_API ImVec2 GetCursorScreenPos();

See it live: Widgets › Text › Word Wrapping (also used in 10 other sections)

Widgets › Text › Word Wrapping
Code from the demo
ImDrawList* draw_list = ImGui::GetWindowDrawList();
for (int n = 0; n < 2; n++)
{
    ImGui::Text("Test paragraph %d:", n);
    ImVec2 pos = ImGui::GetCursorScreenPos();
    ImVec2 marker_min = ImVec2(pos.x + wrap_width, pos.y);
    ImVec2 marker_max = ImVec2(pos.x + wrap_width + 10, pos.y + ImGui::GetTextLineHeight());
    ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + wrap_width);
    if (n == 0)
        ImGui::Text("The lazy dog is a good dog. This paragraph should fit within %.0f pixels. Testing a 1 character word. The quick brown fox jumps over the lazy dog.", wrap_width);
    else
        ImGui::Text("aaaaaaaa bbbbbbbb, c cccccccc,dddddddd. d eeeeeeee   ffffffff. gggggggg!hhhhhhhh");

    // Draw actual text bounding box, following by marker of our expected limit (should not overlap!)
...

cursor position, absolute coordinates. THIS IS YOUR BEST FRIEND (prefer using this rather than GetCursorPos(), also more useful to work with ImDrawList API).

ImGui::SetCursorScreenPos

IMGUI_API void SetCursorScreenPos(const ImVec2& pos);

See it live: Layout › Overlap Mode (also used in 2 other sections)

Layout › Overlap Mode
Code from the demo
ImGui::Button("Button 1", ImVec2(80, 80));
ImGui::SetCursorScreenPos(button2_pos);

cursor position, absolute coordinates. THIS IS YOUR BEST FRIEND.

ImGui::GetContentRegionAvail

IMGUI_API ImVec2 GetContentRegionAvail();

See it live: Layout › Widgets Width (also used in 15 other sections)

Layout › Widgets Width
Code from the demo
ImGui::Text("SetNextItemWidth/PushItemWidth(GetContentRegionAvail().x * 0.5f)");
ImGui::SameLine(); HelpMarker("Half of available width.\n(~ right-cursor_pos)\n(works within a column set)");
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x * 0.5f);

available space from current position. THIS IS YOUR BEST FRIEND.

ImGui::GetCursorPos

IMGUI_API ImVec2 GetCursorPos();

See it live: Widgets › Text › Word Wrapping

Widgets › Text › Word Wrapping
Code from the demo
ImDrawList* draw_list = ImGui::GetWindowDrawList();
for (int n = 0; n < 2; n++)
{
    ImGui::Text("Test paragraph %d:", n);
    ImVec2 pos = ImGui::GetCursorScreenPos();
    ImVec2 marker_min = ImVec2(pos.x + wrap_width, pos.y);
    ImVec2 marker_max = ImVec2(pos.x + wrap_width + 10, pos.y + ImGui::GetTextLineHeight());
    ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + wrap_width);
    if (n == 0)
        ImGui::Text("The lazy dog is a good dog. This paragraph should fit within %.0f pixels. Testing a 1 character word. The quick brown fox jumps over the lazy dog.", wrap_width);
    else
        ImGui::Text("aaaaaaaa bbbbbbbb, c cccccccc,dddddddd. d eeeeeeee   ffffffff. gggggggg!hhhhhhhh");

    // Draw actual text bounding box, following by marker of our expected limit (should not overlap!)
...

[window-local] cursor position in window-local coordinates. This is not your best friend.

ImGui::GetCursorPosX

IMGUI_API float GetCursorPosX();

See it live: Layout › Child windows

Layout › Child windows
Code from the demo
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + (float)offset_x);

[window-local] "

ImGui::GetCursorPosY

IMGUI_API float GetCursorPosY();

[window-local] "

ImGui::SetCursorPos

IMGUI_API void SetCursorPos(const ImVec2& local_pos);

[window-local] "

ImGui::SetCursorPosX

IMGUI_API void SetCursorPosX(float local_x);

See it live: Layout › Child windows

Layout › Child windows
Code from the demo
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + (float)offset_x);

[window-local] "

ImGui::SetCursorPosY

IMGUI_API void SetCursorPosY(float local_y);

[window-local] "

ImGui::GetCursorStartPos

IMGUI_API ImVec2 GetCursorStartPos();

See it live: Layout › Scrolling › Vertical (also used in 1 other section)

Layout › Scrolling › Vertical
Code from the demo
if (scroll_to_pos)
    ImGui::SetScrollFromPosY(ImGui::GetCursorStartPos().y + scroll_to_pos_px, i * 0.25f);

[window-local] initial cursor position, in window-local coordinates. Call GetCursorScreenPos() after Begin() to get the absolute coordinates version.

Other layout functions

ImGui::Separator

IMGUI_API void Separator();

separator, generally horizontal. inside a menu bar or in horizontal layout mode, this becomes a vertical separator.

ImGui::SameLine

IMGUI_API void SameLine(float offset_from_start_x=0.0f, float spacing=-1.0f);

See it live: Layout › Basic Horizontal Layout › SameLine (also used in 98 other sections)

Layout › Basic Horizontal Layout › SameLine
Code from the demo
ImGui::Text("Two items: Hello"); ImGui::SameLine();

call between widgets or groups to layout them horizontally. X position given in window coordinates.

ImGui::NewLine

IMGUI_API void NewLine();

See it live: Widgets › Images › Textured buttons

Widgets › Images › Textured buttons
Code from the demo
ImGui::NewLine();

undo a SameLine() or force a new line when in a horizontal-layout context.

ImGui::Spacing

IMGUI_API void Spacing();

add vertical spacing.

ImGui::Dummy

IMGUI_API void Dummy(const ImVec2& size);

See it live: Layout › Basic Horizontal Layout › Dummy (also used in 6 other sections)

Layout › Basic Horizontal Layout › Dummy
Code from the demo
ImVec2 button_sz(40, 40);
ImGui::Button("A", button_sz); ImGui::SameLine();
ImGui::Dummy(button_sz); ImGui::SameLine();

add a dummy item of given size. unlike InvisibleButton(), Dummy() won’t take the mouse click or be navigable into.

ImGui::Indent

IMGUI_API void Indent(float indent_w = 0.0f);

See it live: Layout › Widgets Width (also used in 8 other sections)

Layout › Widgets Width
Code from the demo
ImGui::SameLine(); HelpMarker("Fixed width.");
ImGui::PushItemWidth(100);
ImGui::DragFloat("float##1b", &f);
if (show_indented_items)
{
    ImGui::Indent();
    ImGui::DragFloat("float (indented)##1b", &f);
    ImGui::Unindent();
}

move content position toward the right, by indent_w, or style.IndentSpacing if indent_w <= 0

ImGui::Unindent

IMGUI_API void Unindent(float indent_w = 0.0f);

See it live: Layout › Widgets Width (also used in 8 other sections)

Layout › Widgets Width
Code from the demo
ImGui::SameLine(); HelpMarker("Fixed width.");
ImGui::PushItemWidth(100);
ImGui::DragFloat("float##1b", &f);
if (show_indented_items)
{
    ImGui::Indent();
    ImGui::DragFloat("float (indented)##1b", &f);
    ImGui::Unindent();
}

move content position back to the left, by indent_w, or style.IndentSpacing if indent_w <= 0

ImGui::BeginGroup

IMGUI_API void BeginGroup();

See it live: Layout › Groups (also used in 6 other sections)

Layout › Groups
Code from the demo
ImGui::BeginGroup();

lock horizontal starting position

ImGui::EndGroup

IMGUI_API void EndGroup();

See it live: Layout › Groups (also used in 6 other sections)

Layout › Groups
Code from the demo
ImGui::BeginGroup();
ImGui::Button("CCC");
ImGui::Button("DDD");
ImGui::EndGroup();

unlock horizontal starting position + capture the whole group bounding box into one “item” (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.)

ImGui::AlignTextToFramePadding

IMGUI_API void AlignTextToFramePadding();

See it live: Layout › Text Baseline Alignment (also used in 9 other sections)

Layout › Text Baseline Alignment
Code from the demo
ImGui::AlignTextToFramePadding();

vertically align upcoming text baseline to FramePadding.y so that it will align properly to regularly framed items (call if you have text on a line before a framed item)

ImGui::GetTextLineHeight

IMGUI_API float GetTextLineHeight();

See it live: Widgets › Text Input › Multi-line Text Input (also used in 5 other sections)

Widgets › Text Input › Multi-line Text Input
Code from the demo
ImGui::CheckboxFlags("ImGuiInputTextFlags_AllowTabInput", &flags, ImGuiInputTextFlags_AllowTabInput);
ImGui::SameLine(); HelpMarker("When _AllowTabInput is set, passing through the widget with Tabbing doesn't automatically activate it, in order to also cycling through subsequent widgets.");
ImGui::CheckboxFlags("ImGuiInputTextFlags_CtrlEnterForNewLine", &flags, ImGuiInputTextFlags_CtrlEnterForNewLine);
ImGui::InputTextMultiline("##source", text, IM_COUNTOF(text), ImVec2(-FLT_MIN, ImGui::GetTextLineHeight() * 16), flags);

~ FontSize

ImGui::GetTextLineHeightWithSpacing

IMGUI_API float GetTextLineHeightWithSpacing();

See it live: Widgets › List Boxes (also used in 11 other sections)

Widgets › List Boxes
Code from the demo
ImGui::Text("Full-width:");
if (ImGui::BeginListBox("##listbox 2", ImVec2(-FLT_MIN, 5 * ImGui::GetTextLineHeightWithSpacing())))
{
    for (int n = 0; n < IM_COUNTOF(items); n++)
    {
        bool is_selected = (item_selected_idx == n);
        ImGuiSelectableFlags flags = (item_highlighted_idx == n) ? ImGuiSelectableFlags_Highlight : 0;
        if (ImGui::Selectable(items[n], is_selected, flags))
            item_selected_idx = n;

        // Set the initial focus when opening the combo (scrolling + keyboard navigation focus)
        if (is_selected)
            ImGui::SetItemDefaultFocus();
    }
...

~ FontSize + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of text)

ImGui::GetFrameHeight

IMGUI_API float GetFrameHeight();

See it live: Widgets › Vertical Sliders (also used in 8 other sections)

Widgets › Vertical Sliders
Code from the demo
ImGuiStyle& style = ImGui::GetStyle();
ImVec2 slider_sz(ImGui::GetFrameHeight(), ImGui::GetFrameHeight() * 9);

~ FontSize + style.FramePadding.y * 2

ImGui::GetFrameHeightWithSpacing

IMGUI_API float GetFrameHeightWithSpacing();

See it live: Layout › Scrolling › Horizontal (more) (also used in 2 other sections)

Layout › Scrolling › Horizontal (more)
Code from the demo
ImGui::SliderInt("Lines", &lines, 1, 15);
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.0f, 1.0f));
ImVec2 scrolling_child_size = ImVec2(0, ImGui::GetFrameHeightWithSpacing() * 7 + 30);

~ FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets)

ID stack/scopes

Read the FAQ (docs/FAQ.md or http://dearimgui.com/faq) for more details about how ID are handled in dear imgui.

ImGui::PushID

IMGUI_API void PushID(const char* str_id);
IMGUI_API void PushID(const void* ptr_id);
IMGUI_API void PushID(int int_id);

See it live: Widgets › Basic › Buttons (Colored) (also used in 33 other sections)

Widgets › Basic › Buttons (Colored)
Code from the demo
for (int i = 0; i < 7; i++)
{
    if (i > 0)
        ImGui::SameLine();
    ImGui::PushID(i);
    ImGui::PushStyleColor(ImGuiCol_Button, (ImVec4)ImColor::HSV(i / 7.0f, 0.6f, 0.6f));
    ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV(i / 7.0f, 0.7f, 0.7f));
    ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(i / 7.0f, 0.8f, 0.8f));
    ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 1.0f, 1.0f));
    ImGui::Button("Click");
    ImGui::PopStyleColor(4);
    ImGui::PopID();
}

push string into the ID stack (will hash string).

ImGui::PopID

IMGUI_API void PopID();

See it live: Widgets › Basic › Buttons (Colored) (also used in 33 other sections)

Widgets › Basic › Buttons (Colored)
Code from the demo
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 1.0f, 1.0f));
ImGui::Button("Click");
ImGui::PopStyleColor(4);
ImGui::PopID();

pop from the ID stack.

ImGui::GetID

IMGUI_API ImGuiID GetID(const char* str_id);
IMGUI_API ImGuiID GetID(const void* ptr_id);
IMGUI_API ImGuiID GetID(int int_id);

See it live: Layout › Scrolling › Vertical (also used in 4 other sections)

Layout › Scrolling › Vertical
Code from the demo
const ImGuiWindowFlags child_flags = enable_extra_decorations ? ImGuiWindowFlags_MenuBar : 0;
const ImGuiID child_id = ImGui::GetID((void*)(intptr_t)i);

calculate unique ID (hash of whole ID stack + given parameter). e.g. if you want to query into ImGuiStorage yourself

Widgets: Text

ImGui::TextUnformatted

IMGUI_API void TextUnformatted(const char* text, const char* text_end = NULL);

See it live: Widgets › Text Filter (also used in 14 other sections)

Widgets › Text Filter
Code from the demo
if (filter.PassFilter(item))
    ImGui::TextUnformatted(item);

raw text without formatting. Practically equivalent to ‘Text(“%s”, text)’ but doesn’t require null terminated string if ‘text_end’ is specified.

ImGui::Text

IMGUI_API void Text(const char* fmt, ...) ;

See it live: Widgets › Text › Font Size (also used in 113 other sections)

Widgets › Text › Font Size
Code from the demo
ImGuiStyle& style = ImGui::GetStyle();
const float global_scale = style.FontScaleMain * style.FontScaleDpi;
ImGui::Text("style.FontScaleMain = %0.2f", style.FontScaleMain);

formatted text

ImGui::TextColored

IMGUI_API void TextColored(const ImVec4& col, const char* fmt, ...) ;

See it live: Widgets › Text › Colored Text (also used in 3 other sections)

Widgets › Text › Colored Text
Code from the demo
ImGui::TextColored(ImVec4(1.0f, 0.0f, 1.0f, 1.0f), "Pink");
shortcut for PushStyleColor(ImGuiCol_Text, col); Text(fmt, ...); PopStyleColor();

ImGui::TextDisabled

IMGUI_API void TextDisabled(const char* fmt, ...) ;

See it live: Widgets › Text › Colored Text (also used in 2 other sections)

Widgets › Text › Colored Text
Code from the demo
ImGui::TextColored(ImVec4(1.0f, 0.0f, 1.0f, 1.0f), "Pink");
ImGui::TextColored(ImVec4(1.0f, 1.0f, 0.0f, 1.0f), "Yellow");
ImGui::TextDisabled("Disabled");
shortcut for PushStyleColor(ImGuiCol_Text, style.Colors[ImGuiCol_TextDisabled]); Text(fmt, ...); PopStyleColor();

ImGui::TextWrapped

IMGUI_API void TextWrapped(const char* fmt, ...) ;

See it live: Widgets › Text › Word Wrapping (also used in 17 other sections)

Widgets › Text › Word Wrapping
Code from the demo
ImGui::TextWrapped(
    "This text should automatically wrap on the edge of the window. The current implementation "
    "for text wrapping follows simple rules suitable for English and possibly other languages.");

shortcut for PushTextWrapPos(0.0); Text(fmt, ...); PopTextWrapPos();. Note that this won’t work on an auto-resizing window if there’s no other widgets to extend the window width, yoy may need to set a size using SetNextWindowSize().

ImGui::LabelText

IMGUI_API void LabelText(const char* label, const char* fmt, ...) ;

See it live: Widgets › Basic › Buttons (Repeating)

Widgets › Basic › Buttons (Repeating)
Code from the demo
ImGui::LabelText("label", "Value");

display text+label aligned the same way as value+label widgets

ImGui::BulletText

IMGUI_API void BulletText(const char* fmt, ...) ;

See it live: Widgets › Bullets (also used in 12 other sections)

Widgets › Bullets
Code from the demo
ImGui::BulletText("Bullet point 1");

shortcut for Bullet()+Text()

ImGui::SeparatorText

IMGUI_API void SeparatorText(const char* label);

See it live: Widgets › Basic (also used in 27 other sections)

Widgets › Basic
Code from the demo
ImGui::SeparatorText("General");

currently: formatted text with a horizontal line

Widgets: Main

ImGui::Button

IMGUI_API bool Button(const char* label, const ImVec2& size = ImVec2(0, 0));

See it live: Widgets › Basic › Button (also used in 42 other sections)

Widgets › Basic › Button
Code from the demo
static int clicked = 0;
if (ImGui::Button("Button"))
    clicked++;

button

ImGui::SmallButton

IMGUI_API bool SmallButton(const char* label);

See it live: Widgets › Bullets (also used in 15 other sections)

Widgets › Bullets
Code from the demo
ImGui::Bullet(); ImGui::Text("Bullet point 3 (two calls)");
ImGui::Bullet(); ImGui::SmallButton("Button");

button with (FramePadding.y == 0) to easily embed within text

ImGui::InvisibleButton

IMGUI_API bool InvisibleButton(const char* str_id, const ImVec2& size, ImGuiButtonFlags flags = 0);

See it live: Layout › Text Clipping (also used in 2 other sections)

Layout › Text Clipping
Code from the demo
for (int n = 0; n < 3; n++)
{
    if (n > 0)
        ImGui::SameLine();

    ImGui::PushID(n);
    ImGui::InvisibleButton("##canvas", size);
    if (ImGui::IsItemActive() && ImGui::IsMouseDragging(ImGuiMouseButton_Left))
    {
        offset.x += ImGui::GetIO().MouseDelta.x;
        offset.y += ImGui::GetIO().MouseDelta.y;
    }
    ImGui::PopID();
    if (!ImGui::IsItemVisible()) // Skip rendering as ImDrawList elements are not clipped.
...

flexible button behavior without the visuals, frequently useful to build custom behaviors using the public api (along with IsItemActive, IsItemHovered, etc.)

ImGui::ArrowButton

IMGUI_API bool ArrowButton(const char* str_id, ImGuiDir dir);

See it live: Widgets › Basic › Buttons (Repeating)

Widgets › Basic › Buttons (Repeating)
Code from the demo
static int counter = 0;
float spacing = ImGui::GetStyle().ItemInnerSpacing.x;
ImGui::PushItemFlag(ImGuiItemFlags_ButtonRepeat, true);
if (ImGui::ArrowButton("##left", ImGuiDir_Left)) { counter--; }

square button with an arrow shape

ImGui::Checkbox

IMGUI_API bool Checkbox(const char* label, bool* v);

See it live: Widgets › Basic › Checkbox (also used in 49 other sections)

Widgets › Basic › Checkbox
Code from the demo
static bool check = true;
ImGui::Checkbox("checkbox", &check);

ImGui::CheckboxFlags

IMGUI_API bool CheckboxFlags(const char* label, int* flags, int flags_value);

See it live: Widgets › Color (also used in 42 other sections)

Widgets › Color
Code from the demo
ImGui::SeparatorText("Options");
ImGui::CheckboxFlags("ImGuiColorEditFlags_NoAlpha", &base_flags, ImGuiColorEditFlags_NoAlpha);

ImGui::RadioButton

IMGUI_API bool RadioButton(const char* label, bool active);
IMGUI_API bool RadioButton(const char* label, int* v, int v_button);

See it live: Widgets › Basic › RadioButton (also used in 8 other sections)

Widgets › Basic › RadioButton
Code from the demo
static int e = 0;
ImGui::RadioButton("radio a", &e, 0); ImGui::SameLine();
use with e.g. if (RadioButton("one", my_value==1)) { my_value = 1; }

ImGui::ProgressBar

IMGUI_API void ProgressBar(float fraction, const ImVec2& size_arg = ImVec2(-FLT_MIN, 0), const char* overlay = NULL);

See it live: Widgets › Progress Bars (also used in 1 other section)

Widgets › Progress Bars
Code from the demo
ImGui::ProgressBar(progress, ImVec2(0.0f, 0.0f));

ImGui::Bullet

IMGUI_API void Bullet();

See it live: Widgets › Bullets (also used in 1 other section)

Widgets › Bullets
Code from the demo
ImGui::Bullet(); ImGui::Text("Bullet point 3 (two calls)");

draw a small circle + keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses

IMGUI_API bool TextLink(const char* label);

hyperlink text button, return True when clicked

ImGui::TextLinkOpenURL

IMGUI_API bool TextLinkOpenURL(const char* label, const char* url = NULL);

See it live: Widgets › Basic › RadioButton (also used in 6 other sections)

Widgets › Basic › RadioButton
Code from the demo
ImGui::AlignTextToFramePadding();
ImGui::TextLinkOpenURL("Hyperlink", "https://github.com/ocornut/imgui/wiki/Error-Handling");

hyperlink text button, automatically open file/url when clicked

Widgets: Images

ImGui::Image

IMGUI_API void Image(ImTextureRef tex_ref, const ImVec2& image_size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1));

See it live: Widgets › Images

Widgets › Images

ImGui::ImageWithBg

IMGUI_API void ImageWithBg(ImTextureRef tex_ref, const ImVec2& image_size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), const ImVec4& bg_col = ImVec4(0, 0, 0, 0), const ImVec4& tint_col = ImVec4(1, 1, 1, 1));

See it live: Widgets › Images

Widgets › Images
Code from the demo
ImVec2 uv_min = ImVec2(0.0f, 0.0f); // Top-left
ImVec2 uv_max = ImVec2(1.0f, 1.0f); // Lower-right
ImGui::PushStyleVar(ImGuiStyleVar_ImageBorderSize, IM_MAX(1.0f, ImGui::GetStyle().ImageBorderSize));
ImGui::ImageWithBg(my_tex_id, ImVec2(my_tex_w, my_tex_h), uv_min, uv_max, ImVec4(0.0f, 0.0f, 0.0f, 1.0f));

ImGui::ImageButton

IMGUI_API bool ImageButton(const char* str_id, ImTextureRef tex_ref, const ImVec2& image_size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), const ImVec4& bg_col = ImVec4(0, 0, 0, 0), const ImVec4& tint_col = ImVec4(1, 1, 1, 1));

See it live: Widgets › Images › Textured buttons

Widgets › Images › Textured buttons
Code from the demo
ImVec2 uv1 = ImVec2(32.0f / my_tex_w, 32.0f / my_tex_h);    // UV coordinates for (32,32) in our texture
ImVec4 bg_col = ImVec4(0.0f, 0.0f, 0.0f, 1.0f);             // Black background
ImVec4 tint_col = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);           // No tint
if (ImGui::ImageButton("", my_tex_id, size, uv0, uv1, bg_col, tint_col))
    pressed_count += 1;

Widgets: Combo Box (Dropdown)

ImGui::BeginCombo

IMGUI_API bool BeginCombo(const char* label, const char* preview_value, ImGuiComboFlags flags = 0);

See it live: Widgets › Combo (also used in 1 other section)

Widgets › Combo
Code from the demo
const char* combo_preview_value = items[item_selected_idx];
if (ImGui::BeginCombo("combo 1", combo_preview_value, flags))
{
    for (int n = 0; n < IM_COUNTOF(items); n++)
    {
        const bool is_selected = (item_selected_idx == n);
        if (ImGui::Selectable(items[n], is_selected))
            item_selected_idx = n;

        // Set the initial focus when opening the combo (scrolling + keyboard navigation focus)
        if (is_selected)
            ImGui::SetItemDefaultFocus();
    }
    ImGui::EndCombo();
...

ImGui::EndCombo

IMGUI_API void EndCombo();

See it live: Widgets › Combo (also used in 1 other section)

Widgets › Combo
Code from the demo
ImGui::EndCombo();

only call EndCombo() if BeginCombo() returns True!

ImGui::Combo

IMGUI_API bool Combo(const char* label, int* current_item, const char* const items[], int items_count, int popup_max_height_in_items = -1);
IMGUI_API bool Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int popup_max_height_in_items = -1);

See it live: Widgets › Basic › Combo (also used in 15 other sections)

Widgets › Basic › Combo
Code from the demo
const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIIIIII", "JJJJ", "KKKKKKK" };
static int item_current = 0;
ImGui::Combo("combo", &item_current, items, IM_COUNTOF(items));

Separate items with \0 within a string, end item-list with \0\0. e.g. “One\0Two\0Three\0”

Widgets: Drag Sliders

ImGui::DragFloat

IMGUI_API bool DragFloat(const char* label, float* v, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", ImGuiSliderFlags flags = 0);

See it live: Widgets › Basic › DragInt, DragFloat (also used in 11 other sections)

Widgets › Basic › DragInt, DragFloat
Code from the demo
static float f1 = 1.00f, f2 = 0.0067f;
ImGui::DragFloat("drag float", &f1, 0.005f);

If v_min >= v_max we have no bound

ImGui::DragFloat2

IMGUI_API bool DragFloat2(const char* label, float v[2], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", ImGuiSliderFlags flags = 0);

See it live: Widgets › Multi-component Widgets (also used in 2 other sections)

Widgets › Multi-component Widgets
Code from the demo
ImGui::SeparatorText("2-wide");
ImGui::InputFloat2("input float2", vec4f);
ImGui::InputInt2("input int2", vec4i);
ImGui::DragFloat2("drag float2", vec4f, 0.01f, 0.0f, 1.0f, NULL, flags);

ImGui::DragFloat3

IMGUI_API bool DragFloat3(const char* label, float v[3], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", ImGuiSliderFlags flags = 0);

See it live: Widgets › Multi-component Widgets

Widgets › Multi-component Widgets
Code from the demo
ImGui::SeparatorText("3-wide");
ImGui::InputFloat3("input float3", vec4f);
ImGui::InputInt3("input int3", vec4i);
ImGui::DragFloat3("drag float3", vec4f, 0.01f, 0.0f, 1.0f, NULL, flags);

ImGui::DragFloat4

IMGUI_API bool DragFloat4(const char* label, float v[4], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", ImGuiSliderFlags flags = 0);

See it live: Widgets › Multi-component Widgets (also used in 2 other sections)

Widgets › Multi-component Widgets
Code from the demo
ImGui::SeparatorText("4-wide");
ImGui::InputFloat4("input float4", vec4f);
ImGui::InputInt4("input int4", vec4i);
ImGui::DragFloat4("drag float4", vec4f, 0.01f, 0.0f, 1.0f, NULL, flags);

ImGui::DragFloatRange2

IMGUI_API bool DragFloatRange2(const char* label, float* v_current_min, float* v_current_max, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", const char* format_max = NULL, ImGuiSliderFlags flags = 0);

See it live: Widgets › Multi-component Widgets

Widgets › Multi-component Widgets
Code from the demo
ImGui::SeparatorText("Ranges");
static float begin = 10, end = 90;
static int begin_i = 100, end_i = 1000;
ImGui::DragFloatRange2("range float", &begin, &end, 0.25f, 0.0f, 100.0f, "Min: %.1f %%", "Max: %.1f %%", ImGuiSliderFlags_AlwaysClamp);

ImGui::DragInt

IMGUI_API bool DragInt(const char* label, int* v, float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* format = "%d", ImGuiSliderFlags flags = 0);

See it live: Widgets › Basic › DragInt, DragFloat (also used in 8 other sections)

Widgets › Basic › DragInt, DragFloat
Code from the demo
static int i1 = 50, i2 = 42, i3 = 128;
ImGui::DragInt("drag int", &i1, 1);

If v_min >= v_max we have no bound

ImGui::DragInt2

IMGUI_API bool DragInt2(const char* label, int v[2], float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* format = "%d", ImGuiSliderFlags flags = 0);

See it live: Widgets › Multi-component Widgets

Widgets › Multi-component Widgets
Code from the demo
ImGui::InputFloat2("input float2", vec4f);
ImGui::InputInt2("input int2", vec4i);
ImGui::DragFloat2("drag float2", vec4f, 0.01f, 0.0f, 1.0f, NULL, flags);
ImGui::DragInt2("drag int2", vec4i, 1, 0, 255, NULL, flags);

ImGui::DragInt3

IMGUI_API bool DragInt3(const char* label, int v[3], float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* format = "%d", ImGuiSliderFlags flags = 0);

See it live: Widgets › Multi-component Widgets

Widgets › Multi-component Widgets
Code from the demo
ImGui::InputFloat3("input float3", vec4f);
ImGui::InputInt3("input int3", vec4i);
ImGui::DragFloat3("drag float3", vec4f, 0.01f, 0.0f, 1.0f, NULL, flags);
ImGui::DragInt3("drag int3", vec4i, 1, 0, 255, NULL, flags);

ImGui::DragInt4

IMGUI_API bool DragInt4(const char* label, int v[4], float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* format = "%d", ImGuiSliderFlags flags = 0);

See it live: Widgets › Multi-component Widgets

Widgets › Multi-component Widgets
Code from the demo
ImGui::InputFloat4("input float4", vec4f);
ImGui::InputInt4("input int4", vec4i);
ImGui::DragFloat4("drag float4", vec4f, 0.01f, 0.0f, 1.0f, NULL, flags);
ImGui::DragInt4("drag int4", vec4i, 1, 0, 255, NULL, flags);

ImGui::DragIntRange2

IMGUI_API bool DragIntRange2(const char* label, int* v_current_min, int* v_current_max, float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* format = "%d", const char* format_max = NULL, ImGuiSliderFlags flags = 0);

See it live: Widgets › Multi-component Widgets

Widgets › Multi-component Widgets
Code from the demo
static float begin = 10, end = 90;
static int begin_i = 100, end_i = 1000;
ImGui::DragFloatRange2("range float", &begin, &end, 0.25f, 0.0f, 100.0f, "Min: %.1f %%", "Max: %.1f %%", ImGuiSliderFlags_AlwaysClamp);
ImGui::DragIntRange2("range int", &begin_i, &end_i, 5, 0, 1000, "Min: %d units", "Max: %d units");

ImGui::DragScalar

IMGUI_API bool DragScalar(const char* label, ImGuiDataType data_type, void* p_data, float v_speed = 1.0f, const void* p_min = NULL, const void* p_max = NULL, const char* format = NULL, ImGuiSliderFlags flags = 0);

See it live: Widgets › Data Types › Drags

Widgets › Data Types › Drags
Code from the demo
ImGui::DragScalar("drag s8",        ImGuiDataType_S8,     &s8_v,  drag_speed, drag_clamp ? &s8_zero  : NULL, drag_clamp ? &s8_fifty  : NULL);

ImGui::DragScalarN

IMGUI_API bool DragScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, float v_speed = 1.0f, const void* p_min = NULL, const void* p_max = NULL, const char* format = NULL, ImGuiSliderFlags flags = 0);

See it live: Examples › Property editor

Examples › Property editor
Code from the demo
case ImGuiDataType_S32:
{
    int v_min = INT_MIN, v_max = INT_MAX;
    ImGui::SetNextItemWidth(-FLT_MIN);
    ImGui::DragScalarN("##Editor", field_desc.DataType, field_ptr, field_desc.DataCount, 1.0f, &v_min, &v_max);
    break;
}

Widgets: Regular Sliders

ImGui::SliderFloat

IMGUI_API bool SliderFloat(const char* label, float* v, float v_min, float v_max, const char* format = "%.3f", ImGuiSliderFlags flags = 0);

See it live: Widgets › Basic › SliderInt, SliderFloat (also used in 12 other sections)

Widgets › Basic › SliderInt, SliderFloat
Code from the demo
static float f1 = 0.123f, f2 = 0.0f;
ImGui::SliderFloat("slider float", &f1, 0.0f, 1.0f, "ratio = %.3f");

adjust format to decorate the value with a prefix or a suffix for in-slider labels or unit display.

ImGui::SliderFloat3

IMGUI_API bool SliderFloat3(const char* label, float v[3], float v_min, float v_max, const char* format = "%.3f", ImGuiSliderFlags flags = 0);

See it live: Widgets › Multi-component Widgets (also used in 1 other section)

Widgets › Multi-component Widgets
Code from the demo
ImGui::InputInt3("input int3", vec4i);
ImGui::DragFloat3("drag float3", vec4f, 0.01f, 0.0f, 1.0f, NULL, flags);
ImGui::DragInt3("drag int3", vec4i, 1, 0, 255, NULL, flags);
ImGui::SliderFloat3("slider float3", vec4f, 0.0f, 1.0f, NULL, flags);

ImGui::SliderAngle

IMGUI_API bool SliderAngle(const char* label, float* v_rad, float v_degrees_min = -360.0f, float v_degrees_max = +360.0f, const char* format = "%.0f deg", ImGuiSliderFlags flags = 0);

See it live: Widgets › Basic › SliderAngle (also used in 2 other sections)

Widgets › Basic › SliderAngle
Code from the demo
static float angle = 0.0f;
ImGui::SliderAngle("slider angle", &angle);

ImGui::SliderInt

IMGUI_API bool SliderInt(const char* label, int* v, int v_min, int v_max, const char* format = "%d", ImGuiSliderFlags flags = 0);

See it live: Widgets › Basic › SliderInt, SliderFloat (also used in 9 other sections)

Widgets › Basic › SliderInt, SliderFloat
Code from the demo
static int i1 = 0;
ImGui::SliderInt("slider int", &i1, -1, 3);

ImGui::SliderInt2

IMGUI_API bool SliderInt2(const char* label, int v[2], int v_min, int v_max, const char* format = "%d", ImGuiSliderFlags flags = 0);

See it live: Widgets › Multi-component Widgets

Widgets › Multi-component Widgets
Code from the demo
ImGui::DragFloat2("drag float2", vec4f, 0.01f, 0.0f, 1.0f, NULL, flags);
ImGui::DragInt2("drag int2", vec4i, 1, 0, 255, NULL, flags);
ImGui::SliderFloat2("slider float2", vec4f, 0.0f, 1.0f, NULL, flags);
ImGui::SliderInt2("slider int2", vec4i, 0, 255, NULL, flags);

ImGui::SliderInt3

IMGUI_API bool SliderInt3(const char* label, int v[3], int v_min, int v_max, const char* format = "%d", ImGuiSliderFlags flags = 0);

See it live: Widgets › Multi-component Widgets

Widgets › Multi-component Widgets
Code from the demo
ImGui::DragFloat3("drag float3", vec4f, 0.01f, 0.0f, 1.0f, NULL, flags);
ImGui::DragInt3("drag int3", vec4i, 1, 0, 255, NULL, flags);
ImGui::SliderFloat3("slider float3", vec4f, 0.0f, 1.0f, NULL, flags);
ImGui::SliderInt3("slider int3", vec4i, 0, 255, NULL, flags);

ImGui::SliderInt4

IMGUI_API bool SliderInt4(const char* label, int v[4], int v_min, int v_max, const char* format = "%d", ImGuiSliderFlags flags = 0);

See it live: Widgets › Multi-component Widgets

Widgets › Multi-component Widgets
Code from the demo
ImGui::DragFloat4("drag float4", vec4f, 0.01f, 0.0f, 1.0f, NULL, flags);
ImGui::DragInt4("drag int4", vec4i, 1, 0, 255, NULL, flags);
ImGui::SliderFloat4("slider float4", vec4f, 0.0f, 1.0f, NULL, flags);
ImGui::SliderInt4("slider int4", vec4i, 0, 255, NULL, flags);

ImGui::SliderScalar

IMGUI_API bool SliderScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format = NULL, ImGuiSliderFlags flags = 0);

See it live: Widgets › Data Types › Sliders

Widgets › Data Types › Sliders
Code from the demo
ImGui::SeparatorText("Sliders");
ImGui::SliderScalar("slider s8 full",       ImGuiDataType_S8,     &s8_v,  &s8_min,   &s8_max,   "%d");

ImGui::SliderScalarN

IMGUI_API bool SliderScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, const void* p_min, const void* p_max, const char* format = NULL, ImGuiSliderFlags flags = 0);

See it live: Examples › Property editor

Examples › Property editor
Code from the demo
case ImGuiDataType_Float:
{
    float v_min = 0.0f, v_max = 1.0f;
    ImGui::SetNextItemWidth(-FLT_MIN);
    ImGui::SliderScalarN("##Editor", field_desc.DataType, field_ptr, field_desc.DataCount, &v_min, &v_max);
    break;
}

ImGui::VSliderFloat

IMGUI_API bool VSliderFloat(const char* label, const ImVec2& size, float* v, float v_min, float v_max, const char* format = "%.3f", ImGuiSliderFlags flags = 0);

See it live: Widgets › Vertical Sliders

Widgets › Vertical Sliders
Code from the demo
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, (ImVec4)ImColor::HSV(i / 7.0f, 0.7f, 0.5f));
ImGui::PushStyleColor(ImGuiCol_SliderGrab, (ImVec4)ImColor::HSV(i / 7.0f, 0.8f, 0.7f));
ImGui::PushStyleColor(ImGuiCol_SliderGrabActive, (ImVec4)ImColor::HSV(i / 7.0f, 0.9f, 0.9f));
ImGui::VSliderFloat("##v", slider_sz, &values[i], 0.0f, 1.0f, "");

ImGui::VSliderInt

IMGUI_API bool VSliderInt(const char* label, const ImVec2& size, int* v, int v_min, int v_max, const char* format = "%d", ImGuiSliderFlags flags = 0);

See it live: Widgets › Vertical Sliders

Widgets › Vertical Sliders
Code from the demo
static int int_value = 0;
ImGui::VSliderInt("##int", slider_sz, &int_value, 0, 5);

ImGui::VSliderScalar

IMGUI_API bool VSliderScalar(const char* label, const ImVec2& size, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format = NULL, ImGuiSliderFlags flags = 0);

Widgets: Input with Keyboard

ImGui::InputFloat

IMGUI_API bool InputFloat(const char* label, float* v, float step = 0.0f, float step_fast = 0.0f, const char* format = "%.3f", ImGuiInputTextFlags flags = 0);

See it live: Widgets › Basic › InputInt, InputFloat (also used in 4 other sections)

Widgets › Basic › InputInt, InputFloat
Code from the demo
static float f0 = 0.001f;
ImGui::InputFloat("input float", &f0, 0.01f, 1.0f, "%.3f");

ImGui::InputFloat3

IMGUI_API bool InputFloat3(const char* label, float v[3], const char* format = "%.3f", ImGuiInputTextFlags flags = 0);

See it live: Widgets › Multi-component Widgets (also used in 2 other sections)

Widgets › Multi-component Widgets
Code from the demo
ImGui::SeparatorText("3-wide");
ImGui::InputFloat3("input float3", vec4f);

ImGui::InputInt

IMGUI_API bool InputInt(const char* label, int* v, int step = 1, int step_fast = 100, ImGuiInputTextFlags flags = 0);

See it live: Widgets › Basic › InputInt, InputFloat (also used in 1 other section)

Widgets › Basic › InputInt, InputFloat
Code from the demo
static int i0 = 123;
ImGui::InputInt("input int", &i0);

ImGui::InputInt2

IMGUI_API bool InputInt2(const char* label, int v[2], ImGuiInputTextFlags flags = 0);

See it live: Widgets › Multi-component Widgets

Widgets › Multi-component Widgets
Code from the demo
ImGui::SeparatorText("2-wide");
ImGui::InputFloat2("input float2", vec4f);
ImGui::InputInt2("input int2", vec4i);

ImGui::InputInt3

IMGUI_API bool InputInt3(const char* label, int v[3], ImGuiInputTextFlags flags = 0);

See it live: Widgets › Multi-component Widgets

Widgets › Multi-component Widgets
Code from the demo
ImGui::SeparatorText("3-wide");
ImGui::InputFloat3("input float3", vec4f);
ImGui::InputInt3("input int3", vec4i);

ImGui::InputInt4

IMGUI_API bool InputInt4(const char* label, int v[4], ImGuiInputTextFlags flags = 0);

See it live: Widgets › Multi-component Widgets

Widgets › Multi-component Widgets
Code from the demo
ImGui::SeparatorText("4-wide");
ImGui::InputFloat4("input float4", vec4f);
ImGui::InputInt4("input int4", vec4i);

ImGui::InputDouble

IMGUI_API bool InputDouble(const char* label, double* v, double step = 0.0, double step_fast = 0.0, const char* format = "%.6f", ImGuiInputTextFlags flags = 0);

See it live: Widgets › Basic › InputInt, InputFloat

Widgets › Basic › InputInt, InputFloat
Code from the demo
static double d0 = 999999.00000001;
ImGui::InputDouble("input double", &d0, 0.01f, 1.0f, "%.8f");

ImGui::InputScalar

IMGUI_API bool InputScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_step = NULL, const void* p_step_fast = NULL, const char* format = NULL, ImGuiInputTextFlags flags = 0);

See it live: Widgets › Data Types › Inputs

Widgets › Data Types › Inputs
Code from the demo
ImGui::CheckboxFlags("ImGuiInputTextFlags_ReadOnly", &flags, ImGuiInputTextFlags_ReadOnly);
ImGui::CheckboxFlags("ImGuiInputTextFlags_ParseEmptyRefVal", &flags, ImGuiInputTextFlags_ParseEmptyRefVal);
ImGui::CheckboxFlags("ImGuiInputTextFlags_DisplayEmptyRefVal", &flags, ImGuiInputTextFlags_DisplayEmptyRefVal);
ImGui::InputScalar("input s8",      ImGuiDataType_S8,     &s8_v,  inputs_step ? &s8_one  : NULL, NULL, "%d", flags);

ImGui::InputScalarN

IMGUI_API bool InputScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, const void* p_step = NULL, const void* p_step_fast = NULL, const char* format = NULL, ImGuiInputTextFlags flags = 0);

Widgets: Color Editor/Picker

(tip: the ColorEdit* functions have a little color square that can be left-clicked to open a picker, and right-clicked to open an option menu.)

ImGui::ColorButton

IMGUI_API bool ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFlags flags = 0, const ImVec2& size = ImVec2(0, 0));

See it live: Widgets › Color › ColorButton (with custom Picker popup) (also used in 8 other sections)

Widgets › Color › ColorButton (with custom Picker popup)
Code from the demo
static ImVec4 backup_color;
bool open_popup = ImGui::ColorButton("MyColor##3b", color, base_flags);

display a color square/button, hover for details, return True when pressed.

Widgets: Trees

ImGui::TreeNode

IMGUI_API bool TreeNode(const char* label);
IMGUI_API bool TreeNode(const char* str_id, const char* fmt, ...) ;
IMGUI_API bool TreeNode(const void* ptr_id, const char* fmt, ...) ;

See it live: Widgets › Tree Nodes (also used in 92 other sections)

Widgets › Tree Nodes
Code from the demo
if (ImGui::TreeNode("Basic Trees"))
{
    for (int i = 0; i < 5; i++)
    {
        // Use SetNextItemOpen() so set the default state of a node to be open. We could
        // also use TreeNodeEx() with the ImGuiTreeNodeFlags_DefaultOpen flag to achieve the same thing!
        if (i == 0)
            ImGui::SetNextItemOpen(true, ImGuiCond_Once);

        // Here we use PushID() to generate a unique base ID, and then the "" used as TreeNode id won't conflict.
        // An alternative to using 'PushID() + TreeNode("", ...)' to generate a unique ID is to use 'TreeNode((void*)(intptr_t)i, ...)',
        // aka generate a dummy pointer-sized value to be hashed. The demo below uses that technique. Both are fine.
        ImGui::PushID(i);
        if (ImGui::TreeNode("", "Child %d", i))
...

helper variation to easily decorrelate the id from the displayed string. Read the FAQ about why and how to use ID. to align arbitrary text at the same level as a TreeNode() you can use Bullet().

ImGui::TreeNodeEx

IMGUI_API bool TreeNodeEx(const char* label, ImGuiTreeNodeFlags flags = 0);
IMGUI_API bool TreeNodeEx(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, ...) ;
IMGUI_API bool TreeNodeEx(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, ...) ;

See it live: Widgets › Tree Nodes › Advanced (also used in 10 other sections)

Widgets › Tree Nodes › Advanced
Code from the demo
ImGuiTreeNodeFlags node_flags = base_flags;
if (node_n < 3)
{
    // Items 0..2 are Tree Node
    bool is_open = ImGui::TreeNodeEx((void*)(intptr_t)node_n, node_flags, "Selectable Node %d", node_n);
    if (use_drag_and_drop && ImGui::BeginDragDropSource())
    {
        ImGui::SetDragDropPayload("MY_TREENODE_PAYLOAD_TYPE", NULL, 0);
        ImGui::Text("This is a drag and drop source");
        ImGui::EndDragDropSource();
    }
    if (node_n == 2 && (base_flags & ImGuiTreeNodeFlags_SpanLabelWidth))
    {
        // Item 2 has an additional inline button to help demonstrate SpanLabelWidth.
...

ImGui::TreePush

IMGUI_API void TreePush(const char* str_id);
IMGUI_API void TreePush(const void* ptr_id);

See it live: Examples › Property editor

Examples › Property editor
Code from the demo
is_open = (node->Childs.Size > 0 && ImGui::TreeNodeGetOpen((ImGuiID)node->UID));
if (is_open)
    ImGui::TreePush(node->Name);

~ Indent()+PushID(). Already called by TreeNode() when returning True, but you can call TreePush/TreePop yourself if desired.

ImGui::TreePop

IMGUI_API void TreePop();

See it live: Widgets › Selection State › Multi-Select (trees) (also used in 115 other sections)

Widgets › Selection State › Multi-Select (trees)
Code from the demo
ImGui::SetNextItemSelectionUserData((ImGuiSelectionUserData)(intptr_t)node);
ImGui::SetNextItemStorageID((ImGuiID)node->UID);
if (ImGui::TreeNodeEx(node->Name, tree_node_flags))
{
    for (ExampleTreeNode* child : node->Childs)
        DrawNode(child, selection);
    ImGui::TreePop();
}

~ Unindent()+PopID()

ImGui::GetTreeNodeToLabelSpacing

IMGUI_API float GetTreeNodeToLabelSpacing();

See it live: Widgets › Tree Nodes › Advanced

Widgets › Tree Nodes › Advanced
Code from the demo
ImGui::Checkbox("Align label with current X position", &align_label_with_current_x_position);
ImGui::Checkbox("Make Tree Nodes as drag & drop sources", &use_drag_and_drop);
if (align_label_with_current_x_position)
    ImGui::Unindent(ImGui::GetTreeNodeToLabelSpacing());

horizontal distance preceding label when using TreeNode*() or Bullet() == (g.FontSize + style.FramePadding.x*2) for a regular unframed TreeNode

ImGui::CollapsingHeader

IMGUI_API bool CollapsingHeader(const char* label, ImGuiTreeNodeFlags flags = 0);
IMGUI_API bool CollapsingHeader(const char* label, bool* p_visible, ImGuiTreeNodeFlags flags = 0);

See it live: Widgets › Collapsing Headers (also used in 5 other sections)

Widgets › Collapsing Headers
Code from the demo
static bool closable_group = true;
ImGui::Checkbox("Show 2nd header", &closable_group);
if (ImGui::CollapsingHeader("Header", ImGuiTreeNodeFlags_None))
{
    ImGui::Text("IsItemHovered: %d", ImGui::IsItemHovered());
    for (int i = 0; i < 5; i++)
        ImGui::Text("Some content %d", i);
}

if returning ‘True’ the header is open. doesn’t indent nor push on ID stack. user doesn’t have to call TreePop().

ImGui::SetNextItemOpen

IMGUI_API void SetNextItemOpen(bool is_open, ImGuiCond cond = 0);

See it live: Widgets › Tree Nodes › Basic Trees (also used in 24 other sections)

Widgets › Tree Nodes › Basic Trees
Code from the demo
if (i == 0)
    ImGui::SetNextItemOpen(true, ImGuiCond_Once);

set next TreeNode/CollapsingHeader open state.

ImGui::SetNextItemStorageID

IMGUI_API void SetNextItemStorageID(ImGuiID storage_id);

See it live: Widgets › Selection State › Multi-Select (trees) (also used in 1 other section)

Widgets › Selection State › Multi-Select (trees)
Code from the demo
ImGui::SetNextItemSelectionUserData((ImGuiSelectionUserData)(intptr_t)node);
ImGui::SetNextItemStorageID((ImGuiID)node->UID);

set id to use for open/close storage (default to same as item id).

ImGui::TreeNodeGetOpen

IMGUI_API bool TreeNodeGetOpen(ImGuiID storage_id);

See it live: Widgets › Selection State › Multi-Select (trees) (also used in 1 other section)

Widgets › Selection State › Multi-Select (trees)
Code from the demo
static int TreeCloseAndUnselectChildNodes(ExampleTreeNode* node, ImGuiSelectionBasicStorage* selection, int depth = 0)
{
    // Recursive close (the test for depth == 0 is because we call this on a node that was just closed!)
    int unselected_count = selection->Contains((ImGuiID)node->UID) ? 1 : 0;
    if (depth == 0 || ImGui::TreeNodeGetOpen((ImGuiID)node->UID))
    {
        for (ExampleTreeNode* child : node->Childs)
            unselected_count += TreeCloseAndUnselectChildNodes(child, selection, depth + 1);
        ImGui::TreeNodeSetOpen((ImGuiID)node->UID, false);
    }

    // Select root node if any of its child was selected, otherwise unselect
    selection->SetItemSelected((ImGuiID)node->UID, (depth == 0 && unselected_count > 0));
    return unselected_count;
...

retrieve tree node open/close state.

Widgets: Selectables

ImGui::Selectable

IMGUI_API bool Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0, 0));

See it live: Widgets › Selectables › Multiple items on the same line (also used in 30 other sections)

Widgets › Selectables › Multiple items on the same line
Code from the demo
static bool selected[3] = {};
ImGui::SetNextItemAllowOverlap(); ImGui::Selectable("main.c", &selected[0]); ImGui::SameLine(); ImGui::SmallButton("Link 1");

“bool* p_selected” point to the selection state (read-write), as a convenient helper.

ImGui::BeginMultiSelect

IMGUI_API ImGuiMultiSelectIO* BeginMultiSelect(ImGuiMultiSelectFlags flags, int selection_size = -1, int items_count = -1);

See it live: Widgets › Selection State › Multi-Select (also used in 8 other sections)

Widgets › Selection State › Multi-Select
Code from the demo
if (ImGui::BeginChild("##Basket", ImVec2(-FLT_MIN, ImGui::GetFontSize() * 20), ImGuiChildFlags_FrameStyle | ImGuiChildFlags_ResizeY))
{
    ImGuiMultiSelectFlags flags = ImGuiMultiSelectFlags_ClearOnEscape | ImGuiMultiSelectFlags_BoxSelect1d;
    ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(flags, selection.Size, ITEMS_COUNT);
    selection.ApplyRequests(ms_io);

    for (int n = 0; n < ITEMS_COUNT; n++)
    {
        char label[64];
        sprintf(label, "Object %05d: %s", n, ExampleNames[n % IM_COUNTOF(ExampleNames)]);
        bool item_is_selected = selection.Contains((ImGuiID)n);
        ImGui::SetNextItemSelectionUserData(n);
        ImGui::Selectable(label, item_is_selected);
    }
...

Multi-selection system for Selectable(), Checkbox(), TreeNode() functions [BETA]

ImGui::EndMultiSelect

IMGUI_API ImGuiMultiSelectIO* EndMultiSelect();

See it live: Widgets › Selection State › Multi-Select (also used in 8 other sections)

Widgets › Selection State › Multi-Select
Code from the demo
ms_io = ImGui::EndMultiSelect();

ImGui::SetNextItemSelectionUserData

IMGUI_API void SetNextItemSelectionUserData(ImGuiSelectionUserData selection_user_data);

See it live: Widgets › Selection State › Multi-Select (also used in 8 other sections)

Widgets › Selection State › Multi-Select
Code from the demo
for (int n = 0; n < ITEMS_COUNT; n++)
{
    char label[64];
    sprintf(label, "Object %05d: %s", n, ExampleNames[n % IM_COUNTOF(ExampleNames)]);
    bool item_is_selected = selection.Contains((ImGuiID)n);
    ImGui::SetNextItemSelectionUserData(n);
    ImGui::Selectable(label, item_is_selected);
}

ImGui::IsItemToggledSelection

IMGUI_API bool IsItemToggledSelection();

See it live: Examples › Assets Browser

Examples › Assets Browser
Code from the demo
if (ImGui::IsItemToggledSelection())
    item_is_selected = !item_is_selected;

Was the last item selection state toggled? Useful if you need the per-item information before reaching EndMultiSelect(). We only returns toggle event in order to handle clipping correctly.

Widgets: List Boxes

ImGui::BeginListBox

IMGUI_API bool BeginListBox(const char* label, const ImVec2& size = ImVec2(0, 0));

See it live: Widgets › List Boxes (also used in 1 other section)

Widgets › List Boxes
Code from the demo
if (ImGui::BeginListBox("listbox 1"))
{
    for (int n = 0; n < IM_COUNTOF(items); n++)
    {
        const bool is_selected = (item_selected_idx == n);
        if (ImGui::Selectable(items[n], is_selected))
            item_selected_idx = n;

        if (item_highlight && ImGui::IsItemHovered())
            item_highlighted_idx = n;

        // Set the initial focus when opening the combo (scrolling + keyboard navigation focus)
        if (is_selected)
            ImGui::SetItemDefaultFocus();
...

open a framed scrolling region

ImGui::EndListBox

IMGUI_API void EndListBox();

See it live: Widgets › List Boxes (also used in 1 other section)

Widgets › List Boxes
Code from the demo
ImGui::EndListBox();

only call EndListBox() if BeginListBox() returned True!

ImGui::ListBox

IMGUI_API bool ListBox(const char* label, int* current_item, const char* const items[], int items_count, int height_in_items = -1);

See it live: Widgets › Basic › ListBox (also used in 2 other sections)

Widgets › Basic › ListBox
Code from the demo
const char* items[] = { "Apple", "Banana", "Cherry", "Kiwi", "Mango", "Orange", "Pineapple", "Strawberry", "Watermelon" };
static int item_current = 1;
ImGui::ListBox("listbox", &item_current, items, IM_COUNTOF(items), 4);

Widgets: Data Plotting

ImGui::PlotLines

IMGUI_API void PlotLines(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0), int stride = sizeof(float));

See it live: Widgets › Plotting (also used in 1 other section)

Widgets › Plotting
Code from the demo
static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
ImGui::PlotLines("Frame Times", arr, IM_COUNTOF(arr));

ImGui::PlotHistogram

IMGUI_API void PlotHistogram(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0), int stride = sizeof(float));

See it live: Widgets › Plotting (also used in 1 other section)

Widgets › Plotting
Code from the demo
static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
ImGui::PlotLines("Frame Times", arr, IM_COUNTOF(arr));
ImGui::PlotHistogram("Histogram", arr, IM_COUNTOF(arr), 0, NULL, 0.0f, 1.0f, plot_sz);

ImGui::Value

IMGUI_API void Value(const char* prefix, bool b);
IMGUI_API void Value(const char* prefix, int v);
IMGUI_API void Value(const char* prefix, float v, const char* float_format = NULL);

Widgets: Value() Helpers.

Widgets: Menus

ImGui::BeginMenuBar

IMGUI_API bool BeginMenuBar();

See it live: Layout › Child windows (also used in 6 other sections)

Layout › Child windows
Code from the demo
ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 5.0f);
ImGui::BeginChild("ChildR", ImVec2(0, 260), ImGuiChildFlags_Borders, window_flags);
if (!disable_menu && ImGui::BeginMenuBar())
{
    if (ImGui::BeginMenu("Menu"))
    {
        ShowExampleMenuFile();
        ImGui::EndMenu();
    }
    ImGui::EndMenuBar();
}

append to menu-bar of current window (requires ImGuiWindowFlags_MenuBar flag set on parent window).

ImGui::EndMenuBar

IMGUI_API void EndMenuBar();

See it live: Layout › Child windows (also used in 6 other sections)

Layout › Child windows
Code from the demo
ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 5.0f);
ImGui::BeginChild("ChildR", ImVec2(0, 260), ImGuiChildFlags_Borders, window_flags);
if (!disable_menu && ImGui::BeginMenuBar())
{
    if (ImGui::BeginMenu("Menu"))
    {
        ShowExampleMenuFile();
        ImGui::EndMenu();
    }
    ImGui::EndMenuBar();
}

only call EndMenuBar() if BeginMenuBar() returns True!

ImGui::BeginMainMenuBar

IMGUI_API bool BeginMainMenuBar();

create and append to a full screen menu-bar.

ImGui::EndMainMenuBar

IMGUI_API void EndMainMenuBar();

only call EndMainMenuBar() if BeginMainMenuBar() returns True!

ImGui::BeginMenu

IMGUI_API bool BeginMenu(const char* label, bool enabled = true);

See it live: Popups › Menus inside a regular window (also used in 10 other sections)

Popups › Menus inside a regular window
Code from the demo
ImGui::MenuItem("Menu item", "Ctrl+M");
if (ImGui::BeginMenu("Menu inside a regular window"))
{
    ShowExampleMenuFile();
    ImGui::EndMenu();
}

create a sub-menu entry. only call EndMenu() if this returns True!

ImGui::EndMenu

IMGUI_API void EndMenu();

See it live: Popups › Menus inside a regular window (also used in 10 other sections)

Popups › Menus inside a regular window
Code from the demo
ImGui::MenuItem("Menu item", "Ctrl+M");
if (ImGui::BeginMenu("Menu inside a regular window"))
{
    ShowExampleMenuFile();
    ImGui::EndMenu();
}

only call EndMenu() if BeginMenu() returns True!

ImGui::MenuItem

IMGUI_API bool MenuItem(const char* label, const char* shortcut, bool* p_selected, bool enabled = true);

See it live: Popups › Menus inside a regular window (also used in 14 other sections)

Popups › Menus inside a regular window
Code from the demo
ImGui::MenuItem("Menu item", "Ctrl+M");

return True when activated + toggle (*p_selected) if p_selected != None
Python: returns (activated, p_selected): p_selected toggles when activated. menu_item_simple() returns activated alone.

Tooltips

ImGui::BeginTooltip

IMGUI_API bool BeginTooltip();

See it live: Widgets › Tooltips (also used in 1 other section)

Widgets › Tooltips
Code from the demo
else if (always_on == 2 && ImGui::BeginTooltip())
{
    ImGui::ProgressBar(sinf((float)ImGui::GetTime()) * 0.5f + 0.5f, ImVec2(ImGui::GetFontSize() * 25, 0.0f));
    ImGui::EndTooltip();
}

begin/append a tooltip window.

ImGui::EndTooltip

IMGUI_API void EndTooltip();

See it live: Widgets › Tooltips (also used in 1 other section)

Widgets › Tooltips
Code from the demo
ImGui::Button("Fancy", sz);
if (ImGui::BeginItemTooltip())
{
    ImGui::Text("I am a fancy tooltip");
    static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
    ImGui::PlotLines("Curve", arr, IM_COUNTOF(arr));
    ImGui::Text("Sin(time) = %f", sinf((float)ImGui::GetTime()));
    ImGui::EndTooltip();
}

only call EndTooltip() if BeginTooltip()/BeginItemTooltip() returns True!

ImGui::SetTooltip

IMGUI_API void SetTooltip(const char* fmt, ...) ;

See it live: Widgets › Drag and Drop › Tooltip at target location (also used in 3 other sections)

Widgets › Drag and Drop › Tooltip at target location
Code from the demo
ImGuiDragDropFlags drop_target_flags = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoPreviewTooltip;
if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_4F, drop_target_flags))
{
    IM_UNUSED(payload);
    ImGui::SetMouseCursor(ImGuiMouseCursor_NotAllowed);
    ImGui::SetTooltip("Cannot drop here!");
}

set a text-only tooltip. Often used after a ImGui::IsItemHovered() check. Override any previous call to SetTooltip().

ImGui::BeginItemTooltip

IMGUI_API bool BeginItemTooltip();

See it live: Widgets › Tooltips

Widgets › Tooltips
Code from the demo
ImGui::Button("Fancy", sz);
if (ImGui::BeginItemTooltip())
{
    ImGui::Text("I am a fancy tooltip");
    static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
    ImGui::PlotLines("Curve", arr, IM_COUNTOF(arr));
    ImGui::Text("Sin(time) = %f", sinf((float)ImGui::GetTime()));
    ImGui::EndTooltip();
}

begin/append a tooltip window if preceding item was hovered.

Tooltips: helpers for showing a tooltip when hovering an item

ImGui::SetItemTooltip

IMGUI_API void SetItemTooltip(const char* fmt, ...) ;

See it live: Widgets › Tooltips (also used in 5 other sections)

Widgets › Tooltips
Code from the demo
ImGui::Button("Basic", sz);
ImGui::SetItemTooltip("I am a tooltip");

set a text-only tooltip if preceding item was hovered. override any previous call to SetTooltip().

Popups, Modals

ImGui::BeginPopup

IMGUI_API bool BeginPopup(const char* str_id, ImGuiWindowFlags flags = 0);

See it live: Widgets › Color › ColorButton (with custom Picker popup) (also used in 7 other sections)

Widgets › Color › ColorButton (with custom Picker popup)
Code from the demo
float ref_sz = ImGui::GetFrameHeight();
if (ImGui::BeginPopup("mypicker"))
{
    ImGui::Text("MY CUSTOM COLOR PICKER WITH AN AMAZING PALETTE!");
    ImGui::Separator();
    ImGui::ColorPicker4("##picker", (float*)&color, base_flags | ImGuiColorEditFlags_NoSidePreview | ImGuiColorEditFlags_NoSmallPreview);
    ImGui::SameLine();

    ImVec2 color_button_sz(ref_sz * 3.0f, ref_sz * 2.0f);
    ImGui::BeginGroup(); // Lock X position
    ImGui::Text("Current");
    ImGui::ColorButton("##current", color, ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_AlphaPreviewHalf, color_button_sz);
    ImGui::Text("Previous");
    if (ImGui::ColorButton("##previous", backup_color, ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_AlphaPreviewHalf, color_button_sz))
...

return True if the popup is open, and you can start outputting to it.

ImGui::BeginPopupModal

IMGUI_API bool BeginPopupModal(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0);

See it live: Popups › Modals (also used in 1 other section)

Popups › Modals
Code from the demo
if (ImGui::BeginPopupModal("Delete?", NULL, ImGuiWindowFlags_AlwaysAutoResize))
{
    ImGui::Text("All those beautiful files will be deleted.\nThis operation cannot be undone!");
    ImGui::Separator();

    //static int unused_i = 0;
    //ImGui::Combo("Combo", &unused_i, "Delete\0Delete harder\0");

    static bool dont_ask_me_next_time = false;
    ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
    ImGui::Checkbox("Don't ask me next time", &dont_ask_me_next_time);
    ImGui::PopStyleVar();

    if (ImGui::Button("OK", ImVec2(120, 0))) { ImGui::CloseCurrentPopup(); }
...

return True if the modal is open, and you can start outputting to it.

ImGui::EndPopup

IMGUI_API void EndPopup();

See it live: Widgets › Color › ColorButton (with custom Picker popup) (also used in 13 other sections)

Widgets › Color › ColorButton (with custom Picker popup)
Code from the demo
ImGui::EndGroup();
ImGui::EndPopup();

only call EndPopup() if BeginPopupXXX() returns True!

Popups: open/close functions

ImGui::OpenPopup

IMGUI_API bool OpenPopup(const char* str_id, ImGuiPopupFlags popup_flags = 0);
IMGUI_API bool OpenPopup(ImGuiID id, ImGuiPopupFlags popup_flags = 0);

See it live: Popups › Popups (also used in 8 other sections)

Popups › Popups
Code from the demo
if (ImGui::Button("Select.."))
    ImGui::OpenPopup("my_select_popup");

call to mark popup as open (don’t call every frame!).

ImGui::OpenPopupOnItemClick

IMGUI_API bool OpenPopupOnItemClick(const char* str_id = NULL, ImGuiPopupFlags popup_flags = 0);

See it live: Popups › Context menus (also used in 1 other section)

Popups › Context menus
Code from the demo
ImGui::Text("(2) Or right-click this text");
ImGui::OpenPopupOnItemClick("my popup", ImGuiPopupFlags_MouseButtonRight);

helper to open popup when clicked on last item. Default to ImGuiPopupFlags_MouseButtonRight == 1. (note: actually triggers on the mouse released event to be consistent with popup behaviors)

ImGui::CloseCurrentPopup

IMGUI_API void CloseCurrentPopup();

See it live: Popups › Context menus (also used in 3 other sections)

Popups › Context menus
Code from the demo
selected = n;
ImGui::Text("This is a popup for \"%s\"!", names[n]);
if (ImGui::Button("Close"))
    ImGui::CloseCurrentPopup();

manually close the popup we have begin-ed into.

ImGui::BeginPopupContextItem

IMGUI_API bool BeginPopupContextItem(const char* str_id = NULL, ImGuiPopupFlags popup_flags = 0);

See it live: Popups › Context menus (also used in 4 other sections)

Popups › Context menus
Code from the demo
const char* names[5] = { "Label1", "Label2", "Label3", "Label4", "Label5" };
static int selected = -1;
for (int n = 0; n < 5; n++)
{
    if (ImGui::Selectable(names[n], selected == n))
        selected = n;
    if (ImGui::BeginPopupContextItem()) // <-- use last item id as popup id
    {
        selected = n;
        ImGui::Text("This is a popup for \"%s\"!", names[n]);
        if (ImGui::Button("Close"))
            ImGui::CloseCurrentPopup();
        ImGui::EndPopup();
    }
...

open+begin popup when clicked on last item. Use str_id==None to associate the popup to previous item. If you want to use that on a non-interactive item such as Text() you need to pass in an explicit ID here. read comments in .cpp!

Popups: Open+Begin popup combined functions helpers to create context menus.

ImGui::BeginPopupContextWindow

IMGUI_API bool BeginPopupContextWindow(const char* str_id = NULL, ImGuiPopupFlags popup_flags = 0);

See it live: Examples › Simple overlay (also used in 2 other sections)

Code from the demo
if (ImGui::BeginPopupContextWindow())
{
    if (ImGui::MenuItem("Custom",       NULL, location == -1)) location = -1;
    if (ImGui::MenuItem("Center",       NULL, location == -2)) location = -2;
    if (ImGui::MenuItem("Top-left",     NULL, location == 0)) location = 0;
    if (ImGui::MenuItem("Top-right",    NULL, location == 1)) location = 1;
    if (ImGui::MenuItem("Bottom-left",  NULL, location == 2)) location = 2;
    if (ImGui::MenuItem("Bottom-right", NULL, location == 3)) location = 3;
    if (p_open && ImGui::MenuItem("Close")) *p_open = false;
    ImGui::EndPopup();
}

open+begin popup when clicked on current window.

ImGui::BeginPopupContextVoid

IMGUI_API bool BeginPopupContextVoid(const char* str_id = NULL, ImGuiPopupFlags popup_flags = 0);

open+begin popup when clicked in None (where there are no windows).

Popups: query functions

ImGui::IsPopupOpen

IMGUI_API bool IsPopupOpen(const char* str_id, ImGuiPopupFlags flags = 0);

See it live: Examples › Documents

Examples › Documents
Code from the demo
if (!ImGui::IsPopupOpen("Save?"))
    ImGui::OpenPopup("Save?");

return True if the popup is open.

Tables

       - TableNextRow() -> TableSetColumnIndex(0) -> Text("Hello 0") -> TableSetColumnIndex(1) -> Text("Hello 1")  // OK
       - TableNextRow() -> TableNextColumn()      -> Text("Hello 0") -> TableNextColumn()      -> Text("Hello 1")  // OK
       -                   TableNextColumn()      -> Text("Hello 0") -> TableNextColumn()      -> Text("Hello 1")  // OK: TableNextColumn() automatically gets to next row!
       - TableNextRow()                           -> Text("Hello 0")                                               // Not OK! Missing TableSetColumnIndex() or TableNextColumn()! Text will not appear!

ImGui::BeginTable

IMGUI_API bool BeginTable(const char* str_id, int columns, ImGuiTableFlags flags = 0, const ImVec2& outer_size = ImVec2(0.0f, 0.0f), float inner_width = 0.0f);

See it live: Tables › Basic (also used in 31 other sections)

Tables › Basic
Code from the demo
HelpMarker("Using TableNextRow() + calling TableSetColumnIndex() _before_ each cell, in a loop.");
if (ImGui::BeginTable("table1", 3))
{
    for (int row = 0; row < 4; row++)
    {
        ImGui::TableNextRow();
        for (int column = 0; column < 3; column++)
        {
            ImGui::TableSetColumnIndex(column);
            ImGui::Text("Row %d Column %d", row, column);
        }
    }
    ImGui::EndTable();
}

ImGui::EndTable

IMGUI_API void EndTable();

See it live: Widgets › Selectables › In Tables (also used in 31 other sections)

Widgets › Selectables › In Tables
Code from the demo
ImGui::EndTable();

only call EndTable() if BeginTable() returns True!

ImGui::TableNextRow

IMGUI_API void TableNextRow(ImGuiTableRowFlags row_flags = 0, float min_row_height = 0.0f);

See it live: Tables › Basic (also used in 25 other sections)

Tables › Basic
Code from the demo
for (int row = 0; row < 4; row++)
{
    ImGui::TableNextRow();
    for (int column = 0; column < 3; column++)
    {
        ImGui::TableSetColumnIndex(column);
        ImGui::Text("Row %d Column %d", row, column);
    }
}

append into the first cell of a new row. ‘min_row_height’ include the minimum top and bottom padding aka CellPadding.y * 2.0.

ImGui::TableNextColumn

IMGUI_API bool TableNextColumn();

See it live: Tables › Basic (also used in 17 other sections)

Tables › Basic
Code from the demo
for (int row = 0; row < 4; row++)
{
    ImGui::TableNextRow();
    ImGui::TableNextColumn();
    ImGui::Text("Row %d", row);
    ImGui::TableNextColumn();
    ImGui::Text("Some contents");
    ImGui::TableNextColumn();
    ImGui::Text("123.456");
}

append into the next column (or first column of next row if currently in last column). Return True when column is visible.

ImGui::TableSetColumnIndex

IMGUI_API bool TableSetColumnIndex(int column_n);

See it live: Tables › Basic (also used in 16 other sections)

Tables › Basic
Code from the demo
ImGui::TableNextRow();
for (int column = 0; column < 3; column++)
{
    ImGui::TableSetColumnIndex(column);
    ImGui::Text("Row %d Column %d", row, column);
}

append into the specified column. Return True when column is visible.

Tables: Headers & Columns declaration

ImGui::TableSetupColumn

IMGUI_API void TableSetupColumn(const char* label, ImGuiTableColumnFlags flags = 0, float init_width_or_weight = 0.0f, ImGuiID user_data = 0);

See it live: Tables › Borders, background (also used in 20 other sections)

Tables › Borders, background
Code from the demo
if (display_headers)
{
    ImGui::TableSetupColumn("One");
    ImGui::TableSetupColumn("Two");
    ImGui::TableSetupColumn("Three");
    ImGui::TableHeadersRow();
}

ImGui::TableSetupScrollFreeze

IMGUI_API void TableSetupScrollFreeze(int cols, int rows);

See it live: Tables › Horizontal scrolling (also used in 5 other sections)

Tables › Horizontal scrolling
Code from the demo
ImVec2 outer_size = ImVec2(0.0f, TEXT_BASE_HEIGHT * 8);
if (ImGui::BeginTable("table_scrollx", 7, flags, outer_size))
{
    ImGui::TableSetupScrollFreeze(freeze_cols, freeze_rows);
    ImGui::TableSetupColumn("Line #", ImGuiTableColumnFlags_NoHide); // Make the first column not hideable to match our use of TableSetupScrollFreeze()
    ImGui::TableSetupColumn("One");
    ImGui::TableSetupColumn("Two");
    ImGui::TableSetupColumn("Three");
    ImGui::TableSetupColumn("Four");
    ImGui::TableSetupColumn("Five");
    ImGui::TableSetupColumn("Six");
    ImGui::TableHeadersRow();
    for (int row = 0; row < 20; row++)
    {
...

lock columns/rows so they stay visible when scrolled.

ImGui::TableHeader

IMGUI_API void TableHeader(const char* label);

See it live: Tables › Custom headers (also used in 1 other section)

Tables › Custom headers
Code from the demo
ImGui::Checkbox("##checkall", &column_selected[column]);
ImGui::PopStyleVar();
ImGui::SameLine(0.0f, ImGui::GetStyle().ItemInnerSpacing.x);
ImGui::TableHeader(column_name);

submit one header cell manually (rarely used)

ImGui::TableHeadersRow

IMGUI_API void TableHeadersRow();

See it live: Tables › Borders, background (also used in 17 other sections)

Tables › Borders, background
Code from the demo
if (display_headers)
{
    ImGui::TableSetupColumn("One");
    ImGui::TableSetupColumn("Two");
    ImGui::TableSetupColumn("Three");
    ImGui::TableHeadersRow();
}

submit a row with headers cells based on data provided to TableSetupColumn() + submit context menu

ImGui::TableAngledHeadersRow

IMGUI_API void TableAngledHeadersRow();

See it live: Tables › Angled headers (also used in 2 other sections)

Tables › Angled headers
Code from the demo
if (ImGui::BeginTable("table_angled_headers", columns_count, table_flags, ImVec2(0.0f, TEXT_BASE_HEIGHT * 12)))
{
    ImGui::TableSetupColumn(column_names[0], ImGuiTableColumnFlags_NoHide | ImGuiTableColumnFlags_NoReorder);
    for (int n = 1; n < columns_count; n++)
        ImGui::TableSetupColumn(column_names[n], column_flags);
    ImGui::TableSetupScrollFreeze(frozen_cols, frozen_rows);

    ImGui::TableAngledHeadersRow(); // Draw angled headers for all columns with the ImGuiTableColumnFlags_AngledHeader flag.
    ImGui::TableHeadersRow();       // Draw remaining headers and allow access to context-menu and other functions.
    for (int row = 0; row < rows_count; row++)
    {
        ImGui::PushID(row);
        ImGui::TableNextRow();
        ImGui::TableSetColumnIndex(0);
...

submit a row with angled headers for every column with the ImGuiTableColumnFlags_AngledHeader flag. MUST BE FIRST ROW.

Tables: Sorting & Miscellaneous functions

ImGui::TableGetSortSpecs

IMGUI_API ImGuiTableSortSpecs* TableGetSortSpecs();

See it live: Tables › Sorting (also used in 2 other sections)

Tables › Sorting
Code from the demo
if (ImGuiTableSortSpecs* sort_specs = ImGui::TableGetSortSpecs())
    if (sort_specs->SpecsDirty)
    {
        MyItem::SortWithSortSpecs(sort_specs, items.Data, items.Size);
        sort_specs->SpecsDirty = false;
    }

get latest sort specs for the table (None if not sorting). Lifetime: don’t hold on this pointer over multiple frames or past any subsequent call to BeginTable().

ImGui::TableGetColumnCount

IMGUI_API int TableGetColumnCount();

return number of columns (value passed to BeginTable)

ImGui::TableGetColumnIndex

IMGUI_API int TableGetColumnIndex();

See it live: Tables › Explicit widths (also used in 1 other section)

Tables › Explicit widths
Code from the demo
for (int cell = 0; cell < 10 * column_count; cell++)
{
    ImGui::TableNextColumn();
    int column = ImGui::TableGetColumnIndex();
    int row = ImGui::TableGetRowIndex();

    ImGui::PushID(cell);
    char label[32];
    static char text_buf[32] = "";
    sprintf(label, "Hello %d,%d", column, row);
    switch (contents_type)
    {
    case CT_ShortText:  ImGui::TextUnformatted(label); break;
    case CT_LongText:   ImGui::Text("Some %s text %d,%d\nOver two lines..", column == 0 ? "long" : "longeeer", column, row); break;
...

return current column index.

ImGui::TableGetRowIndex

IMGUI_API int TableGetRowIndex();

See it live: Tables › Explicit widths (also used in 1 other section)

Tables › Explicit widths
Code from the demo
for (int cell = 0; cell < 10 * column_count; cell++)
{
    ImGui::TableNextColumn();
    int column = ImGui::TableGetColumnIndex();
    int row = ImGui::TableGetRowIndex();

    ImGui::PushID(cell);
    char label[32];
    static char text_buf[32] = "";
    sprintf(label, "Hello %d,%d", column, row);
    switch (contents_type)
    {
    case CT_ShortText:  ImGui::TextUnformatted(label); break;
    case CT_LongText:   ImGui::Text("Some %s text %d,%d\nOver two lines..", column == 0 ? "long" : "longeeer", column, row); break;
...

return current row index (header rows are accounted for)

ImGui::TableGetColumnName

IMGUI_API const char* TableGetColumnName(int column_n = -1);

See it live: Tables › Columns flags (also used in 1 other section)

Tables › Columns flags
Code from the demo
ImGui::Indent(indent_step);
ImGui::TableNextRow();
for (int column = 0; column < column_count; column++)
{
    ImGui::TableSetColumnIndex(column);
    ImGui::Text("%s %s", (column == 0) ? "Indented" : "Hello", ImGui::TableGetColumnName(column));
}

return “” if column didn’t have a name declared by TableSetupColumn(). Pass -1 to use current column.

ImGui::TableGetColumnFlags

IMGUI_API ImGuiTableColumnFlags TableGetColumnFlags(int column_n = -1);

See it live: Tables › Columns flags (also used in 2 other sections)

Tables › Columns flags
Code from the demo
ImGui::TableHeadersRow();
for (int column = 0; column < column_count; column++)
    column_flags_out[column] = ImGui::TableGetColumnFlags(column);

return column flags so you can query their Enabled/Visible/Sorted/Hovered status flags. Pass -1 to use current column.

ImGui::TableSetColumnEnabled

IMGUI_API void TableSetColumnEnabled(int column_n, bool v);

change user accessible enabled/disabled state of a column. Set to False to hide the column. User can use the context menu to change this themselves (right-click in headers, or right-click in columns body with ImGuiTableFlags_ContextMenuInBody)

ImGui::TableGetHoveredColumn

IMGUI_API int TableGetHoveredColumn();

return hovered column. return -1 when table is not hovered. return columns_count if the unused space at the right of visible columns is hovered. Can also use (TableGetColumnFlags() & ImGuiTableColumnFlags_IsHovered) instead.

ImGui::TableSetBgColor

IMGUI_API void TableSetBgColor(ImGuiTableBgTarget target, ImU32 color, int column_n = -1);

See it live: Tables › Background color

Tables › Background color
Code from the demo
if (row_bg_type != 0)
{
    ImU32 row_bg_color = ImGui::GetColorU32(row_bg_type == 1 ? ImVec4(0.7f, 0.3f, 0.3f, 0.65f) : ImVec4(0.2f + row * 0.1f, 0.2f, 0.2f, 0.65f)); // Flat or Gradient?
    ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0 + row_bg_target, row_bg_color);
}

change the color of a cell, row, or column. See ImGuiTableBgTarget_ flags for details.

Legacy Columns API (prefer using Tables!)

ImGui::Columns

IMGUI_API void Columns(int count = 1, const char* id = NULL, bool borders = true);

See it live: Columns (legacy API) › Basic (also used in 6 other sections)

Code from the demo
ImGui::Text("Without border:");
ImGui::Columns(3, "mycolumns3", false);  // 3-ways, no border
ImGui::Separator();

ImGui::NextColumn

IMGUI_API void NextColumn();

See it live: Columns (legacy API) › Basic (also used in 7 other sections)

Code from the demo
ImGui::Text("Without border:");
ImGui::Columns(3, "mycolumns3", false);  // 3-ways, no border
ImGui::Separator();
for (int n = 0; n < 14; n++)
{
    char label[32];
    sprintf(label, "Item %d", n);
    if (ImGui::Selectable(label)) {}
    //if (ImGui::Button(label, ImVec2(-FLT_MIN,0.0f))) {}
    ImGui::NextColumn();
}

next column, defaults to current row or next row if the current row is finished

ImGui::GetColumnIndex

IMGUI_API int GetColumnIndex();

See it live: Columns (legacy API) › Borders

Code from the demo
ImGui::SameLine();
ImGui::Checkbox("vertical", &v_borders);
ImGui::Columns(columns_count, NULL, v_borders);
for (int i = 0; i < columns_count * lines_count; i++)
{
    if (h_borders && ImGui::GetColumnIndex() == 0)
        ImGui::Separator();
    ImGui::PushID(i);
    ImGui::Text("%c%c%c", 'a' + i, 'a' + i, 'a' + i);
    ImGui::Text("Width %.2f", ImGui::GetColumnWidth());
    ImGui::Text("Avail %.2f", ImGui::GetContentRegionAvail().x);
    ImGui::Text("Offset %.2f", ImGui::GetColumnOffset());
    ImGui::Text("Long text that is likely to clip");
    ImGui::Button("Button", ImVec2(-FLT_MIN, 0.0f));
...

get current column index

ImGui::GetColumnWidth

IMGUI_API float GetColumnWidth(int column_index = -1);

See it live: Columns (legacy API) › Borders (also used in 1 other section)

Code from the demo
ImGui::SameLine();
ImGui::Checkbox("vertical", &v_borders);
ImGui::Columns(columns_count, NULL, v_borders);
for (int i = 0; i < columns_count * lines_count; i++)
{
    if (h_borders && ImGui::GetColumnIndex() == 0)
        ImGui::Separator();
    ImGui::PushID(i);
    ImGui::Text("%c%c%c", 'a' + i, 'a' + i, 'a' + i);
    ImGui::Text("Width %.2f", ImGui::GetColumnWidth());
    ImGui::Text("Avail %.2f", ImGui::GetContentRegionAvail().x);
    ImGui::Text("Offset %.2f", ImGui::GetColumnOffset());
    ImGui::Text("Long text that is likely to clip");
    ImGui::Button("Button", ImVec2(-FLT_MIN, 0.0f));
...

get column width (in pixels). pass -1 to use current column

ImGui::SetColumnWidth

IMGUI_API void SetColumnWidth(int column_index, float width);

set column width (in pixels). pass -1 to use current column

ImGui::GetColumnOffset

IMGUI_API float GetColumnOffset(int column_index = -1);

See it live: Columns (legacy API) › Borders

Code from the demo
ImGui::Text("%c%c%c", 'a' + i, 'a' + i, 'a' + i);
ImGui::Text("Width %.2f", ImGui::GetColumnWidth());
ImGui::Text("Avail %.2f", ImGui::GetContentRegionAvail().x);
ImGui::Text("Offset %.2f", ImGui::GetColumnOffset());

get position of column line (in pixels, from the left side of the contents region). pass -1 to use current column, otherwise 0..GetColumnsCount() inclusive. column 0 is typically 0.0

ImGui::SetColumnOffset

IMGUI_API void SetColumnOffset(int column_index, float offset_x);

set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column

ImGui::GetColumnsCount

IMGUI_API int GetColumnsCount();

Tab Bars, Tabs

ImGui::BeginTabBar

IMGUI_API bool BeginTabBar(const char* str_id, ImGuiTabBarFlags flags = 0);

See it live: Widgets › Tabs › Basic (also used in 7 other sections)

Widgets › Tabs › Basic
Code from the demo
ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_None;
if (ImGui::BeginTabBar("MyTabBar", tab_bar_flags))
{
    if (ImGui::BeginTabItem("Avocado"))
    {
        ImGui::Text("This is the Avocado tab!\nblah blah blah blah blah");
        ImGui::EndTabItem();
    }
    if (ImGui::BeginTabItem("Broccoli"))
    {
        ImGui::Text("This is the Broccoli tab!\nblah blah blah blah blah");
        ImGui::EndTabItem();
    }
    if (ImGui::BeginTabItem("Cucumber"))
...

create and append into a TabBar

ImGui::EndTabBar

IMGUI_API void EndTabBar();

See it live: Widgets › Tabs › Basic (also used in 7 other sections)

Widgets › Tabs › Basic
Code from the demo
ImGui::EndTabBar();

only call EndTabBar() if BeginTabBar() returns True!

ImGui::BeginTabItem

IMGUI_API bool BeginTabItem(const char* label, bool* p_open = NULL, ImGuiTabItemFlags flags = 0);

See it live: Widgets › Tabs › TabItemButton & Leading-Trailing flags (also used in 10 other sections)

Widgets › Tabs › TabItemButton & Leading-Trailing flags
Code from the demo
if (show_leading_trailing_tabs)
{
    if (ImGui::BeginTabItem("Leading", NULL, ImGuiTabItemFlags_Leading))
        ImGui::EndTabItem();
    if (ImGui::BeginTabItem("Trailing", NULL, ImGuiTabItemFlags_Trailing))
        ImGui::EndTabItem();
}

create a Tab. Returns True if the Tab is selected.
Python: returns (selected, p_open): p_open becomes False when the close button is clicked. Without a close button, begin_tab_item_simple() returns selected alone.

ImGui::EndTabItem

IMGUI_API void EndTabItem();

See it live: Widgets › Tabs › TabItemButton & Leading-Trailing flags (also used in 10 other sections)

Widgets › Tabs › TabItemButton & Leading-Trailing flags
Code from the demo
if (ImGui::BeginTabItem("Leading", NULL, ImGuiTabItemFlags_Leading))
    ImGui::EndTabItem();

only call EndTabItem() if BeginTabItem() returns True!

ImGui::TabItemButton

IMGUI_API bool TabItemButton(const char* label, ImGuiTabItemFlags flags = 0);

See it live: Widgets › Tabs › TabItemButton & Leading-Trailing flags

Widgets › Tabs › TabItemButton & Leading-Trailing flags
Code from the demo
if (show_leading_button)
    if (ImGui::TabItemButton("?", ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_NoTooltip))
        ImGui::OpenPopup("MyHelpMenu");

create a Tab behaving like a button. return True when clicked. cannot be selected in the tab bar.

ImGui::SetTabItemClosed

IMGUI_API void SetTabItemClosed(const char* tab_or_docked_window_label);

notify TabBar or Docking system of a closed tab/window ahead (useful to reduce visual flicker on reorderable tab bars). For tab-bar: call after BeginTabBar() and before Tab submissions. Otherwise call with a window name.

Docking

    e.g. ImGui::NewFrame(); ImGui::DockSpaceOverViewport();                                                   // Create a dockspace in main viewport.
     or: ImGui::NewFrame(); ImGui::DockSpaceOverViewport(0, None, ImGuiDockNodeFlags_PassthruCentralNode); // Create a dockspace in main viewport, central node is transparent.

ImGui::DockSpace

IMGUI_API ImGuiID DockSpace(ImGuiID dockspace_id, const ImVec2& size = ImVec2(0, 0), ImGuiDockNodeFlags flags = 0, const ImGuiWindowClass* window_class = NULL);

See it live: Using Dockspace (Read note below) (also used in 2 other sections)

Code from the demo
ImGuiID dockspace_id = ImGui::GetID("MyDockSpace");
ImGui::DockSpace(dockspace_id, ImVec2(0.0f, 0.0f), dockspace_flags);

ImGui::DockSpaceOverViewport

IMGUI_API ImGuiID DockSpaceOverViewport(ImGuiID dockspace_id = 0, const ImGuiViewport* viewport = NULL, ImGuiDockNodeFlags flags = 0, const ImGuiWindowClass* window_class = NULL);

ImGui::SetNextWindowDockID

IMGUI_API void SetNextWindowDockID(ImGuiID dock_id, ImGuiCond cond = 0);

See it live: Examples › Documents

Examples › Documents
Code from the demo
for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++)
{
    MyDocument* doc = &app.Documents[doc_n];
    if (!doc->Open)
        continue;

    ImGui::SetNextWindowDockID(dockspace_id, redock_all ? ImGuiCond_Always : ImGuiCond_FirstUseEver);
    ImGuiWindowFlags window_flags = (doc->Dirty ? ImGuiWindowFlags_UnsavedDocument : 0);
    bool visible = ImGui::Begin(doc->Name, &doc->Open, window_flags);

    // Cancel attempt to close when unsaved add to save queue so we can display a popup.
    if (!doc->Open && doc->Dirty)
    {
        doc->Open = true;
...

set next window dock id

ImGui::SetNextWindowClass

IMGUI_API void SetNextWindowClass(const ImGuiWindowClass* window_class);

set next window class (control docking compatibility + provide hints to platform backend via custom viewport flags and platform parent/child relationship)

ImGui::GetWindowDockID

IMGUI_API ImGuiID GetWindowDockID();

get dock id of current window, or 0 if not associated to any docking node.

ImGui::IsWindowDocked

IMGUI_API bool IsWindowDocked();

See it live: Examples › Constrained Resizing window

Examples › Constrained Resizing window
Code from the demo
ImGui::Text("(Hold Shift to display a dummy viewport)");
if (ImGui::IsWindowDocked())
    ImGui::Text("Warning: Sizing Constraints won't work if the window is docked!");

is current window docked into another window?

Logging/Capture

ImGui::LogToTTY

IMGUI_API void LogToTTY(int auto_open_depth = -1);

See it live: Tools › Style Editor

Tools › Style Editor
Code from the demo
LogToTTY();

start logging to tty (stdout)

ImGui::LogToFile

IMGUI_API void LogToFile(int auto_open_depth = -1, const char* filename = NULL);

start logging to file

ImGui::LogToClipboard

IMGUI_API void LogToClipboard(int auto_open_depth = -1);

See it live: Configuration › Capture, Logging (also used in 3 other sections)

Configuration › Capture, Logging
Code from the demo
HelpMarker("You can also call ImGui::LogText() to output directly to the log without a visual output.");
if (ImGui::Button("Copy \"Hello, world!\" to clipboard"))
{
    ImGui::LogToClipboard();
    ImGui::LogText("Hello, world!");
    ImGui::LogFinish();
}

start logging to OS clipboard

ImGui::LogFinish

IMGUI_API void LogFinish();

See it live: Configuration › Capture, Logging (also used in 3 other sections)

Configuration › Capture, Logging
Code from the demo
HelpMarker("You can also call ImGui::LogText() to output directly to the log without a visual output.");
if (ImGui::Button("Copy \"Hello, world!\" to clipboard"))
{
    ImGui::LogToClipboard();
    ImGui::LogText("Hello, world!");
    ImGui::LogFinish();
}

stop logging (close file, etc.)

ImGui::LogButtons

IMGUI_API void LogButtons();

See it live: Configuration › Capture, Logging

Configuration › Capture, Logging
Code from the demo
ImGui::LogButtons();

helper to display buttons for logging to tty/file/clipboard

ImGui::LogText

IMGUI_API void LogText(const char* fmt, ...) ;

See it live: Configuration › Capture, Logging (also used in 2 other sections)

Configuration › Capture, Logging
Code from the demo
HelpMarker("You can also call ImGui::LogText() to output directly to the log without a visual output.");
if (ImGui::Button("Copy \"Hello, world!\" to clipboard"))
{
    ImGui::LogToClipboard();
    ImGui::LogText("Hello, world!");
    ImGui::LogFinish();
}

pass text data straight to log (without being displayed)

Drag and Drop

ImGui::BeginDragDropSource

IMGUI_API bool BeginDragDropSource(ImGuiDragDropFlags flags = 0);

See it live: Widgets › Drag and drop › Copy-swap items (also used in 3 other sections)

Widgets › Drag and drop › Copy-swap items
Code from the demo
if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_None))
{
    // Set payload to carry the index of our item (could be anything)
    ImGui::SetDragDropPayload("DND_DEMO_CELL", &n, sizeof(int));

    // Display preview (could be anything, e.g. when dragging an image we could decide to display
    // the filename and a small preview of the image, etc.)
    if (mode == Mode_Copy) { ImGui::Text("Copy %s", names[n]); }
    if (mode == Mode_Move) { ImGui::Text("Move %s", names[n]); }
    if (mode == Mode_Swap) { ImGui::Text("Swap %s", names[n]); }
    ImGui::EndDragDropSource();
}

call after submitting an item which may be dragged. when this return True, you can call SetDragDropPayload() + EndDragDropSource()

ImGui::EndDragDropSource

IMGUI_API void EndDragDropSource();

See it live: Widgets › Drag and drop › Copy-swap items (also used in 3 other sections)

Widgets › Drag and drop › Copy-swap items
Code from the demo
ImGui::EndDragDropSource();

only call EndDragDropSource() if BeginDragDropSource() returns True!

ImGui::BeginDragDropTarget

IMGUI_API bool BeginDragDropTarget();

See it live: Widgets › Drag and Drop › Tooltip at target location (also used in 2 other sections)

Widgets › Drag and Drop › Tooltip at target location
Code from the demo
for (int n = 0; n < 2; n++)
{
    // Drop targets
    ImGui::Button(n ? "drop here##1" : "drop here##0");
    if (ImGui::BeginDragDropTarget())
    {
        ImGuiDragDropFlags drop_target_flags = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoPreviewTooltip;
        if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_4F, drop_target_flags))
        {
            IM_UNUSED(payload);
            ImGui::SetMouseCursor(ImGuiMouseCursor_NotAllowed);
            ImGui::SetTooltip("Cannot drop here!");
        }
        ImGui::EndDragDropTarget();
...

call after submitting an item that may receive a payload. If this returns True, you can call AcceptDragDropPayload() + EndDragDropTarget()

ImGui::EndDragDropTarget

IMGUI_API void EndDragDropTarget();

See it live: Widgets › Drag and Drop › Tooltip at target location (also used in 2 other sections)

Widgets › Drag and Drop › Tooltip at target location
Code from the demo
ImGui::EndDragDropTarget();

only call EndDragDropTarget() if BeginDragDropTarget() returns True!

Disabling

ImGui::BeginDisabled

IMGUI_API void BeginDisabled(bool disabled = true);

See it live: Widgets › Disable Blocks (also used in 10 other sections)

Widgets › Disable Blocks

ImGui::EndDisabled

IMGUI_API void EndDisabled();

See it live: Widgets › Disable Blocks (also used in 10 other sections)

Widgets › Disable Blocks

Clipping

ImGui::PushClipRect

IMGUI_API void PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect);

See it live: Layout › Text Clipping (also used in 1 other section)

Layout › Text Clipping
Code from the demo
ImDrawList* draw_list = ImGui::GetWindowDrawList();
switch (n)
{
case 0:
    ImGui::PushClipRect(p0, p1, true);

ImGui::PopClipRect

IMGUI_API void PopClipRect();

See it live: Layout › Text Clipping (also used in 1 other section)

Layout › Text Clipping
Code from the demo
ImDrawList* draw_list = ImGui::GetWindowDrawList();
switch (n)
{
case 0:
    ImGui::PushClipRect(p0, p1, true);

Focus, Activation

ImGui::SetItemDefaultFocus

IMGUI_API void SetItemDefaultFocus();

See it live: Widgets › Combo (also used in 3 other sections)

Widgets › Combo
Code from the demo
if (is_selected)
    ImGui::SetItemDefaultFocus();

make last item the default focused item of a newly appearing window.

ImGui::SetKeyboardFocusHere

IMGUI_API void SetKeyboardFocusHere(int offset = 0);

See it live: Inputs & Focus › Focus from code (also used in 6 other sections)

Inputs & Focus › Focus from code
Code from the demo
if (focus_1) ImGui::SetKeyboardFocusHere();

focus keyboard on the next widget. Use positive ‘offset’ to access sub components of a multiple component widget. Use -1 to access previous widget.

Keyboard/Gamepad Navigation

ImGui::SetNavCursorVisible

IMGUI_API void SetNavCursorVisible(bool visible);

alter visibility of keyboard/gamepad cursor. by default: show when using an arrow key, hide when clicking with mouse.

Overlapping mode

ImGui::SetNextItemAllowOverlap

IMGUI_API void SetNextItemAllowOverlap();

See it live: Widgets › Selectables › Multiple items on the same line (also used in 1 other section)

Widgets › Selectables › Multiple items on the same line
Code from the demo
static bool selected[3] = {};
ImGui::SetNextItemAllowOverlap(); ImGui::Selectable("main.c", &selected[0]); ImGui::SameLine(); ImGui::SmallButton("Link 1");

allow next item to be overlapped by a subsequent item. Typically useful with InvisibleButton(), Selectable(), TreeNode() covering an area where subsequent items may need to be added. Note that both Selectable() and TreeNode() have dedicated flags doing this.

Item/Widgets Utilities and Query Functions

ImGui::IsItemHovered

IMGUI_API bool IsItemHovered(ImGuiHoveredFlags flags = 0);

See it live: Widgets › Querying Item Status (Edited,Active,Hovered etc.) (also used in 13 other sections)

Widgets › Querying Item Status (Edited,Active,Hovered etc.)
Code from the demo
bool hovered_delay_none = ImGui::IsItemHovered();

is the last item hovered? (and usable, aka not blocked by a popup, etc.). See ImGuiHoveredFlags for more options.

ImGui::IsItemActive

IMGUI_API bool IsItemActive();

See it live: Widgets › Querying Item Status (Edited,Active,Hovered etc.) (also used in 10 other sections)

Widgets › Querying Item Status (Edited,Active,Hovered etc.)
Code from the demo
ImGui::BulletText(
    "Return value = %d\n"
    "IsItemFocused() = %d\n"
    "IsItemHovered() = %d\n"
    "IsItemHovered(_AllowWhenBlockedByPopup) = %d\n"
    "IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByWindow) = %d\n"
    "IsItemHovered(_AllowWhenDisabled) = %d\n"
    "IsItemHovered(_RectOnly) = %d\n"
    "IsItemActive() = %d\n"
    "IsItemEdited() = %d\n"
    "IsItemActivated() = %d\n"
    "IsItemDeactivated() = %d\n"
...

is the last item active? (e.g. button being held, text field being edited. This will continuously return True while holding mouse button on an item. Items that don’t interact will always return False)

ImGui::IsItemFocused

IMGUI_API bool IsItemFocused();

See it live: Widgets › Querying Item Status (Edited,Active,Hovered etc.) (also used in 1 other section)

Widgets › Querying Item Status (Edited,Active,Hovered etc.)
Code from the demo
ImGui::BulletText(
    "Return value = %d\n"
    "IsItemFocused() = %d\n"
    "IsItemHovered() = %d\n"
    "IsItemHovered(_AllowWhenBlockedByPopup) = %d\n"
    "IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByWindow) = %d\n"
    "IsItemHovered(_AllowWhenDisabled) = %d\n"
    "IsItemHovered(_RectOnly) = %d\n"
    "IsItemActive() = %d\n"
    "IsItemEdited() = %d\n"
    "IsItemActivated() = %d\n"
    "IsItemDeactivated() = %d\n"
...

is the last item focused for keyboard/gamepad navigation?

ImGui::IsItemClicked

IMGUI_API bool IsItemClicked(ImGuiMouseButton mouse_button = 0);

See it live: Widgets › Querying Item Status (Edited,Active,Hovered etc.) (also used in 1 other section)

Widgets › Querying Item Status (Edited,Active,Hovered etc.)
Code from the demo
ImGui::BulletText(
    "Return value = %d\n"
    "IsItemFocused() = %d\n"
    "IsItemHovered() = %d\n"
    "IsItemHovered(_AllowWhenBlockedByPopup) = %d\n"
    "IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByWindow) = %d\n"
    "IsItemHovered(_AllowWhenDisabled) = %d\n"
    "IsItemHovered(_RectOnly) = %d\n"
    "IsItemActive() = %d\n"
    "IsItemEdited() = %d\n"
    "IsItemActivated() = %d\n"
    "IsItemDeactivated() = %d\n"
...

is the last item hovered and mouse clicked on? () == IsMouseClicked(mouse_button) && IsItemHovered()Important. () this is NOT equivalent to the behavior of e.g. Button(). Read comments in function definition.

ImGui::IsItemVisible

IMGUI_API bool IsItemVisible();

See it live: Widgets › Querying Item Status (Edited,Active,Hovered etc.) (also used in 1 other section)

Widgets › Querying Item Status (Edited,Active,Hovered etc.)
Code from the demo
ImGui::BulletText(
    "Return value = %d\n"
    "IsItemFocused() = %d\n"
    "IsItemHovered() = %d\n"
    "IsItemHovered(_AllowWhenBlockedByPopup) = %d\n"
    "IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByWindow) = %d\n"
    "IsItemHovered(_AllowWhenDisabled) = %d\n"
    "IsItemHovered(_RectOnly) = %d\n"
    "IsItemActive() = %d\n"
    "IsItemEdited() = %d\n"
    "IsItemActivated() = %d\n"
    "IsItemDeactivated() = %d\n"
...

is the last item visible? (items may be out of sight because of clipping/scrolling)

ImGui::IsItemEdited

IMGUI_API bool IsItemEdited();

See it live: Widgets › Querying Item Status (Edited,Active,Hovered etc.)

Widgets › Querying Item Status (Edited,Active,Hovered etc.)
Code from the demo
ImGui::BulletText(
    "Return value = %d\n"
    "IsItemFocused() = %d\n"
    "IsItemHovered() = %d\n"
    "IsItemHovered(_AllowWhenBlockedByPopup) = %d\n"
    "IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByWindow) = %d\n"
    "IsItemHovered(_AllowWhenDisabled) = %d\n"
    "IsItemHovered(_RectOnly) = %d\n"
    "IsItemActive() = %d\n"
    "IsItemEdited() = %d\n"
    "IsItemActivated() = %d\n"
    "IsItemDeactivated() = %d\n"
...

did the last item modify its underlying value this frame? or was pressed? This is generally the same as the “bool” return value of many widgets.

ImGui::IsItemActivated

IMGUI_API bool IsItemActivated();

See it live: Widgets › Querying Item Status (Edited,Active,Hovered etc.)

Widgets › Querying Item Status (Edited,Active,Hovered etc.)
Code from the demo
ImGui::BulletText(
    "Return value = %d\n"
    "IsItemFocused() = %d\n"
    "IsItemHovered() = %d\n"
    "IsItemHovered(_AllowWhenBlockedByPopup) = %d\n"
    "IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByWindow) = %d\n"
    "IsItemHovered(_AllowWhenDisabled) = %d\n"
    "IsItemHovered(_RectOnly) = %d\n"
    "IsItemActive() = %d\n"
    "IsItemEdited() = %d\n"
    "IsItemActivated() = %d\n"
    "IsItemDeactivated() = %d\n"
...

was the last item just made active (item was previously inactive).

ImGui::IsItemDeactivated

IMGUI_API bool IsItemDeactivated();

See it live: Widgets › Querying Item Status (Edited,Active,Hovered etc.) (also used in 1 other section)

Widgets › Querying Item Status (Edited,Active,Hovered etc.)
Code from the demo
ImGui::BulletText(
    "Return value = %d\n"
    "IsItemFocused() = %d\n"
    "IsItemHovered() = %d\n"
    "IsItemHovered(_AllowWhenBlockedByPopup) = %d\n"
    "IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByWindow) = %d\n"
    "IsItemHovered(_AllowWhenDisabled) = %d\n"
    "IsItemHovered(_RectOnly) = %d\n"
    "IsItemActive() = %d\n"
    "IsItemEdited() = %d\n"
    "IsItemActivated() = %d\n"
    "IsItemDeactivated() = %d\n"
...

was the last item just made inactive (item was previously active). Useful for Undo/Redo patterns with widgets that require continuous editing.

ImGui::IsItemDeactivatedAfterEdit

IMGUI_API bool IsItemDeactivatedAfterEdit();

See it live: Widgets › Querying Item Status (Edited,Active,Hovered etc.)

Widgets › Querying Item Status (Edited,Active,Hovered etc.)
Code from the demo
ImGui::BulletText(
    "Return value = %d\n"
    "IsItemFocused() = %d\n"
    "IsItemHovered() = %d\n"
    "IsItemHovered(_AllowWhenBlockedByPopup) = %d\n"
    "IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByWindow) = %d\n"
    "IsItemHovered(_AllowWhenDisabled) = %d\n"
    "IsItemHovered(_RectOnly) = %d\n"
    "IsItemActive() = %d\n"
    "IsItemEdited() = %d\n"
    "IsItemActivated() = %d\n"
    "IsItemDeactivated() = %d\n"
...

was the last item just made inactive and made a value change when it was active? (e.g. Slider/Drag moved). Useful for Undo/Redo patterns with widgets that require continuous editing. Note that you may get False positives (some widgets such as Combo()/ListBox()/Selectable() will return True even when clicking an already selected item).

ImGui::IsItemToggledOpen

IMGUI_API bool IsItemToggledOpen();

See it live: Widgets › Querying Item Status (Edited,Active,Hovered etc.) (also used in 2 other sections)

Widgets › Querying Item Status (Edited,Active,Hovered etc.)
Code from the demo
ImGui::BulletText(
    "Return value = %d\n"
    "IsItemFocused() = %d\n"
    "IsItemHovered() = %d\n"
    "IsItemHovered(_AllowWhenBlockedByPopup) = %d\n"
    "IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByWindow) = %d\n"
    "IsItemHovered(_AllowWhenDisabled) = %d\n"
    "IsItemHovered(_RectOnly) = %d\n"
    "IsItemActive() = %d\n"
    "IsItemEdited() = %d\n"
    "IsItemActivated() = %d\n"
    "IsItemDeactivated() = %d\n"
...

was the last item open state toggled? set by TreeNode().

ImGui::IsAnyItemHovered

IMGUI_API bool IsAnyItemHovered();

See it live: Tables › Context menus

Tables › Context menus
Code from the demo
int hovered_column = -1;
for (int column = 0; column < COLUMNS_COUNT + 1; column++)
{
    ImGui::PushID(column);
    if (ImGui::TableGetColumnFlags(column) & ImGuiTableColumnFlags_IsHovered)
        hovered_column = column;
    if (hovered_column == column && !ImGui::IsAnyItemHovered() && ImGui::IsMouseReleased(1))
        ImGui::OpenPopup("MyPopup");
    if (ImGui::BeginPopup("MyPopup"))
    {
        if (column == COLUMNS_COUNT)
            ImGui::Text("This is a custom popup for unused space after the last column.");
        else
            ImGui::Text("This is a custom popup for Column %d", column);
...

is any item hovered?

ImGui::IsAnyItemActive

IMGUI_API bool IsAnyItemActive();

See it live: Examples › Assets Browser

Examples › Assets Browser
Code from the demo
if (ImGui::IsWindowHovered() && io.MouseWheel != 0.0f && ImGui::IsKeyDown(ImGuiMod_Ctrl) && ImGui::IsAnyItemActive() == false)
{
    ZoomWheelAccum += io.MouseWheel;
    if (fabsf(ZoomWheelAccum) >= 1.0f)
    {
        // Calculate hovered item index from mouse location
        // FIXME: Locking aiming on 'hovered_item_idx' (with a cool-down timer) would ensure zoom keeps on it.
        const float hovered_item_nx = (io.MousePos.x - start_pos.x + LayoutItemSpacing * 0.5f) / LayoutItemStep.x;
        const float hovered_item_ny = (io.MousePos.y - start_pos.y + LayoutItemSpacing * 0.5f) / LayoutItemStep.y;
        const int hovered_item_idx = ((int)hovered_item_ny * LayoutColumnCount) + (int)hovered_item_nx;
        //ImGui::SetTooltip("%f,%f -> item %d", hovered_item_nx, hovered_item_ny, hovered_item_idx); // Move those 4 lines in block above for easy debugging

        // Zoom
        IconSize *= powf(1.1f, (float)(int)ZoomWheelAccum);
...

is any item active?

ImGui::IsAnyItemFocused

IMGUI_API bool IsAnyItemFocused();

is any item focused?

ImGui::GetItemID

IMGUI_API ImGuiID GetItemID();

get ID of last item (~~ often same ImGui::GetID(label) beforehand)

ImGui::GetItemRectMin

IMGUI_API ImVec2 GetItemRectMin();

See it live: Widgets › Querying Item Status (Edited,Active,Hovered etc.) (also used in 5 other sections)

Widgets › Querying Item Status (Edited,Active,Hovered etc.)
Code from the demo
ImGui::BulletText(
    "Return value = %d\n"
    "IsItemFocused() = %d\n"
    "IsItemHovered() = %d\n"
    "IsItemHovered(_AllowWhenBlockedByPopup) = %d\n"
    "IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByWindow) = %d\n"
    "IsItemHovered(_AllowWhenDisabled) = %d\n"
    "IsItemHovered(_RectOnly) = %d\n"
    "IsItemActive() = %d\n"
    "IsItemEdited() = %d\n"
    "IsItemActivated() = %d\n"
    "IsItemDeactivated() = %d\n"
...

get upper-left bounding rectangle of the last item (screen space)

ImGui::GetItemRectMax

IMGUI_API ImVec2 GetItemRectMax();

See it live: Widgets › Querying Item Status (Edited,Active,Hovered etc.) (also used in 6 other sections)

Widgets › Querying Item Status (Edited,Active,Hovered etc.)
Code from the demo
ImGui::BulletText(
    "Return value = %d\n"
    "IsItemFocused() = %d\n"
    "IsItemHovered() = %d\n"
    "IsItemHovered(_AllowWhenBlockedByPopup) = %d\n"
    "IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByWindow) = %d\n"
    "IsItemHovered(_AllowWhenDisabled) = %d\n"
    "IsItemHovered(_RectOnly) = %d\n"
    "IsItemActive() = %d\n"
    "IsItemEdited() = %d\n"
    "IsItemActivated() = %d\n"
    "IsItemDeactivated() = %d\n"
...

get lower-right bounding rectangle of the last item (screen space)

ImGui::GetItemRectSize

IMGUI_API ImVec2 GetItemRectSize();

See it live: Widgets › Querying Item Status (Edited,Active,Hovered etc.) (also used in 1 other section)

Widgets › Querying Item Status (Edited,Active,Hovered etc.)
Code from the demo
ImGui::BulletText(
    "Return value = %d\n"
    "IsItemFocused() = %d\n"
    "IsItemHovered() = %d\n"
    "IsItemHovered(_AllowWhenBlockedByPopup) = %d\n"
    "IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByItem) = %d\n"
    "IsItemHovered(_AllowWhenOverlappedByWindow) = %d\n"
    "IsItemHovered(_AllowWhenDisabled) = %d\n"
    "IsItemHovered(_RectOnly) = %d\n"
    "IsItemActive() = %d\n"
    "IsItemEdited() = %d\n"
    "IsItemActivated() = %d\n"
    "IsItemDeactivated() = %d\n"
...

get size of last item

ImGui::GetItemFlags

IMGUI_API ImGuiItemFlags GetItemFlags();

See it live: Widgets › Live Edit Flags (also used in 1 other section)

Widgets › Live Edit Flags
Code from the demo
ImGui::Checkbox("Override Live Edit Flags in Demo Window", &demo_data->LiveEditOverride);
if (!demo_data->LiveEditOverride)
    demo_data->LiveEditFlags = ImGui::GetItemFlags();

get generic flags of last item

ImGui::GetItemClickedCountWithSingleClickDelay

IMGUI_API int GetItemClickedCountWithSingleClickDelay(ImGuiMouseButton mouse_button = 0, float delay = -1.0f);

[BETA] building block for disambiguation between single-click and double-click. Returns 1 on single-click but delayed by io.MouseSingleClickDelay after mouse release. Returns 2+ on double-click or repeated clicks.

Viewports

ImGui::GetMainViewport

IMGUI_API ImGuiViewport* GetMainViewport();

See it live: Popups › Modals

Popups › Modals
Code from the demo
ImVec2 center = ImGui::GetMainViewport()->GetCenter();

return primary/default viewport. This can never be None.

Background/Foreground Draw Lists

ImGui::GetBackgroundDrawList

IMGUI_API ImDrawList* GetBackgroundDrawList(ImGuiViewport* viewport = NULL);

See it live: Examples › Custom rendering › BG & FG draw lists

Code from the demo
ImVec2 window_pos = ImGui::GetWindowPos();
ImVec2 window_size = ImGui::GetWindowSize();
ImVec2 window_center = ImVec2(window_pos.x + window_size.x * 0.5f, window_pos.y + window_size.y * 0.5f);
if (draw_bg)
    ImGui::GetBackgroundDrawList()->AddCircle(window_center, window_size.x * 0.6f, IM_COL32(255, 0, 0, 200), 0, 10 + 4);

get background draw list for the given viewport or viewport associated to the current window. this draw list will be the first rendering one. Useful to quickly draw shapes/text behind dear imgui contents.

ImGui::GetForegroundDrawList

IMGUI_API ImDrawList* GetForegroundDrawList(ImGuiViewport* viewport = NULL);

See it live: Examples › Custom rendering › BG & FG draw lists (also used in 1 other section)

Code from the demo
if (draw_fg)
    ImGui::GetForegroundDrawList()->AddCircle(window_center, window_size.y * 0.6f, IM_COL32(0, 255, 0, 200), 0, 10);

get foreground draw list for the given viewport or viewport associated to the current window. this draw list will be the top-most rendered one. Useful to quickly draw shapes/text over dear imgui contents.

Miscellaneous Utilities

ImGui::IsRectVisible

IMGUI_API bool IsRectVisible(const ImVec2& size);
IMGUI_API bool IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max);

See it live: Examples › Assets Browser

Examples › Assets Browser
Code from the demo
ImGui::SetNextItemSelectionUserData(item_idx);
bool item_is_selected = Selection.Contains((ImGuiID)item_data->ID);
bool item_is_visible = ImGui::IsRectVisible(LayoutItemSize);

test if rectangle (of given size, starting from cursor position) is visible / not clipped.

ImGui::GetTime

IMGUI_API double GetTime();

See it live: Widgets › Plotting (also used in 7 other sections)

Widgets › Plotting
Code from the demo
static float values[90] = {};
static int values_offset = 0;
static double refresh_time = 0.0;
if (!animate || refresh_time == 0.0)
    refresh_time = ImGui::GetTime();

get global imgui time. incremented by io.DeltaTime every frame.

ImGui::GetFrameCount

IMGUI_API int GetFrameCount();

See it live: Examples › Log (also used in 1 other section)

Examples › Log
Code from the demo
static int counter = 0;
const char* categories[3] = { "info", "warn", "error" };
const char* words[] = { "Bumfuzzled", "Cattywampus", "Snickersnee", "Abibliophobia", "Absquatulate", "Nincompoop", "Pauciloquent" };
for (int n = 0; n < 5; n++)
{
    const char* category = categories[counter % IM_COUNTOF(categories)];
    const char* word = words[counter % IM_COUNTOF(words)];
    log.AddLog("[%05d] [%s] Hello, current time is %.1f, here's a word: '%s'\n",
        ImGui::GetFrameCount(), category, ImGui::GetTime(), word);
    counter++;
}

get global imgui frame count. incremented by 1 every frame.

ImGui::GetDrawListSharedData

IMGUI_API ImDrawListSharedData* GetDrawListSharedData();

you may use this when creating your own ImDrawList instances.

ImGui::GetStyleColorName

IMGUI_API const char* GetStyleColorName(ImGuiCol idx);

See it live: Examples › Menu › Colors (also used in 1 other section)

Code from the demo
float sz = ImGui::GetTextLineHeight();
for (int i = 0; i < ImGuiCol_COUNT; i++)
{
    const char* name = ImGui::GetStyleColorName((ImGuiCol)i);
    ImVec2 p = ImGui::GetCursorScreenPos();
    ImGui::GetWindowDrawList()->AddRectFilled(p, ImVec2(p.x + sz, p.y + sz), ImGui::GetColorU32((ImGuiCol)i));
    ImGui::Dummy(ImVec2(sz, sz));
    ImGui::SameLine();
    ImGui::MenuItem(name);
}

get a string corresponding to the enum value (for display, saving, etc.).

ImGui::SetStateStorage

IMGUI_API void SetStateStorage(ImGuiStorage* storage);

replace current window storage with our own (if you want to manipulate it yourself, typically clear subsection of it)

ImGui::GetStateStorage

IMGUI_API ImGuiStorage* GetStateStorage();

ImGui::CalcTextSize

IMGUI_API ImVec2 CalcTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f);

See it live: Widgets › Selectables › Multiple items on the same line (also used in 6 other sections)

Widgets › Selectables › Multiple items on the same line
Code from the demo
ImGui::Spacing();

Text Utilities

Color Utilities

ImGui::ColorConvertU32ToFloat4

IMGUI_API ImVec4 ColorConvertU32ToFloat4(ImU32 in);

ImGui::ColorConvertFloat4ToU32

IMGUI_API ImU32 ColorConvertFloat4ToU32(const ImVec4& in);

Inputs Utilities: Raw Keyboard/Mouse/Gamepad Access

ImGui::IsKeyDown

IMGUI_API bool IsKeyDown(ImGuiKey key);

See it live: Inputs & Focus › Inputs (also used in 1 other section)

Inputs & Focus › Inputs
Code from the demo
struct funcs { static bool IsLegacyNativeDupe(ImGuiKey) { return false; } };
ImGuiKey start_key = ImGuiKey_NamedKey_BEGIN;
ImGui::Text("Keys down:");         for (ImGuiKey key = start_key; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key) || !ImGui::IsKeyDown(key)) continue; ImGui::SameLine(); ImGui::Text((key < ImGuiKey_NamedKey_BEGIN) ? "\"%s\"" : "\"%s\" %d", ImGui::GetKeyName(key), key); }

is key being held.

ImGui::IsKeyPressed

IMGUI_API bool IsKeyPressed(ImGuiKey key, bool repeat = true);

See it live: Configuration

Configuration
Code from the demo
if (ImGui::IsKeyPressed(ImGuiKey_Space) || (io.ConfigFlags & ImGuiConfigFlags_NoKeyboard))
    io.ConfigFlags &= ~ImGuiConfigFlags_NoMouse;

was key pressed (went from !Down to Down)? Repeat rate uses io.KeyRepeatDelay / KeyRepeatRate.

ImGui::IsKeyReleased

IMGUI_API bool IsKeyReleased(ImGuiKey key);

was key released (went from Down to !Down)?

ImGui::IsKeyChordPressed

IMGUI_API bool IsKeyChordPressed(ImGuiKeyChord key_chord);

was key chord (mods + key) pressed, e.g. you can pass ‘ImGuiMod_Ctrl | ImGuiKey_S’ as a key-chord. This doesn’t do any routing or focus check, please consider using Shortcut() function instead.

ImGui::GetKeyPressedAmount

IMGUI_API int GetKeyPressedAmount(ImGuiKey key, float repeat_delay, float rate);

uses provided repeat rate/delay. return a count, most often 0 or 1 but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate

ImGui::GetKeyName

IMGUI_API const char* GetKeyName(ImGuiKey key);

See it live: Inputs & Focus › Inputs

Inputs & Focus › Inputs
Code from the demo
struct funcs { static bool IsLegacyNativeDupe(ImGuiKey) { return false; } };
ImGuiKey start_key = ImGuiKey_NamedKey_BEGIN;
ImGui::Text("Keys down:");         for (ImGuiKey key = start_key; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key) || !ImGui::IsKeyDown(key)) continue; ImGui::SameLine(); ImGui::Text((key < ImGuiKey_NamedKey_BEGIN) ? "\"%s\"" : "\"%s\" %d", ImGui::GetKeyName(key), key); }

[DEBUG] returns English name of the key. Those names are provided for debugging purpose and are not meant to be saved persistently nor compared.

ImGui::SetNextFrameWantCaptureKeyboard

IMGUI_API void SetNextFrameWantCaptureKeyboard(bool want_capture_keyboard);

See it live: Inputs & Focus › Outputs › WantCapture override

Inputs & Focus › Outputs › WantCapture override
Code from the demo
if (ImGui::IsItemHovered() && capture_override_keyboard != -1)
    ImGui::SetNextFrameWantCaptureKeyboard(capture_override_keyboard == 1);

Override io.WantCaptureKeyboard flag next frame (said flag is left for your application to handle, typically when True it instructs your app to ignore inputs). e.g. force capture keyboard when your widget is being hovered. This is equivalent to setting “io.WantCaptureKeyboard = want_capture_keyboard”; after the next NewFrame() call.

Inputs Utilities: Shortcut Testing & Routing

      ImGuiKey_C                          // Accepted by functions taking ImGuiKey or ImGuiKeyChord arguments
      ImGuiMod_Ctrl | ImGuiKey_C          // Accepted by functions taking ImGuiKeyChord arguments

only ImGuiMod_XXX values are legal to combine with an ImGuiKey. You CANNOT combine two ImGuiKey values.

     Parent   -> call Shortcut(Ctrl+S)    // When Parent is focused, Parent gets the shortcut.
       Child1 -> call Shortcut(Ctrl+S)    // When Child1 is focused, Child1 gets the shortcut (Child1 overrides Parent shortcuts)
       Child2 -> no call                  // When Child2 is focused, Parent gets the shortcut.

The whole system is order independent, so if Child1 makes its calls before Parent, results will be identical.
This is an important property as it facilitate working with foreign code or larger codebase.

ImGui::Shortcut

IMGUI_API bool Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags = 0);

See it live: Inputs & Focus › Shortcuts (also used in 3 other sections)

Inputs & Focus › Shortcuts
Code from the demo
ImGui::Text("Ctrl+A");
ImGui::Text("IsWindowFocused: %d, Shortcut: %s", ImGui::IsWindowFocused(), ImGui::Shortcut(key_chord, flags) ? "PRESSED" : "...");

ImGui::SetNextItemShortcut

IMGUI_API void SetNextItemShortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags = 0);

See it live: Inputs & Focus › Shortcuts (also used in 3 other sections)

Inputs & Focus › Shortcuts
Code from the demo
ImGui::SeparatorText("Using SetNextItemShortcut()");
ImGui::Text("Ctrl+S");
ImGui::SetNextItemShortcut(ImGuiMod_Ctrl | ImGuiKey_S, flags | ImGuiInputFlags_Tooltip);

Inputs Utilities: Key/Input Ownership [BETA]

ImGui::SetItemKeyOwner

IMGUI_API bool SetItemKeyOwner(ImGuiKey key);

Set key owner to last item ID if it is hovered or active. Return True when ownership has been set. Roughly equivalent to ‘if (TestKeyOwner(key, GetItemID()) && (IsItemHovered() || IsItemActive())) { SetKeyOwner(key, GetItemID());’.

Inputs Utilities: Mouse

ImGui::IsMouseDown

IMGUI_API bool IsMouseDown(ImGuiMouseButton button);

See it live: Inputs & Focus › Inputs (also used in 1 other section)

Inputs & Focus › Inputs
Code from the demo
ImGui::Text("Mouse delta: (%g, %g)", io.MouseDelta.x, io.MouseDelta.y);
ImGui::Text("Mouse down:");
for (int i = 0; i < IM_COUNTOF(io.MouseDown); i++) if (ImGui::IsMouseDown(i)) { ImGui::SameLine(); ImGui::Text("b%d (%.02f secs)", i, io.MouseDownDuration[i]); }

is mouse button held?

ImGui::IsMouseClicked

IMGUI_API bool IsMouseClicked(ImGuiMouseButton button, bool repeat = false);

See it live: Examples › Custom rendering › Canvas

Code from the demo
if (is_hovered && !adding_line && ImGui::IsMouseClicked(ImGuiMouseButton_Left))
{
    points.push_back(mouse_pos_in_canvas);
    points.push_back(mouse_pos_in_canvas);
    adding_line = true;
}

did mouse button clicked? (went from !Down to Down). Same as GetMouseClickedCount() == 1.

ImGui::IsMouseReleased

IMGUI_API bool IsMouseReleased(ImGuiMouseButton button);

See it live: Tables › Context menus

Tables › Context menus
Code from the demo
int hovered_column = -1;
for (int column = 0; column < COLUMNS_COUNT + 1; column++)
{
    ImGui::PushID(column);
    if (ImGui::TableGetColumnFlags(column) & ImGuiTableColumnFlags_IsHovered)
        hovered_column = column;
    if (hovered_column == column && !ImGui::IsAnyItemHovered() && ImGui::IsMouseReleased(1))
        ImGui::OpenPopup("MyPopup");
    if (ImGui::BeginPopup("MyPopup"))
    {
        if (column == COLUMNS_COUNT)
            ImGui::Text("This is a custom popup for unused space after the last column.");
        else
            ImGui::Text("This is a custom popup for Column %d", column);
...

did mouse button released? (went from Down to !Down)

ImGui::IsMouseDoubleClicked

IMGUI_API bool IsMouseDoubleClicked(ImGuiMouseButton button);

See it live: Widgets › Selectables › Basic

Widgets › Selectables › Basic
Code from the demo
ImGui::Selectable("1. I am selectable", &selection[0]);
ImGui::Selectable("2. I am selectable", &selection[1]);
ImGui::Selectable("3. I am selectable", &selection[2]);
if (ImGui::Selectable("4. I am double clickable", selection[3], ImGuiSelectableFlags_AllowDoubleClick))
    if (ImGui::IsMouseDoubleClicked(0))
        selection[3] = !selection[3];

did mouse button double-clicked? Same as GetMouseClickedCount() == 2. (note that a double-click will also report IsMouseClicked() == True)

ImGui::IsMouseReleasedWithDelay

IMGUI_API bool IsMouseReleasedWithDelay(ImGuiMouseButton button, float delay=-1.f);

delayed mouse release. Use sparingly. Prefer higher-level helper GetItemClickedCountWithSingleClickDelay(). Generally used with ‘delay >= io.MouseDoubleClickTime’ + combined with a ‘io.MouseClickedLastCount==1’ test.

ImGui::GetMouseClickedCount

IMGUI_API int GetMouseClickedCount(ImGuiMouseButton button);

return the number of successive mouse-clicks at the time where a click happen (otherwise 0).

ImGui::IsMouseHoveringRect

IMGUI_API bool IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool clip = true);

is mouse hovering given bounding rect (in screen space). clipped by current clipping settings, but disregarding of other consideration of focus/window ordering/popup-block.

ImGui::IsMousePosValid

IMGUI_API bool IsMousePosValid(const ImVec2* mouse_pos = NULL);

See it live: Inputs & Focus › Inputs (also used in 1 other section)

Inputs & Focus › Inputs
Code from the demo
if (ImGui::IsMousePosValid())
    ImGui::Text("Mouse pos: (%g, %g)", io.MousePos.x, io.MousePos.y);

by convention we use (-FLT_MAX,-FLT_MAX) to denote that there is no mouse available

ImGui::IsAnyMouseDown

IMGUI_API bool IsAnyMouseDown();

[WILL OBSOLETE] is any mouse button held? This was designed for backends, but prefer having backend maintain a mask of held mouse buttons, because upcoming input queue system will make this invalid.

ImGui::GetMousePos

IMGUI_API ImVec2 GetMousePos();

shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls

ImGui::GetMousePosOnOpeningCurrentPopup

IMGUI_API ImVec2 GetMousePosOnOpeningCurrentPopup();

retrieve mouse position at the time of opening popup we have BeginPopup() into (helper to avoid user backing that value themselves)

ImGui::IsMouseDragging

IMGUI_API bool IsMouseDragging(ImGuiMouseButton button, float lock_threshold = -1.0f);

See it live: Inputs & Focus › Dragging (also used in 2 other sections)

Inputs & Focus › Dragging
Code from the demo
ImGui::TextWrapped("You can use ImGui::GetMouseDragDelta(0) to query for the dragged amount on any widget.");
for (int button = 0; button < 3; button++)
{
    ImGui::Text("IsMouseDragging(%d):", button);
    ImGui::Text("  w/ default threshold: %d,", ImGui::IsMouseDragging(button));
    ImGui::Text("  w/ zero threshold: %d,", ImGui::IsMouseDragging(button, 0.0f));
    ImGui::Text("  w/ large threshold: %d,", ImGui::IsMouseDragging(button, 20.0f));
}

is mouse dragging? (uses io.MouseDraggingThreshold if lock_threshold < 0.0)

ImGui::GetMouseDragDelta

IMGUI_API ImVec2 GetMouseDragDelta(ImGuiMouseButton button = 0, float lock_threshold = -1.0f);

See it live: Inputs & Focus › Dragging (also used in 2 other sections)

Inputs & Focus › Dragging
Code from the demo
ImVec2 value_raw = ImGui::GetMouseDragDelta(0, 0.0f);

return the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0 until the mouse moves past a distance threshold at least once (uses io.MouseDraggingThreshold if lock_threshold < 0.0)

ImGui::ResetMouseDragDelta

IMGUI_API void ResetMouseDragDelta(ImGuiMouseButton button = 0);

See it live: Widgets › Drag and Drop › Drag to reorder items (simple)

Widgets › Drag and Drop › Drag to reorder items (simple)
Code from the demo
int n_next = n + (ImGui::GetMouseDragDelta(0).y < 0.0f ? -1 : 1);
if (n_next >= 0 && n_next < IM_COUNTOF(item_names))
{
    item_names[n] = item_names[n_next];
    item_names[n_next] = item;
    ImGui::ResetMouseDragDelta();
}

ImGui::GetMouseCursor

IMGUI_API ImGuiMouseCursor GetMouseCursor();

See it live: Inputs & Focus › Mouse Cursors

Inputs & Focus › Mouse Cursors
Code from the demo
ImGuiMouseCursor current = ImGui::GetMouseCursor();

get desired mouse cursor shape. Important: reset in ImGui::NewFrame(), this is updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you

ImGui::SetMouseCursor

IMGUI_API void SetMouseCursor(ImGuiMouseCursor cursor_type);

See it live: Inputs & Focus › Mouse Cursors (also used in 1 other section)

Inputs & Focus › Mouse Cursors
Code from the demo
char label[32];
sprintf(label, "Mouse cursor %d: %s", i, mouse_cursors_names[i]);
ImGui::Bullet(); ImGui::Selectable(label, false);
if (ImGui::IsItemHovered())
    ImGui::SetMouseCursor(i);

set desired mouse cursor shape

ImGui::SetNextFrameWantCaptureMouse

IMGUI_API void SetNextFrameWantCaptureMouse(bool want_capture_mouse);

See it live: Inputs & Focus › Outputs › WantCapture override

Inputs & Focus › Outputs › WantCapture override
Code from the demo
float ref_sz = ImGui::GetFrameHeight() * 4.0f;
ImGui::ColorButton("##panel", ImVec4(0.7f, 0.1f, 0.7f, 1.0f), ImGuiColorEditFlags_NoTooltip | ImGuiColorEditFlags_NoDragDrop, ImVec2(ref_sz, ref_sz)); // Dummy item
if (ImGui::IsItemHovered() && capture_override_mouse != -1)
    ImGui::SetNextFrameWantCaptureMouse(capture_override_mouse == 1);

Override io.WantCaptureMouse flag next frame (said flag is left for your application to handle, typical when True it instructs your app to ignore inputs). This is equivalent to setting “io.WantCaptureMouse = want_capture_mouse;” after the next NewFrame() call.

Clipboard Utilities

ImGui::SetClipboardText

IMGUI_API void SetClipboardText(const char* text);

Settings/.Ini Utilities

ImGui::LoadIniSettingsFromDisk

IMGUI_API void LoadIniSettingsFromDisk(const char* ini_filename);

call after CreateContext() and before the first call to NewFrame(). NewFrame() automatically calls LoadIniSettingsFromDisk(io.IniFilename).

ImGui::LoadIniSettingsFromMemory

IMGUI_API void LoadIniSettingsFromMemory(const char* ini_data, size_t ini_size=0);

call after CreateContext() and before the first call to NewFrame() to provide .ini data from your own data source.

ImGui::SaveIniSettingsToDisk

IMGUI_API void SaveIniSettingsToDisk(const char* ini_filename);

this is automatically called (if io.IniFilename is not empty) a few seconds after any modification that should be reflected in the .ini file (and also by DestroyContext).

ImGui::SaveIniSettingsToMemory

IMGUI_API const char* SaveIniSettingsToMemory(size_t* out_ini_size = NULL);

return a zero-terminated string with the .ini data which you can save by your own mean. call when io.WantSaveIniSettings is set, then save data by your own mean and clear io.WantSaveIniSettings.

Debug Utilities

ImGui::DebugTextEncoding

IMGUI_API void DebugTextEncoding(const char* text);

ImGui::DebugFlashStyleColor

IMGUI_API void DebugFlashStyleColor(ImGuiCol idx);

See it live: Tools › Style Editor

Tools › Style Editor
Code from the demo
if (Button("?"))
    DebugFlashStyleColor((ImGuiCol)i);

ImGui::DebugStartItemPicker

IMGUI_API void DebugStartItemPicker();

ImGui::DebugCheckVersionAndDataLayout

IMGUI_API bool DebugCheckVersionAndDataLayout(const char* version_str, size_t sz_io, size_t sz_style, size_t sz_vec2, size_t sz_vec4, size_t sz_drawvert, size_t sz_drawidx);

This is called by IMGUI_CHECKVERSION() macro.

Memory Allocators

(Optional) Platform/OS interface for multi-viewport support
Read comments around the ImGuiPlatformIO structure for more details.
Note: You may use GetWindowViewport() to get the current viewport of the current window.

ImGui::UpdatePlatformWindows

IMGUI_API void UpdatePlatformWindows();

call in main loop. will call CreateWindow/ResizeWindow/etc. platform functions for each secondary viewport, and DestroyWindow for each inactive viewport.

ImGui::RenderPlatformWindowsDefault

IMGUI_API void RenderPlatformWindowsDefault(void* platform_render_arg = NULL, void* renderer_render_arg = NULL);

call in main loop. will call RenderWindow/SwapBuffers platform functions for each secondary viewport which doesn’t have the ImGuiViewportFlags_Minimized flag set. May be reimplemented by user for custom rendering needs.

ImGui::DestroyPlatformWindows

IMGUI_API void DestroyPlatformWindows();

call DestroyWindow platform functions for all viewports. call from backend Shutdown() if you need to close platform windows before imgui shutdown. otherwise will be called by DestroyContext().

ImGui::FindViewportByID

IMGUI_API ImGuiViewport* FindViewportByID(ImGuiID viewport_id);

this is a helper for backends.

ImGui::FindViewportByPlatformHandle

IMGUI_API ImGuiViewport* FindViewportByPlatformHandle(void* platform_handle);

this is a helper for backends. the type platform_handle is decided by the backend (e.g. HWND, MyWindow*, GLFWwindow* etc.)

Flags & Enumerations

ImGuiWindowFlags_ (enum)

enum ImGuiWindowFlags_

The type of its values in the API: typedef int ImGuiWindowFlags;

Flags for ImGui::Begin() (Those are per-window flags. There are shared flags in ImGuiIO: io.ConfigWindowsResizeFromEdges and io.ConfigWindowsMoveFromTitleBarOnly)

MemberValue
ImGuiWindowFlags_None = 00
ImGuiWindowFlags_NoTitleBar = 1 << 01 << 0Disable title-bar
ImGuiWindowFlags_NoResize = 1 << 11 << 1Disable user resizing with the lower-right grip
ImGuiWindowFlags_NoMove = 1 << 21 << 2Disable user moving the window
ImGuiWindowFlags_NoScrollbar = 1 << 31 << 3Disable scrollbars (window can still scroll with mouse or programmatically)
ImGuiWindowFlags_NoScrollWithMouse = 1 << 41 << 4Disable user vertically scrolling with mouse wheel. On child window, mouse wheel will be forwarded to the parent unless NoScrollbar is also set.
ImGuiWindowFlags_NoCollapse = 1 << 51 << 5Disable user collapsing window by double-clicking on it. Also referred to as Window Menu Button (e.g. within a docking node).
ImGuiWindowFlags_AlwaysAutoResize = 1 << 61 << 6Resize every window to its content every frame
ImGuiWindowFlags_NoBackground = 1 << 71 << 7Disable drawing background color (WindowBg, etc.) and outside border. Similar as using SetNextWindowBgAlpha(0.0).
ImGuiWindowFlags_NoSavedSettings = 1 << 81 << 8Never load/save settings in .ini file
ImGuiWindowFlags_NoMouseInputs = 1 << 91 << 9Disable catching mouse, hovering test with pass through.
ImGuiWindowFlags_MenuBar = 1 << 101 << 10Has a menu-bar
ImGuiWindowFlags_HorizontalScrollbar = 1 << 111 << 11Allow horizontal scrollbar to appear (off by default). You may use SetNextWindowContentSize(ImVec2(width,0.0)); prior to calling Begin() to specify width. Read code in imgui_demo in the “Horizontal Scrolling” section.
ImGuiWindowFlags_NoFocusOnAppearing = 1 << 121 << 12Disable taking focus when transitioning from hidden to visible state
ImGuiWindowFlags_NoBringToFrontOnFocus = 1 << 131 << 13Disable bringing window to front when taking focus (e.g. clicking on it or programmatically giving it focus)
ImGuiWindowFlags_AlwaysVerticalScrollbar= 1 << 141 << 14Always show vertical scrollbar (even if ContentSize.y < Size.y)
ImGuiWindowFlags_AlwaysHorizontalScrollbar=1<< 151<< 15Always show horizontal scrollbar (even if ContentSize.x < Size.x)
ImGuiWindowFlags_NoNavInputs = 1 << 161 << 16No keyboard/gamepad navigation within the window
ImGuiWindowFlags_NoNavFocus = 1 << 171 << 17No focusing toward this window with keyboard/gamepad navigation (e.g. skipped by Ctrl+Tab)
ImGuiWindowFlags_UnsavedDocument = 1 << 181 << 18Display a dot next to the title. When used in a tab/docking context, tab is selected when clicking the X + closure is not assumed (will wait for user to stop submitting the tab). Otherwise closure is assumed when pressing the X, so if you keep submitting the tab may reappear at end of tab bar.
ImGuiWindowFlags_NoDocking = 1 << 191 << 19Disable docking of this window
ImGuiWindowFlags_NoNav = ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocusWindowFlags_NoNavInputs | WindowFlags_NoNavFocus
ImGuiWindowFlags_NoDecoration = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoCollapseWindowFlags_NoTitleBar | WindowFlags_NoResize | WindowFlags_NoScrollbar | WindowFlags_NoCollapse
ImGuiWindowFlags_NoInputs = ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocusWindowFlags_NoMouseInputs | WindowFlags_NoNavInputs | WindowFlags_NoNavFocus
ImGuiWindowFlags_DockNodeHost = 1 << 231 << 23Don’t use! For internal use by Begin()/NewFrame()
ImGuiWindowFlags_ChildWindow = 1 << 241 << 24Don’t use! For internal use by BeginChild()
ImGuiWindowFlags_Tooltip = 1 << 251 << 25Don’t use! For internal use by BeginTooltip()
ImGuiWindowFlags_Popup = 1 << 261 << 26Don’t use! For internal use by BeginPopup()
ImGuiWindowFlags_Modal = 1 << 271 << 27Don’t use! For internal use by BeginPopupModal()
ImGuiWindowFlags_ChildMenu = 1 << 281 << 28Don’t use! For internal use by BeginMenu()

ImGuiChildFlags_ (enum)

enum ImGuiChildFlags_

The type of its values in the API: typedef int ImGuiChildFlags;

Flags for ImGui::BeginChild() (Legacy: bit 0 must always correspond to ImGuiChildFlags_Borders to be backward compatible with old API using ‘bool border = False’.)
About using AutoResizeX/AutoResizeY flags:

MemberValue
ImGuiChildFlags_None = 00
ImGuiChildFlags_Borders = 1 << 01 << 0Show an outer border and enable WindowPadding. (IMPORTANT: this is always == 1 == True for legacy reason)
ImGuiChildFlags_AlwaysUseWindowPadding = 1 << 11 << 1Pad with style.WindowPadding even if no border are drawn (no padding by default for non-bordered child windows because it makes more sense)
ImGuiChildFlags_ResizeX = 1 << 21 << 2Allow resize from right border (layout direction). Enable .ini saving (unless ImGuiWindowFlags_NoSavedSettings passed to window flags)
ImGuiChildFlags_ResizeY = 1 << 31 << 3Allow resize from bottom border (layout direction). "
ImGuiChildFlags_AutoResizeX = 1 << 41 << 4Enable auto-resizing width. Read “IMPORTANT: Size measurement” details above.
ImGuiChildFlags_AutoResizeY = 1 << 51 << 5Enable auto-resizing height. Read “IMPORTANT: Size measurement” details above.
ImGuiChildFlags_AlwaysAutoResize = 1 << 61 << 6Combined with AutoResizeX/AutoResizeY. Always measure size even when child is hidden, always return True, always disable clipping optimization! NOT RECOMMENDED.
ImGuiChildFlags_FrameStyle = 1 << 71 << 7Style the child window like a framed item: use FrameBg, FrameRounding, FrameBorderSize, FramePadding instead of ChildBg, ChildRounding, ChildBorderSize, WindowPadding.
ImGuiChildFlags_NavFlattened = 1 << 81 << 8[BETA] Share focus scope, allow keyboard/gamepad navigation to cross over parent border to this child or between sibling child windows.

ImGuiItemFlags_ (enum)

enum ImGuiItemFlags_

Flags for ImGui::PushItemFlag() (Those are shared by all submitted items)

MemberValue
ImGuiItemFlags_None = 00Default:
ImGuiItemFlags_NoTabStop = 1 << 01 << 0False // Disable keyboard tabbing. This is a “lighter” version of ImGuiItemFlags_NoNav.
ImGuiItemFlags_NoNav = 1 << 11 << 1False // Disable any form of focusing: keyboard/gamepad directional navigation and SetKeyboardFocusHere() calls.
ImGuiItemFlags_NoNavDefaultFocus = 1 << 21 << 2False // Disable item being a candidate for default focus (e.g. used by title bar items).
ImGuiItemFlags_ButtonRepeat = 1 << 31 << 3False // Any button-like behavior will have repeat mode enabled (based on io.KeyRepeatDelay and io.KeyRepeatRate values). Note that you can also call IsItemActive() after any button to tell if it is being held.
ImGuiItemFlags_AutoClosePopups = 1 << 41 << 4True // MenuItem()/Selectable() automatically close their parent popup window.
ImGuiItemFlags_AllowDuplicateId = 1 << 51 << 5False // Allow submitting an item with the same identifier as an item already submitted this frame without triggering a warning tooltip if io.ConfigDebugHighlightIdConflicts is set.
ImGuiItemFlags_Disabled = 1 << 61 << 6False // [Internal] Disable interactions. DOES NOT affect visuals. This is used by BeginDisabled()/EndDisabled() and only provided here so you can read back via GetItemFlags().
ImGuiItemFlags_LiveEditOnInputText = 1 << 71 << 7True // InputText: apply keyboard edits to backing value while typing. Otherwise, edits are applied when validating, tabbing out or losing focus.
ImGuiItemFlags_LiveEditOnInputScalar = 1 << 81 << 8False // DragXXX, SliderXXX, InputScalar: apply keyboard edits to backing value while typing. Otherwise, edits are applied when validating, tabbing out or losing focus.
ImGuiItemFlags_LiveEditOnInput = ImGuiItemFlags_LiveEditOnInputText | ImGuiItemFlags_LiveEditOnInputScalarItemFlags_LiveEditOnInputText | ItemFlags_LiveEditOnInputScalar
ImGuiItemFlags_MixedValue = 1 << 91 << 9False // [BETA] Represent a mixed/indeterminate value. Replace value label with “-” and apply edits on validation.

ImGuiInputTextFlags_ (enum)

enum ImGuiInputTextFlags_

The type of its values in the API: typedef int ImGuiInputTextFlags;

Flags for ImGui::InputText() (Those are per-item flags. There are shared flags in ImGuiIO: io.ConfigInputTextCursorBlink and io.ConfigInputTextEnterKeepActive)

MemberValue
ImGuiInputTextFlags_None = 00
ImGuiInputTextFlags_CharsDecimal = 1 << 01 << 0Allow 0123456789.+-*/
ImGuiInputTextFlags_CharsHexadecimal = 1 << 11 << 1Allow 0123456789ABCDEFabcdef
ImGuiInputTextFlags_CharsScientific = 1 << 21 << 2Allow 0123456789.+-*/eE (Scientific notation input)
ImGuiInputTextFlags_CharsUppercase = 1 << 31 << 3Turn a..z into A..Z
ImGuiInputTextFlags_CharsNoBlank = 1 << 41 << 4Filter out spaces, tabs
ImGuiInputTextFlags_AllowTabInput = 1 << 51 << 5Pressing TAB input a ‘\t’ character into the text field
ImGuiInputTextFlags_EnterReturnsTrue = 1 << 61 << 6Return ‘True’ when Enter is pressed (as opposed to every time the value was modified). Consider disabling LiveEdit! or using IsItemDeactivatedAfterEdit() instead!
ImGuiInputTextFlags_EscapeClearsAll = 1 << 71 << 7Escape key clears content if not empty, and deactivate otherwise (contrast to default behavior of Escape to revert)
ImGuiInputTextFlags_CtrlEnterForNewLine = 1 << 81 << 8In multi-line mode: validate with Enter, add new line with Ctrl+Enter (default is opposite: validate with Ctrl+Enter, add line with Enter). Note that Shift+Enter always enter a new line either way.
ImGuiInputTextFlags_ReadOnly = 1 << 91 << 9Read-only mode
ImGuiInputTextFlags_Password = 1 << 101 << 10Password mode, display all characters as ‘*’, disable copy
ImGuiInputTextFlags_AlwaysOverwrite = 1 << 111 << 11Overwrite mode
ImGuiInputTextFlags_AutoSelectAll = 1 << 121 << 12Select entire text when first taking mouse focus
ImGuiInputTextFlags_ParseEmptyRefVal = 1 << 131 << 13InputFloat(), InputInt(), InputScalar() etc. only: parse empty string as zero value.
ImGuiInputTextFlags_DisplayEmptyRefVal = 1 << 141 << 14InputFloat(), InputInt(), InputScalar() etc. only: when value is zero, do not display it. Generally used with ImGuiInputTextFlags_ParseEmptyRefVal.
ImGuiInputTextFlags_NoHorizontalScroll = 1 << 151 << 15Disable following the cursor horizontally
ImGuiInputTextFlags_NoUndoRedo = 1 << 161 << 16Disable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID().
ImGuiInputTextFlags_ElideLeft = 1 << 171 << 17When text doesn’t fit, elide left side to ensure right side stays visible. Useful for path/filenames. Single-line only!
ImGuiInputTextFlags_CallbackCompletion = 1 << 181 << 18Callback on pressing TAB (for completion handling)
ImGuiInputTextFlags_CallbackHistory = 1 << 191 << 19Callback on pressing Up/Down arrows (for history handling)
ImGuiInputTextFlags_CallbackAlways = 1 << 201 << 20Callback on each iteration. User code may query cursor position, modify text buffer.
ImGuiInputTextFlags_CallbackCharFilter = 1 << 211 << 21Callback on character inputs to replace or discard them. Modify ‘EventChar’ to replace or discard, or return 1 in callback to discard.
ImGuiInputTextFlags_CallbackResize = 1 << 221 << 22Callback on buffer capacity changes request (beyond ‘buf_size’ parameter value), allowing the string to grow. Notify when the string wants to be resized (for string types which hold a cache of their Size). You will be provided a new BufSize in the callback and NEED to honor it. (see misc/cpp/imgui_stdlib.h for an example of using this)
ImGuiInputTextFlags_CallbackEdit = 1 << 231 << 23Callback on any edit. Note that InputText() already returns True on edit + you can always use IsItemEdited(). The callback is useful to manipulate the underlying buffer while focus is active.
ImGuiInputTextFlags_WordWrap = 1 << 241 << 24InputTextMultiline(): word-wrap lines that are too long.

ImGuiTreeNodeFlags_ (enum)

enum ImGuiTreeNodeFlags_

The type of its values in the API: typedef int ImGuiTreeNodeFlags;

Flags for ImGui::TreeNodeEx(), ImGui::CollapsingHeader*()

MemberValue
ImGuiTreeNodeFlags_None = 00
ImGuiTreeNodeFlags_Selected = 1 << 01 << 0Draw as selected
ImGuiTreeNodeFlags_Framed = 1 << 11 << 1Draw frame with background (e.g. for CollapsingHeader)
ImGuiTreeNodeFlags_AllowOverlap = 1 << 21 << 2Hit testing will allow subsequent widgets to overlap this one. Require previous frame HoveredId to match before being usable. Shortcut to calling SetNextItemAllowOverlap().
ImGuiTreeNodeFlags_NoTreePushOnOpen = 1 << 31 << 3Don’t do a TreePush() when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack
ImGuiTreeNodeFlags_NoAutoOpenOnLog = 1 << 41 << 4Don’t automatically and temporarily open node when Logging is active (by default logging will automatically open tree nodes)
ImGuiTreeNodeFlags_DefaultOpen = 1 << 51 << 5Default node to be open
ImGuiTreeNodeFlags_OpenOnDoubleClick = 1 << 61 << 6Open on double-click instead of simple click (default for multi-select unless any _OpenOnXXX behavior is set explicitly). Both behaviors may be combined.
ImGuiTreeNodeFlags_OpenOnArrow = 1 << 71 << 7Open when clicking on the arrow part (default for multi-select unless any _OpenOnXXX behavior is set explicitly). Both behaviors may be combined.
ImGuiTreeNodeFlags_Leaf = 1 << 81 << 8No collapsing, no arrow (use as a convenience for leaf nodes). Note: will always open a tree/id scope and return True. If you never use that scope, add ImGuiTreeNodeFlags_NoTreePushOnOpen.
ImGuiTreeNodeFlags_Bullet = 1 << 91 << 9Display a bullet instead of arrow. IMPORTANT: node can still be marked open/close if you don’t set the _Leaf flag!
ImGuiTreeNodeFlags_FramePadding = 1 << 101 << 10Use FramePadding (even for an unframed text node) to vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding() before the node.
ImGuiTreeNodeFlags_SpanAvailWidth = 1 << 111 << 11Extend hit box to the right-most edge, even if not framed. This is not the default in order to allow adding other items on the same line without using AllowOverlap mode.
ImGuiTreeNodeFlags_SpanFullWidth = 1 << 121 << 12Extend hit box to the left-most and right-most edges (cover the indent area).
ImGuiTreeNodeFlags_SpanLabelWidth = 1 << 131 << 13Narrow hit box + narrow hovering highlight, will only cover the label text.
ImGuiTreeNodeFlags_SpanAllColumns = 1 << 141 << 14Frame will span all columns of its container table (label will still fit in current column)
ImGuiTreeNodeFlags_LabelSpanAllColumns = 1 << 151 << 15Label will span all columns of its container table
ImGuiTreeNodeFlags_NavLeftJumpsToParent = 1 << 171 << 17Nav: left arrow moves back to parent. This is processed in TreePop() when there’s an unfulfilled Left nav request remaining.
ImGuiTreeNodeFlags_CollapsingHeader = ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_NoAutoOpenOnLogTreeNodeFlags_Framed | TreeNodeFlags_NoTreePushOnOpen | TreeNodeFlags_NoAutoOpenOnLog
ImGuiTreeNodeFlags_DrawLinesNone = 1 << 181 << 18No lines drawn
ImGuiTreeNodeFlags_DrawLinesFull = 1 << 191 << 19Horizontal lines to child nodes. Vertical line drawn down to TreePop() position: cover full contents. Faster (for large trees).
ImGuiTreeNodeFlags_DrawLinesToNodes = 1 << 201 << 20Horizontal lines to child nodes. Vertical line drawn down to bottom-most child node. Slower (for large trees).

ImGuiPopupFlags_ (enum)

enum ImGuiPopupFlags_

The type of its values in the API: typedef int ImGuiPopupFlags;

Flags for OpenPopup*(), BeginPopupContext*(), IsPopupOpen() functions.

MemberValue
ImGuiPopupFlags_None = 00
ImGuiPopupFlags_MouseButtonLeft = 1 << 21 << 2For BeginPopupContext*(): open on Left Mouse release. Only one button allowed!
ImGuiPopupFlags_MouseButtonRight = 2 << 22 << 2For BeginPopupContext*(): open on Right Mouse release. Only one button allowed! (default)
ImGuiPopupFlags_MouseButtonMiddle = 3 << 23 << 2For BeginPopupContext*(): open on Middle Mouse release. Only one button allowed!
ImGuiPopupFlags_NoReopen = 1 << 51 << 5For OpenPopup*(), BeginPopupContext*(): don’t reopen same popup if already open (won’t reposition, won’t reinitialize navigation)
ImGuiPopupFlags_NoOpenOverExistingPopup = 1 << 71 << 7For OpenPopup*(), BeginPopupContext*(): don’t open if there’s already a popup at the same level of the popup stack
ImGuiPopupFlags_NoOpenOverItems = 1 << 81 << 8For BeginPopupContextWindow(): don’t return True when hovering items, only when hovering empty space
ImGuiPopupFlags_AnyPopupId = 1 << 101 << 10For IsPopupOpen(): ignore the ImGuiID parameter and test for any popup.
ImGuiPopupFlags_AnyPopupLevel = 1 << 111 << 11For IsPopupOpen(): search/test at any level of the popup stack (default test in the current level)
ImGuiPopupFlags_AnyPopup = ImGuiPopupFlags_AnyPopupId | ImGuiPopupFlags_AnyPopupLevelPopupFlags_AnyPopupId | PopupFlags_AnyPopupLevel
ImGuiPopupFlags_MouseButtonShift_ = 22[Internal]
ImGuiPopupFlags_MouseButtonMask_ = 0x0C0x0C[Internal]
ImGuiPopupFlags_InvalidMask_ = 0x030x03[Internal] Reserve legacy bits 0-1 to detect incorrectly passing 1 or 2 to the function.

ImGuiSelectableFlags_ (enum)

enum ImGuiSelectableFlags_

The type of its values in the API: typedef int ImGuiSelectableFlags;

Flags for ImGui::Selectable()

MemberValue
ImGuiSelectableFlags_None = 00
ImGuiSelectableFlags_NoAutoClosePopups = 1 << 01 << 0Clicking this doesn’t close parent popup window (overrides ImGuiItemFlags_AutoClosePopups)
ImGuiSelectableFlags_SpanAllColumns = 1 << 11 << 1Frame will span all columns of its container table (text will still fit in current column)
ImGuiSelectableFlags_AllowDoubleClick = 1 << 21 << 2Generate press events on double clicks too
ImGuiSelectableFlags_Disabled = 1 << 31 << 3Cannot be selected, display grayed out text
ImGuiSelectableFlags_AllowOverlap = 1 << 41 << 4Hit testing will allow subsequent widgets to overlap this one. Require previous frame HoveredId to match before being usable. Shortcut to calling SetNextItemAllowOverlap().
ImGuiSelectableFlags_Highlight = 1 << 51 << 5Make the item be displayed as if it is hovered
ImGuiSelectableFlags_SelectOnNav = 1 << 61 << 6Auto-select when moved into, unless Ctrl is held. Automatic when in a BeginMultiSelect() block.

ImGuiComboFlags_ (enum)

enum ImGuiComboFlags_

The type of its values in the API: typedef int ImGuiComboFlags;

Flags for ImGui::BeginCombo()

MemberValue
ImGuiComboFlags_None = 00
ImGuiComboFlags_PopupAlignLeft = 1 << 01 << 0Align the popup toward the left by default
ImGuiComboFlags_HeightSmall = 1 << 11 << 1Max ~4 items visible. Tip: If you want your combo popup to be a specific size you can use SetNextWindowSizeConstraints() prior to calling BeginCombo()
ImGuiComboFlags_HeightRegular = 1 << 21 << 2Max ~8 items visible (default)
ImGuiComboFlags_HeightLarge = 1 << 31 << 3Max ~20 items visible
ImGuiComboFlags_HeightLargest = 1 << 41 << 4As many fitting items as possible
ImGuiComboFlags_NoArrowButton = 1 << 51 << 5Display on the preview box without the square arrow button
ImGuiComboFlags_NoPreview = 1 << 61 << 6Display only a square arrow button
ImGuiComboFlags_WidthFitPreview = 1 << 71 << 7Width dynamically calculated from preview contents
ImGuiComboFlags_HeightMask_ = ImGuiComboFlags_HeightSmall | ImGuiComboFlags_HeightRegular | ImGuiComboFlags_HeightLarge | ImGuiComboFlags_HeightLargest, }ComboFlags_HeightSmall | ComboFlags_HeightRegular | ComboFlags_HeightLarge | ComboFlags_HeightLargest

ImGuiTabBarFlags_ (enum)

enum ImGuiTabBarFlags_

The type of its values in the API: typedef int ImGuiTabBarFlags;

Flags for ImGui::BeginTabBar()

MemberValue
ImGuiTabBarFlags_None = 00
ImGuiTabBarFlags_Reorderable = 1 << 01 << 0Allow manually dragging tabs to re-order them + New tabs are appended at the end of list
ImGuiTabBarFlags_AutoSelectNewTabs = 1 << 11 << 1Automatically select new tabs when they appear
ImGuiTabBarFlags_TabListPopupButton = 1 << 21 << 2Disable buttons to open the tab list popup
ImGuiTabBarFlags_NoCloseWithMiddleMouseButton = 1 << 31 << 3Disable behavior of closing tabs (that are submitted with p_open != None) with middle mouse button. You may handle this behavior manually on user’s side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = False.
ImGuiTabBarFlags_NoTabListScrollingButtons = 1 << 41 << 4Disable scrolling buttons (apply when fitting policy is ImGuiTabBarFlags_FittingPolicyScroll)
ImGuiTabBarFlags_NoTooltip = 1 << 51 << 5Disable tooltips when hovering a tab
ImGuiTabBarFlags_DrawSelectedOverline = 1 << 61 << 6Draw selected overline markers over selected tab
ImGuiTabBarFlags_FittingPolicyMixed = 1 << 71 << 7Shrink down tabs when they don’t fit, until width is style.TabMinWidthShrink, then enable scrolling. Setting TabMinWidthShrink to FLT_MAX makes this behave like ImGuiTabBarFlags_FittingPolicyScroll.
ImGuiTabBarFlags_FittingPolicyShrink = 1 << 81 << 8Shrink down tabs when they don’t fit
ImGuiTabBarFlags_FittingPolicyScroll = 1 << 91 << 9Enable scrolling buttons when tabs don’t fit
ImGuiTabBarFlags_FittingPolicyMask_ = ImGuiTabBarFlags_FittingPolicyMixed | ImGuiTabBarFlags_FittingPolicyShrink | ImGuiTabBarFlags_FittingPolicyScrollTabBarFlags_FittingPolicyMixed | TabBarFlags_FittingPolicyShrink | TabBarFlags_FittingPolicyScroll
ImGuiTabBarFlags_FittingPolicyDefault_ = ImGuiTabBarFlags_FittingPolicyMixedTabBarFlags_FittingPolicyMixed

ImGuiTabItemFlags_ (enum)

enum ImGuiTabItemFlags_

See it live: Widgets › Tabs › TabItemButton & Leading-Trailing flags (also used in 2 other sections)

Widgets › Tabs › TabItemButton & Leading-Trailing flags
Code from the demo
if (show_leading_button)
    if (ImGui::TabItemButton("?", ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_NoTooltip))
        ImGui::OpenPopup("MyHelpMenu");

The type of its values in the API: typedef int ImGuiTabItemFlags;

Flags for ImGui::BeginTabItem()

MemberValue
ImGuiTabItemFlags_None = 00
ImGuiTabItemFlags_UnsavedDocument = 1 << 01 << 0Display a dot next to the title + set ImGuiTabItemFlags_NoAssumedClosure.
ImGuiTabItemFlags_SetSelected = 1 << 11 << 1Trigger flag to programmatically make the tab selected when calling BeginTabItem()
ImGuiTabItemFlags_NoCloseWithMiddleMouseButton = 1 << 21 << 2Disable behavior of closing tabs (that are submitted with p_open != None) with middle mouse button. You may handle this behavior manually on user’s side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = False.
ImGuiTabItemFlags_NoPushId = 1 << 31 << 3Don’t call PushID()/PopID() on BeginTabItem()/EndTabItem()
ImGuiTabItemFlags_NoTooltip = 1 << 41 << 4Disable tooltip for the given tab
ImGuiTabItemFlags_NoReorder = 1 << 51 << 5Disable reordering this tab or having another tab cross over this tab
ImGuiTabItemFlags_Leading = 1 << 61 << 6Enforce the tab position to the left of the tab bar (after the tab list popup button)
ImGuiTabItemFlags_Trailing = 1 << 71 << 7Enforce the tab position to the right of the tab bar (before the scrolling buttons)
ImGuiTabItemFlags_NoAssumedClosure = 1 << 81 << 8Tab is selected when trying to close + closure is not immediately assumed (will wait for user to stop submitting the tab). Otherwise closure is assumed when pressing the X, so if you keep submitting the tab may reappear at end of tab bar.

ImGuiFocusedFlags_ (enum)

enum ImGuiFocusedFlags_

The type of its values in the API: typedef int ImGuiFocusedFlags;

Flags for ImGui::IsWindowFocused()

MemberValue
ImGuiFocusedFlags_None = 00
ImGuiFocusedFlags_ChildWindows = 1 << 01 << 0Return True if any children of the window is focused
ImGuiFocusedFlags_RootWindow = 1 << 11 << 1Test from root window (top most parent of the current hierarchy)
ImGuiFocusedFlags_AnyWindow = 1 << 21 << 2Return True if any window is focused. Important: If you are trying to tell how to dispatch your low-level inputs, do NOT use this. Use ‘io.WantCaptureMouse’ instead! Please read the FAQ!
ImGuiFocusedFlags_NoPopupHierarchy = 1 << 31 << 3Do not consider popup hierarchy (do not treat popup emitter as parent of popup) (when used with _ChildWindows or _RootWindow)
ImGuiFocusedFlags_DockHierarchy = 1 << 41 << 4Consider docking hierarchy (treat dockspace host as parent of docked window) (when used with _ChildWindows or _RootWindow)
ImGuiFocusedFlags_RootAndChildWindows = ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_ChildWindows, }FocusedFlags_RootWindow | FocusedFlags_ChildWindows

ImGuiHoveredFlags_ (enum)

enum ImGuiHoveredFlags_

The type of its values in the API: typedef int ImGuiHoveredFlags;

Flags for ImGui::IsItemHovered(), ImGui::IsWindowHovered()
Note: if you are trying to check whether your mouse should be dispatched to Dear ImGui or to your app, you should use ‘io.WantCaptureMouse’ instead! Please read the FAQ!
Note: windows with the ImGuiWindowFlags_NoInputs flag are ignored by IsWindowHovered() calls.

MemberValue
ImGuiHoveredFlags_None = 00Return True if directly over the item/window, not obstructed by another window, not obstructed by an active popup or modal blocking inputs under them.
ImGuiHoveredFlags_ChildWindows = 1 << 01 << 0IsWindowHovered() only: Return True if any children of the window is hovered
ImGuiHoveredFlags_RootWindow = 1 << 11 << 1IsWindowHovered() only: Test from root window (top most parent of the current hierarchy)
ImGuiHoveredFlags_AnyWindow = 1 << 21 << 2IsWindowHovered() only: Return True if any window is hovered
ImGuiHoveredFlags_NoPopupHierarchy = 1 << 31 << 3IsWindowHovered() only: Do not consider popup hierarchy (do not treat popup emitter as parent of popup) (when used with _ChildWindows or _RootWindow)
ImGuiHoveredFlags_DockHierarchy = 1 << 41 << 4IsWindowHovered() only: Consider docking hierarchy (treat dockspace host as parent of docked window) (when used with _ChildWindows or _RootWindow)
ImGuiHoveredFlags_AllowWhenBlockedByPopup = 1 << 51 << 5Return True even if a popup window is normally blocking access to this item/window
ImGuiHoveredFlags_AllowWhenBlockedByActiveItem = 1 << 71 << 7Return True even if an active item is blocking access to this item/window. Useful for Drag and Drop patterns.
ImGuiHoveredFlags_AllowWhenOverlappedByItem = 1 << 81 << 8IsItemHovered() only: Return True even if the item uses AllowOverlap mode and is overlapped by another hoverable item.
ImGuiHoveredFlags_AllowWhenOverlappedByWindow = 1 << 91 << 9IsItemHovered() only: Return True even if the position is obstructed or overlapped by another window.
ImGuiHoveredFlags_AllowWhenDisabled = 1 << 101 << 10IsItemHovered() only: Return True even if the item is disabled
ImGuiHoveredFlags_NoNavOverride = 1 << 111 << 11IsItemHovered() only: Disable using keyboard/gamepad navigation state when active, always query mouse
ImGuiHoveredFlags_AllowWhenOverlapped = ImGuiHoveredFlags_AllowWhenOverlappedByItem | ImGuiHoveredFlags_AllowWhenOverlappedByWindowHoveredFlags_AllowWhenOverlappedByItem | HoveredFlags_AllowWhenOverlappedByWindow
ImGuiHoveredFlags_RectOnly = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlappedHoveredFlags_AllowWhenBlockedByPopup | HoveredFlags_AllowWhenBlockedByActiveItem | HoveredFlags_AllowWhenOverlapped
ImGuiHoveredFlags_RootAndChildWindows = ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindowsHoveredFlags_RootWindow | HoveredFlags_ChildWindows
ImGuiHoveredFlags_ForTooltip = 1 << 121 << 12Shortcut for standard flags when using IsItemHovered() + SetTooltip() sequence.
ImGuiHoveredFlags_Stationary = 1 << 131 << 13Require mouse to be stationary for style.HoverStationaryDelay (~0.15 sec) at least one time. After this, can move on same item/window. Using the stationary test tends to reduces the need for a long delay.
ImGuiHoveredFlags_DelayNone = 1 << 141 << 14IsItemHovered() only: Return True immediately (default). As this is the default you generally ignore this.
ImGuiHoveredFlags_DelayShort = 1 << 151 << 15IsItemHovered() only: Return True after style.HoverDelayShort elapsed (~0.15 sec) (shared between items) + requires mouse to be stationary for style.HoverStationaryDelay (once per item).
ImGuiHoveredFlags_DelayNormal = 1 << 161 << 16IsItemHovered() only: Return True after style.HoverDelayNormal elapsed (~0.40 sec) (shared between items) + requires mouse to be stationary for style.HoverStationaryDelay (once per item).
ImGuiHoveredFlags_NoSharedDelay = 1 << 171 << 17IsItemHovered() only: Disable shared delay system where moving from one item to the next keeps the previous timer for a short time (standard for tooltips with long delays)

ImGuiDockNodeFlags_ (enum)

enum ImGuiDockNodeFlags_

The type of its values in the API: typedef int ImGuiDockNodeFlags;

Flags for ImGui::DockSpace(), shared/inherited by child nodes. (Some flags can be applied to individual nodes directly)
FIXME-DOCK: Also see ImGuiDockNodeFlagsPrivate_ which may involve using the WIP and internal DockBuilder api.

MemberValue
ImGuiDockNodeFlags_None = 00
ImGuiDockNodeFlags_KeepAliveOnly = 1 << 01 << 0// Don’t display the dockspace node but keep it alive. Windows docked into this dockspace node won’t be undocked.
ImGuiDockNodeFlags_NoDockingOverCentralNode = 1 << 21 << 2// Disable docking over the Central Node, which will be always kept empty.
ImGuiDockNodeFlags_PassthruCentralNode = 1 << 31 << 3// Enable passthru dockspace: 1) DockSpace() will render a ImGuiCol_WindowBg background covering everything excepted the Central Node when empty. Meaning the host window should probably use SetNextWindowBgAlpha(0.0) prior to Begin() when using this. 2) When Central Node is empty: let inputs pass-through + won’t display a DockingEmptyBg background. See demo for details.
ImGuiDockNodeFlags_NoDockingSplit = 1 << 41 << 4// Disable other windows/nodes from splitting this node.
ImGuiDockNodeFlags_NoResize = 1 << 51 << 5Saved // Disable resizing node using the splitter/separators. Useful with programmatically setup dockspaces.
ImGuiDockNodeFlags_AutoHideTabBar = 1 << 61 << 6// Tab bar will automatically hide when there is a single window in the dock node.
ImGuiDockNodeFlags_NoUndocking = 1 << 71 << 7// Disable undocking this node.

ImGuiDragDropFlags_ (enum)

enum ImGuiDragDropFlags_

The type of its values in the API: typedef int ImGuiDragDropFlags;

Flags for ImGui::BeginDragDropSource(), ImGui::AcceptDragDropPayload()

MemberValue
ImGuiDragDropFlags_None = 00
ImGuiDragDropFlags_SourceNoPreviewTooltip = 1 << 01 << 0Disable preview tooltip. By default, a successful call to BeginDragDropSource opens a tooltip so you can display a preview or description of the source contents. This flag disables this behavior.
ImGuiDragDropFlags_SourceNoDisableHover = 1 << 11 << 1By default, when dragging we clear data so that IsItemHovered() will return False, to avoid subsequent user code submitting tooltips. This flag disables this behavior so you can still call IsItemHovered() on the source item.
ImGuiDragDropFlags_SourceNoHoldToOpenOthers = 1 << 21 << 2Disable the behavior that allows to open tree nodes and collapsing header by holding over them while dragging a source item.
ImGuiDragDropFlags_SourceAllowNullID = 1 << 31 << 3Allow items such as Text(), Image() that have no unique identifier to be used as drag source, by manufacturing a temporary identifier based on their window-relative position. This is extremely unusual within the dear imgui ecosystem and so we made it explicit.
ImGuiDragDropFlags_SourceExtern = 1 << 41 << 4External source (from outside of dear imgui), won’t attempt to read current item/window info. Will always return True. Only one Extern source can be active simultaneously.
ImGuiDragDropFlags_PayloadAutoExpire = 1 << 51 << 5Automatically expire the payload if the source cease to be submitted (otherwise payloads are persisting while being dragged)
ImGuiDragDropFlags_PayloadNoCrossContext = 1 << 61 << 6Hint to specify that the payload may not be copied outside current dear imgui context.
ImGuiDragDropFlags_PayloadNoCrossProcess = 1 << 71 << 7Hint to specify that the payload may not be copied outside current process.
ImGuiDragDropFlags_AcceptBeforeDelivery = 1 << 101 << 10AcceptDragDropPayload() will returns True even before the mouse button is released. You can then call IsDelivery() to test if the payload needs to be delivered.
ImGuiDragDropFlags_AcceptNoDrawDefaultRect = 1 << 111 << 11Do not draw the default highlight rectangle when hovering over target.
ImGuiDragDropFlags_AcceptNoPreviewTooltip = 1 << 121 << 12Request hiding the BeginDragDropSource tooltip from the BeginDragDropTarget site.
ImGuiDragDropFlags_AcceptDrawAsHovered = 1 << 131 << 13Accepting item will render as if hovered. Useful for e.g. a Button() used as a drop target.
ImGuiDragDropFlags_AcceptPeekOnly = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoDrawDefaultRectDragDropFlags_AcceptBeforeDelivery | DragDropFlags_AcceptNoDrawDefaultRectFor peeking ahead and inspecting the payload before delivery.

ImGuiDataType_ (enum)

enum ImGuiDataType_

See it live: Widgets › Data Types › Drags (also used in 3 other sections)

Widgets › Data Types › Drags
Code from the demo
ImGui::DragScalar("drag s8",        ImGuiDataType_S8,     &s8_v,  drag_speed, drag_clamp ? &s8_zero  : NULL, drag_clamp ? &s8_fifty  : NULL);

The type of its values in the API: typedef int ImGuiDataType;

A primary data type

MemberValue
ImGuiDataType_S80signed char / char (with sensible compilers)
ImGuiDataType_U81uchar
ImGuiDataType_S162short
ImGuiDataType_U163unsigned short
ImGuiDataType_S324int
ImGuiDataType_U325unsigned int
ImGuiDataType_S646long long / __int64
ImGuiDataType_U647unsigned long long / unsigned __int64
ImGuiDataType_Float8float
ImGuiDataType_Double9double
ImGuiDataType_Bool10bool (provided for user convenience, not supported by scalar widgets)
ImGuiDataType_String11char* (provided for user convenience, not supported by scalar widgets)
ImGuiDataType_COUNT12

ImGuiDir (enum)

enum ImGuiDir

A cardinal direction

MemberValue
ImGuiDir_None = -1-1
ImGuiDir_Left = 00
ImGuiDir_Right = 11
ImGuiDir_Up = 22
ImGuiDir_Down = 33
ImGuiDir_COUNT4

ImGuiSortDirection (enum)

enum ImGuiSortDirection

A sorting direction

MemberValue
ImGuiSortDirection_None = 00
ImGuiSortDirection_Ascending = 11Ascending = 0->9, A->Z etc.
ImGuiSortDirection_Descending = 22Descending = 9->0, Z->A etc.

ImGuiKey (enum)

enum ImGuiKey

A key identifier (ImGuiKey_XXX or ImGuiMod_XXX value): can represent Keyboard, Mouse and Gamepad values.
All our named keys are >= 512. Keys value 0 to 511 are left unused and were legacy native/opaque key values (< 1.87).
Support for legacy keys was completely removed in 1.91.5.
Read details about the 1.87+ transition : ocornut/imgui#4921
Note that “Keys” related to physical keys and are not the same concept as input “Characters”, the latter are submitted via io.AddInputCharacter().
The keyboard key enum values are named after the keys on a standard US keyboard, and on other keyboard types the keys reported may not match the keycaps.

MemberValue
ImGuiKey_None = 00
ImGuiKey_NamedKey_BEGIN = 512512First valid key value (other than 0)
ImGuiKey_Tab = 512512== ImGuiKey_NamedKey_BEGIN
ImGuiKey_LeftArrow513
ImGuiKey_RightArrow514
ImGuiKey_UpArrow515
ImGuiKey_DownArrow516
ImGuiKey_PageUp517
ImGuiKey_PageDown518
ImGuiKey_Home519
ImGuiKey_End520
ImGuiKey_Insert521
ImGuiKey_Delete522
ImGuiKey_Backspace523
ImGuiKey_Space524
ImGuiKey_Enter525
ImGuiKey_Escape526
ImGuiKey_LeftCtrl527
ImGuiKey_LeftShift528
ImGuiKey_LeftAlt529
ImGuiKey_LeftSuper530Also see ImGuiMod_Ctrl, ImGuiMod_Shift, ImGuiMod_Alt, ImGuiMod_Super below!
ImGuiKey_RightCtrl531
ImGuiKey_RightShift532
ImGuiKey_RightAlt533
ImGuiKey_RightSuper534
ImGuiKey_Menu535
ImGuiKey_0536
ImGuiKey_1537
ImGuiKey_2538
ImGuiKey_3539
ImGuiKey_4540
ImGuiKey_5541
ImGuiKey_6542
ImGuiKey_7543
ImGuiKey_8544
ImGuiKey_9545
ImGuiKey_A546
ImGuiKey_B547
ImGuiKey_C548
ImGuiKey_D549
ImGuiKey_E550
ImGuiKey_F551
ImGuiKey_G552
ImGuiKey_H553
ImGuiKey_I554
ImGuiKey_J555
ImGuiKey_K556
ImGuiKey_L557
ImGuiKey_M558
ImGuiKey_N559
ImGuiKey_O560
ImGuiKey_P561
ImGuiKey_Q562
ImGuiKey_R563
ImGuiKey_S564
ImGuiKey_T565
ImGuiKey_U566
ImGuiKey_V567
ImGuiKey_W568
ImGuiKey_X569
ImGuiKey_Y570
ImGuiKey_Z571
ImGuiKey_F1572
ImGuiKey_F2573
ImGuiKey_F3574
ImGuiKey_F4575
ImGuiKey_F5576
ImGuiKey_F6577
ImGuiKey_F7578
ImGuiKey_F8579
ImGuiKey_F9580
ImGuiKey_F10581
ImGuiKey_F11582
ImGuiKey_F12583
ImGuiKey_F13584
ImGuiKey_F14585
ImGuiKey_F15586
ImGuiKey_F16587
ImGuiKey_F17588
ImGuiKey_F18589
ImGuiKey_F19590
ImGuiKey_F20591
ImGuiKey_F21592
ImGuiKey_F22593
ImGuiKey_F23594
ImGuiKey_F24595
ImGuiKey_Apostrophe596’
ImGuiKey_Comma597,
ImGuiKey_Minus598-
ImGuiKey_Period599.
ImGuiKey_Slash600/
ImGuiKey_Semicolon601;
ImGuiKey_Equal602=
ImGuiKey_LeftBracket603[
ImGuiKey_Backslash604\ (this text inhibit multiline comment caused by backslash)
ImGuiKey_RightBracket605]
ImGuiKey_GraveAccent606`
ImGuiKey_CapsLock607
ImGuiKey_ScrollLock608
ImGuiKey_NumLock609
ImGuiKey_PrintScreen610
ImGuiKey_Pause611
ImGuiKey_Keypad0612
ImGuiKey_Keypad1613
ImGuiKey_Keypad2614
ImGuiKey_Keypad3615
ImGuiKey_Keypad4616
ImGuiKey_Keypad5617
ImGuiKey_Keypad6618
ImGuiKey_Keypad7619
ImGuiKey_Keypad8620
ImGuiKey_Keypad9621
ImGuiKey_KeypadDecimal622
ImGuiKey_KeypadDivide623
ImGuiKey_KeypadMultiply624
ImGuiKey_KeypadSubtract625
ImGuiKey_KeypadAdd626
ImGuiKey_KeypadEnter627
ImGuiKey_KeypadEqual628
ImGuiKey_AppBack629Available on some keyboard/mouses. Often referred as “Browser Back”
ImGuiKey_AppForward630
ImGuiKey_Oem102631Non-US backslash.
ImGuiKey_GamepadStart632Menu | + | Options |
ImGuiKey_GamepadBack633View | - | Share |
ImGuiKey_GamepadFaceLeft634X | Y | Square | Toggle Menu. Hold for Windowing mode (Focus/Move/Resize windows)
ImGuiKey_GamepadFaceRight635B | A | Circle | Cancel / Close / Exit
ImGuiKey_GamepadFaceUp636Y | X | Triangle | Open Context Menu
ImGuiKey_GamepadFaceDown637A | B | Cross | Activate / Open / Toggle. Hold for 0.60 to Activate in Text Input mode (e.g. wired to an on-screen keyboard).
ImGuiKey_GamepadDpadLeft638D-pad Left | " | " | Move / Tweak / Resize Window (in Windowing mode)
ImGuiKey_GamepadDpadRight639D-pad Right | " | " | Move / Tweak / Resize Window (in Windowing mode)
ImGuiKey_GamepadDpadUp640D-pad Up | " | " | Move / Tweak / Resize Window (in Windowing mode)
ImGuiKey_GamepadDpadDown641D-pad Down | " | " | Move / Tweak / Resize Window (in Windowing mode)
ImGuiKey_GamepadL1642L Bumper | L | L1 | Tweak Slower / Focus Previous (in Windowing mode)
ImGuiKey_GamepadR1643R Bumper | R | R1 | Tweak Faster / Focus Next (in Windowing mode)
ImGuiKey_GamepadL2644L Trigger | ZL | L2 | [Analog]
ImGuiKey_GamepadR2645R Trigger | ZR | R2 | [Analog]
ImGuiKey_GamepadL3646L Stick | L3 | L3 |
ImGuiKey_GamepadR3647R Stick | R3 | R3 |
ImGuiKey_GamepadLStickLeft648| | | [Analog] Move Window (in Windowing mode)
ImGuiKey_GamepadLStickRight649| | | [Analog] Move Window (in Windowing mode)
ImGuiKey_GamepadLStickUp650| | | [Analog] Move Window (in Windowing mode)
ImGuiKey_GamepadLStickDown651| | | [Analog] Move Window (in Windowing mode)
ImGuiKey_GamepadRStickLeft652| | | [Analog]
ImGuiKey_GamepadRStickRight653| | | [Analog]
ImGuiKey_GamepadRStickUp654| | | [Analog]
ImGuiKey_GamepadRStickDown655| | | [Analog]
ImGuiKey_MouseLeft, Aliases: Mouse Buttons (auto-submitted from AddMouseButtonEvent() calls) - This is mirroring the data also written to io.MouseDown[], io.MouseWheel, in a format allowing them to be accessed via standard key API.656
ImGuiKey_MouseRight657
ImGuiKey_MouseMiddle658
ImGuiKey_MouseX1659
ImGuiKey_MouseX2660
ImGuiKey_MouseWheelX661
ImGuiKey_MouseWheelY662
ImGuiKey_ReservedForModCtrl, [Internal] Reserved for mod storage663
ImGuiKey_ReservedForModShift664
ImGuiKey_ReservedForModAlt665
ImGuiKey_ReservedForModSuper666
ImGuiKey_NamedKey_END667
ImGuiKey_NamedKey_COUNT = ImGuiKey_NamedKey_END - ImGuiKey_NamedKey_BEGINKey_NamedKey_END - Key_NamedKey_BEGIN
ImGuiMod_None = 00
ImGuiMod_Ctrl = 1 << 121 << 12Ctrl (non-macOS), Cmd (macOS)
ImGuiMod_Shift = 1 << 131 << 13Shift
ImGuiMod_Alt = 1 << 141 << 14Option/Menu
ImGuiMod_Super = 1 << 151 << 15Windows/Super (non-macOS), Ctrl (macOS)
ImGuiMod_Mask_ = 0xF0000xF0004-bits

ImGuiInputFlags_ (enum)

enum ImGuiInputFlags_

The type of its values in the API: typedef int ImGuiInputFlags;

Flags for Shortcut(), SetNextItemShortcut(), (and for upcoming extended versions of IsKeyPressed(), IsMouseClicked(), Shortcut(), SetKeyOwner(), SetItemKeyOwner() that are still in imgui_internal.h)
Don’t mistake with ImGuiInputTextFlags! (which is for ImGui::InputText() function)

MemberValue
ImGuiInputFlags_None = 00
ImGuiInputFlags_Repeat = 1 << 01 << 0Enable repeat. Return True on successive repeats. Default for legacy IsKeyPressed(). NOT Default for legacy IsMouseClicked(). MUST BE == 1.
ImGuiInputFlags_RouteActive = 1 << 101 << 10Route to active item only.
ImGuiInputFlags_RouteFocused = 1 << 111 << 11Route to windows in the focus stack (DEFAULT). Deep-most focused window takes inputs. Active item takes inputs over deep-most focused window.
ImGuiInputFlags_RouteGlobal = 1 << 121 << 12Global route (unless a focused window or active item registered the route).
ImGuiInputFlags_RouteAlways = 1 << 131 << 13Do not register route, poll keys directly.
ImGuiInputFlags_RouteOverFocused = 1 << 141 << 14Option: global route: higher priority than focused route (unless active item in focused route).
ImGuiInputFlags_RouteOverActive = 1 << 151 << 15Option: global route: higher priority than active item. Unlikely you need to use that: will interfere with every active items, e.g. Ctrl+A registered by InputText will be overridden by this. May not be fully honored as user/internal code is likely to always assume they can access keys when active.
ImGuiInputFlags_RouteUnlessBgFocused = 1 << 161 << 16Option: global route: will not be applied if underlying background/None is focused (== no Dear ImGui windows are focused). Useful for overlay applications.
ImGuiInputFlags_RouteFromRootWindow = 1 << 171 << 17Option: route evaluated from the point of view of root window rather than current window.
ImGuiInputFlags_Tooltip = 1 << 181 << 18Automatically display a tooltip when hovering item [BETA] Unsure of right api (opt-in/opt-out)

ImGuiConfigFlags_ (enum)

enum ImGuiConfigFlags_

The type of its values in the API: typedef int ImGuiConfigFlags;

Configuration flags stored in io.ConfigFlags. Set by user/application.
Note that nowadays most of our configuration options are in other ImGuiIO fields, e.g. io.ConfigWindowsMoveFromTitleBarOnly.

MemberValue
ImGuiConfigFlags_None = 00
ImGuiConfigFlags_NavEnableKeyboard = 1 << 01 << 0Master keyboard navigation enable flag. Enable full Tabbing + directional arrows + Space/Enter to activate. Note: some features such as basic Tabbing and CtrL+Tab are enabled by regardless of this flag (and may be disabled via other means, see #4828, #9218).
ImGuiConfigFlags_NavEnableGamepad = 1 << 11 << 1Master gamepad navigation enable flag. Backend also needs to set ImGuiBackendFlags_HasGamepad.
ImGuiConfigFlags_NoMouse = 1 << 41 << 4Instruct dear imgui to disable mouse inputs and interactions.
ImGuiConfigFlags_NoMouseCursorChange = 1 << 51 << 5Instruct backend to not alter mouse cursor shape and visibility. Use if the backend cursor changes are interfering with yours and you don’t want to use SetMouseCursor() to change mouse cursor. You may want to honor requests from imgui by reading GetMouseCursor() yourself instead.
ImGuiConfigFlags_NoKeyboard = 1 << 61 << 6Instruct dear imgui to disable keyboard inputs and interactions. This is done by ignoring keyboard events and clearing existing states.
ImGuiConfigFlags_DockingEnable = 1 << 71 << 7Docking enable flags.
ImGuiConfigFlags_ViewportsEnable = 1 << 101 << 10Viewport enable flags (require both ImGuiBackendFlags_PlatformHasViewports + ImGuiBackendFlags_RendererHasViewports set by the respective backends)
ImGuiConfigFlags_IsSRGB = 1 << 201 << 20Application is SRGB-aware.
ImGuiConfigFlags_IsTouchScreen = 1 << 211 << 21Application is using a touch screen instead of a mouse.

ImGuiBackendFlags_ (enum)

enum ImGuiBackendFlags_

See it live: Configuration › Backend Flags (also used in 4 other sections)

Configuration › Backend Flags
Code from the demo
ImGui::BeginDisabled();
ImGui::CheckboxFlags("io.BackendFlags: HasGamepad",             &io.BackendFlags, ImGuiBackendFlags_HasGamepad);

The type of its values in the API: typedef int ImGuiBackendFlags;

Backend capabilities flags stored in io.BackendFlags. Set by imgui_impl_xxx or custom backend.

MemberValue
ImGuiBackendFlags_None = 00
ImGuiBackendFlags_HasGamepad = 1 << 01 << 0Backend Platform supports gamepad and currently has one connected.
ImGuiBackendFlags_HasMouseCursors = 1 << 11 << 1Backend Platform supports honoring GetMouseCursor() value to change the OS cursor shape.
ImGuiBackendFlags_HasSetMousePos = 1 << 21 << 2Backend Platform supports io.WantSetMousePos requests to reposition the OS mouse position (only used if io.ConfigNavMoveSetMousePos is set).
ImGuiBackendFlags_RendererHasVtxOffset = 1 << 31 << 3Backend Renderer supports ImDrawCmd::VtxOffset. This enables output of large meshes (64K+ vertices) while still using 16-bit indices.
ImGuiBackendFlags_RendererHasTextures = 1 << 41 << 4Backend Renderer supports ImTextureData requests to create/update/destroy textures. This enables incremental texture updates and texture reloads. See docs/BACKENDS.md for instructions on how to upgrade your custom backend.
ImGuiBackendFlags_RendererHasViewports = 1 << 101 << 10Backend Renderer supports multiple viewports.
ImGuiBackendFlags_PlatformHasViewports = 1 << 111 << 11Backend Platform supports multiple viewports.
ImGuiBackendFlags_HasMouseHoveredViewport=1 << 121 << 12Backend Platform supports calling io.AddMouseViewportEvent() with the viewport under the mouse. IF POSSIBLE, ignore viewports with the ImGuiViewportFlags_NoInputs flag (Win32 backend, GLFW 3.30+ backend can do this, SDL backend cannot). If this cannot be done, Dear ImGui needs to use a flawed heuristic to find the viewport under.
ImGuiBackendFlags_HasParentViewport = 1 << 131 << 13Backend Platform supports honoring viewport->ParentViewport/ParentViewportId value, by applying the corresponding parent/child relationship at the Platform level. Child windows always appear in front of their parent window.

ImGuiCol_ (enum)

enum ImGuiCol_

The type of its values in the API: typedef int ImGuiCol;

Enumeration for PushStyleColor() / PopStyleColor()

MemberValue
ImGuiCol_Text0
ImGuiCol_TextDisabled1
ImGuiCol_WindowBg2Background of normal windows
ImGuiCol_ChildBg3Background of child windows
ImGuiCol_PopupBg4Background of popups, menus, tooltips windows
ImGuiCol_Border5
ImGuiCol_BorderShadow6
ImGuiCol_FrameBg7Background of checkbox, radio button, plot, slider, text input
ImGuiCol_FrameBgHovered8
ImGuiCol_FrameBgActive9
ImGuiCol_TitleBg10Title bar
ImGuiCol_TitleBgActive11Title bar when focused
ImGuiCol_TitleBgCollapsed12Title bar when collapsed
ImGuiCol_MenuBarBg13
ImGuiCol_ScrollbarBg14
ImGuiCol_ScrollbarGrab15
ImGuiCol_ScrollbarGrabHovered16
ImGuiCol_ScrollbarGrabActive17
ImGuiCol_CheckMark18Checkbox tick and RadioButton circle
ImGuiCol_CheckboxSelectedBg19Checkbox background when Selected, otherwise use FrameBg
ImGuiCol_SliderGrab20
ImGuiCol_SliderGrabActive21
ImGuiCol_Button22
ImGuiCol_ButtonHovered23
ImGuiCol_ButtonActive24
ImGuiCol_Header25Header* colors are used for CollapsingHeader, TreeNode, Selectable, MenuItem
ImGuiCol_HeaderHovered26
ImGuiCol_HeaderActive27
ImGuiCol_Separator28
ImGuiCol_SeparatorHovered29
ImGuiCol_SeparatorActive30
ImGuiCol_ResizeGrip31Resize grip in lower-right and lower-left corners of windows.
ImGuiCol_ResizeGripHovered32
ImGuiCol_ResizeGripActive33
ImGuiCol_InputTextCursor34InputText cursor/caret
ImGuiCol_TabHovered35Tab background, when hovered
ImGuiCol_Tab36Tab background, when tab-bar is focused & tab is unselected
ImGuiCol_TabSelected37Tab background, when tab-bar is focused & tab is selected
ImGuiCol_TabSelectedOverline38Tab horizontal overline, when tab-bar is focused & tab is selected
ImGuiCol_TabDimmed39Tab background, when tab-bar is unfocused & tab is unselected
ImGuiCol_TabDimmedSelected40Tab background, when tab-bar is unfocused & tab is selected
ImGuiCol_TabDimmedSelectedOverline41..horizontal overline, when tab-bar is unfocused & tab is selected
ImGuiCol_DockingPreview42Preview overlay color when about to docking something
ImGuiCol_DockingEmptyBg43Background color for empty node (e.g. CentralNode with no window docked into it)
ImGuiCol_PlotLines44
ImGuiCol_PlotLinesHovered45
ImGuiCol_PlotHistogram46
ImGuiCol_PlotHistogramHovered47
ImGuiCol_TableHeaderBg48Table header background
ImGuiCol_TableBorderStrong49Table outer and header borders (prefer using Alpha=1.0 here)
ImGuiCol_TableBorderLight50Table inner borders (prefer using Alpha=1.0 here)
ImGuiCol_TableRowBg51Table row background (even rows)
ImGuiCol_TableRowBgAlt52Table row background (odd rows)
ImGuiCol_TextLink53Hyperlink color
ImGuiCol_TextSelectedBg54Selected text inside an InputText
ImGuiCol_TreeLines55Tree node hierarchy outlines when using ImGuiTreeNodeFlags_DrawLines
ImGuiCol_DragDropTarget56Rectangle border highlighting a drop target
ImGuiCol_DragDropTargetBg57Rectangle background highlighting a drop target
ImGuiCol_UnsavedMarker58Unsaved Document marker (in window title and tabs)
ImGuiCol_NavCursor59Color of keyboard/gamepad navigation cursor/rectangle, when visible
ImGuiCol_NavWindowingHighlight60Highlight window when using Ctrl+Tab
ImGuiCol_NavWindowingDimBg61Darken/colorize entire screen behind the Ctrl+Tab window list, when active
ImGuiCol_ModalWindowDimBg62Darken/colorize entire screen behind a modal window, when one is active
ImGuiCol_COUNT63

ImGuiStyleVar_ (enum)

enum ImGuiStyleVar_

The type of its values in the API: typedef int ImGuiStyleVar;

Enumeration for PushStyleVar() / PopStyleVar() to temporarily modify the ImGuiStyle structure.

MemberValue
ImGuiStyleVar_Alpha0float Alpha
ImGuiStyleVar_DisabledAlpha1float DisabledAlpha
ImGuiStyleVar_WindowPadding2ImVec2 WindowPadding
ImGuiStyleVar_WindowRounding3float WindowRounding
ImGuiStyleVar_WindowBorderSize4float WindowBorderSize
ImGuiStyleVar_WindowMinSize5ImVec2 WindowMinSize
ImGuiStyleVar_WindowTitleAlign6ImVec2 WindowTitleAlign
ImGuiStyleVar_ChildRounding7float ChildRounding
ImGuiStyleVar_ChildBorderSize8float ChildBorderSize
ImGuiStyleVar_PopupRounding9float PopupRounding
ImGuiStyleVar_PopupBorderSize10float PopupBorderSize
ImGuiStyleVar_FramePadding11ImVec2 FramePadding
ImGuiStyleVar_FrameRounding12float FrameRounding
ImGuiStyleVar_FrameBorderSize13float FrameBorderSize
ImGuiStyleVar_ItemSpacing14ImVec2 ItemSpacing
ImGuiStyleVar_ItemInnerSpacing15ImVec2 ItemInnerSpacing
ImGuiStyleVar_IndentSpacing16float IndentSpacing
ImGuiStyleVar_CellPadding17ImVec2 CellPadding
ImGuiStyleVar_ScrollbarSize18float ScrollbarSize
ImGuiStyleVar_ScrollbarRounding19float ScrollbarRounding
ImGuiStyleVar_ScrollbarPadding20float ScrollbarPadding
ImGuiStyleVar_GrabMinSize21float GrabMinSize
ImGuiStyleVar_GrabRounding22float GrabRounding
ImGuiStyleVar_ImageRounding23float ImageRounding
ImGuiStyleVar_ImageBorderSize24float ImageBorderSize
ImGuiStyleVar_TabRounding25float TabRounding
ImGuiStyleVar_TabBorderSize26float TabBorderSize
ImGuiStyleVar_TabMinWidthBase27float TabMinWidthBase
ImGuiStyleVar_TabMinWidthShrink28float TabMinWidthShrink
ImGuiStyleVar_TabBarBorderSize29float TabBarBorderSize
ImGuiStyleVar_TabBarOverlineSize30float TabBarOverlineSize
ImGuiStyleVar_TableAngledHeadersAngle31float TableAngledHeadersAngle
ImGuiStyleVar_TableAngledHeadersTextAlign32ImVec2 TableAngledHeadersTextAlign
ImGuiStyleVar_TreeLinesSize33float TreeLinesSize
ImGuiStyleVar_TreeLinesRounding34float TreeLinesRounding
ImGuiStyleVar_MenuItemRounding35float MenuItemRounding
ImGuiStyleVar_SelectableRounding36float SelectableRounding
ImGuiStyleVar_DragDropTargetRounding37float DragDropTargetRounding
ImGuiStyleVar_ButtonTextAlign38ImVec2 ButtonTextAlign
ImGuiStyleVar_SelectableTextAlign39ImVec2 SelectableTextAlign
ImGuiStyleVar_SeparatorSize40float SeparatorSize
ImGuiStyleVar_SeparatorTextBorderSize41float SeparatorTextBorderSize
ImGuiStyleVar_SeparatorTextAlign42ImVec2 SeparatorTextAlign
ImGuiStyleVar_SeparatorTextPadding43ImVec2 SeparatorTextPadding
ImGuiStyleVar_DockingSeparatorSize44float DockingSeparatorSize
ImGuiStyleVar_LayoutAlign45float LayoutAlign
ImGuiStyleVar_COUNT46

ImGuiButtonFlags_ (enum)

enum ImGuiButtonFlags_

The type of its values in the API: typedef int ImGuiButtonFlags;

Flags for InvisibleButton() [extended in imgui_internal.h]

MemberValue
ImGuiButtonFlags_None = 00
ImGuiButtonFlags_MouseButtonLeft = 1 << 01 << 0React on left mouse button (default)
ImGuiButtonFlags_MouseButtonRight = 1 << 11 << 1React on right mouse button
ImGuiButtonFlags_MouseButtonMiddle = 1 << 21 << 2React on center mouse button
ImGuiButtonFlags_MouseButtonMask_ = ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_MouseButtonRight | ImGuiButtonFlags_MouseButtonMiddleButtonFlags_MouseButtonLeft | ButtonFlags_MouseButtonRight | ButtonFlags_MouseButtonMiddle[Internal]
ImGuiButtonFlags_EnableNav = 1 << 31 << 3InvisibleButton(): do not disable navigation/tabbing. Otherwise disabled by default.
ImGuiButtonFlags_AllowOverlap = 1 << 121 << 12Hit testing will allow subsequent widgets to overlap this one. Require previous frame HoveredId to match before being usable. Shortcut to calling SetNextItemAllowOverlap().

ImGuiColorEditFlags_ (enum)

enum ImGuiColorEditFlags_

The type of its values in the API: typedef int ImGuiColorEditFlags;

Flags for ColorEdit3() / ColorEdit4() / ColorPicker3() / ColorPicker4() / ColorButton()

MemberValue
ImGuiColorEditFlags_None = 00
ImGuiColorEditFlags_NoAlpha = 1 << 11 << 1// ColorEdit, ColorPicker, ColorButton: ignore Alpha component (will only read 3 components from the input pointer).
ImGuiColorEditFlags_NoPicker = 1 << 21 << 2// ColorEdit: disable picker when clicking on color square.
ImGuiColorEditFlags_NoOptions = 1 << 31 << 3// ColorEdit: disable toggling options menu when right-clicking on inputs/small preview.
ImGuiColorEditFlags_NoSmallPreview = 1 << 41 << 4// ColorEdit, ColorPicker: disable color square preview next to the inputs. (e.g. to show only the inputs)
ImGuiColorEditFlags_NoInputs = 1 << 51 << 5// ColorEdit, ColorPicker: disable inputs sliders/text widgets (e.g. to show only the small preview color square).
ImGuiColorEditFlags_NoTooltip = 1 << 61 << 6// ColorEdit, ColorPicker, ColorButton: disable tooltip when hovering the preview.
ImGuiColorEditFlags_NoLabel = 1 << 71 << 7// ColorEdit, ColorPicker: disable display of inline text label (the label is still forwarded to the tooltip and picker).
ImGuiColorEditFlags_NoSidePreview = 1 << 81 << 8// ColorPicker: disable bigger color preview on right side of the picker, use small color square preview instead.
ImGuiColorEditFlags_NoDragDrop = 1 << 91 << 9// ColorEdit: disable drag and drop target/source. ColorButton: disable drag and drop source.
ImGuiColorEditFlags_NoBorder = 1 << 101 << 10// ColorButton: disable border (which is enforced by default)
ImGuiColorEditFlags_NoColorMarkers = 1 << 111 << 11// ColorEdit: disable rendering R/G/B/A color marker. May also be disabled globally by setting style.ColorMarkerSize = 0.
ImGuiColorEditFlags_AlphaOpaque = 1 << 121 << 12// ColorEdit, ColorPicker, ColorButton: disable alpha in the preview,. Contrary to _NoAlpha it may still be edited when calling ColorEdit4()/ColorPicker4(). For ColorButton() this does the same as _NoAlpha.
ImGuiColorEditFlags_AlphaNoBg = 1 << 131 << 13// ColorEdit, ColorPicker, ColorButton: disable rendering a checkerboard background behind transparent color.
ImGuiColorEditFlags_AlphaPreviewHalf= 1 << 141 << 14// ColorEdit, ColorPicker, ColorButton: display half opaque / half transparent preview.
ImGuiColorEditFlags_AlphaBar = 1 << 181 << 18// ColorEdit, ColorPicker: show vertical alpha bar/gradient in picker.
ImGuiColorEditFlags_HDR = 1 << 191 << 19// (WIP) ColorEdit: Currently only disable 0.0..1.0 limits in RGBA edition (note: you probably want to use ImGuiColorEditFlags_Float flag as well).
ImGuiColorEditFlags_DisplayRGB = 1 << 201 << 20[Display] // ColorEdit: override display type among RGB/HSV/Hex. ColorPicker: select any combination using one or more of RGB/HSV/Hex.
ImGuiColorEditFlags_DisplayHSV = 1 << 211 << 21[Display] // "
ImGuiColorEditFlags_DisplayHex = 1 << 221 << 22[Display] // "
ImGuiColorEditFlags_Uint8 = 1 << 231 << 23[DataType] // ColorEdit, ColorPicker, ColorButton: display values formatted as 0..255.
ImGuiColorEditFlags_Float = 1 << 241 << 24[DataType] // ColorEdit, ColorPicker, ColorButton: display values formatted as 0.0..1.0 floats instead of 0..255 integers. No round-trip of value via integers.
ImGuiColorEditFlags_PickerHueBar = 1 << 251 << 25[Picker] // ColorPicker: bar for Hue, rectangle for Sat/Value.
ImGuiColorEditFlags_PickerHueWheel = 1 << 261 << 26[Picker] // ColorPicker: wheel for Hue, triangle for Sat/Value.
ImGuiColorEditFlags_PickerNoRotate = 1 << 271 << 27[Picker] // ColorPicker: disable rotating Sat/Value triangle. Best set in io.ConfigColorEditFlags once.
ImGuiColorEditFlags_InputRGB = 1 << 281 << 28[Input] // ColorEdit, ColorPicker: input and output data in RGB format.
ImGuiColorEditFlags_InputHSV = 1 << 291 << 29[Input] // ColorEdit, ColorPicker: input and output data in HSV format.
ImGuiColorEditFlags_DefaultOptions_ = ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_PickerHueBar, Defaults Options copied to io.ConfigColorEditFlags during initialization. The intent is that you probably don't want to override them in most of your calls. Let the user choose via the option menu and/or modify io.ConfigColorEditFlags directly during startup if you want.ColorEditFlags_Uint8 | ColorEditFlags_DisplayRGB | ColorEditFlags_InputRGB | ColorEditFlags_PickerHueBar
ImGuiColorEditFlags_AlphaMask_ = ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaOpaque | ImGuiColorEditFlags_AlphaNoBg | ImGuiColorEditFlags_AlphaPreviewHalfColorEditFlags_NoAlpha | ColorEditFlags_AlphaOpaque | ColorEditFlags_AlphaNoBg | ColorEditFlags_AlphaPreviewHalf
ImGuiColorEditFlags_DisplayMask_ = ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_DisplayHexColorEditFlags_DisplayRGB | ColorEditFlags_DisplayHSV | ColorEditFlags_DisplayHex
ImGuiColorEditFlags_DataTypeMask_ = ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_FloatColorEditFlags_Uint8 | ColorEditFlags_Float
ImGuiColorEditFlags_PickerMask_ = ImGuiColorEditFlags_PickerHueWheel | ImGuiColorEditFlags_PickerHueBarColorEditFlags_PickerHueWheel | ColorEditFlags_PickerHueBar
ImGuiColorEditFlags_InputMask_ = ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_InputHSVColorEditFlags_InputRGB | ColorEditFlags_InputHSV

ImGuiSliderFlags_ (enum)

enum ImGuiSliderFlags_

See it live: Widgets › Drag and Slider Flags (also used in 11 other sections)

Widgets › Drag and Slider Flags
Code from the demo
static ImGuiSliderFlags flags = ImGuiSliderFlags_None;

The type of its values in the API: typedef int ImGuiSliderFlags;

Flags for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc.
We use the same sets of flags for DragXXX() and SliderXXX() functions as the features are the same and it makes it easier to swap them. (Those are per-item flags. There is shared behavior flag too: ImGuiIO: io.ConfigDragClickToInputText)

MemberValue
ImGuiSliderFlags_None = 00
ImGuiSliderFlags_Logarithmic = 1 << 51 << 5Make the widget logarithmic (linear otherwise). Consider using ImGuiSliderFlags_NoRoundToFormat with this if using a format-string with small amount of digits.
ImGuiSliderFlags_NoRoundToFormat = 1 << 61 << 6Disable rounding underlying value to match precision of the display format string (e.g. %.3 values are rounded to those 3 digits).
ImGuiSliderFlags_NoInput = 1 << 71 << 7Disable Ctrl+Click or Enter key allowing to input text directly into the widget.
ImGuiSliderFlags_WrapAround = 1 << 81 << 8Enable wrapping around from max to min and from min to max. Only supported by DragXXX() functions for now.
ImGuiSliderFlags_ClampOnInput = 1 << 91 << 9Clamp value to min/max bounds when input manually with Ctrl+Click. By default Ctrl+Click allows going out of bounds.
ImGuiSliderFlags_ClampZeroRange = 1 << 101 << 10Clamp even if min==max==0.0. Otherwise due to legacy reason DragXXX functions don’t clamp with those values. When your clamping limits are dynamic you almost always want to use it.
ImGuiSliderFlags_NoSpeedTweaks = 1 << 111 << 11Disable keyboard modifiers altering tweak speed. Useful if you want to alter tweak speed yourself based on your own logic.
ImGuiSliderFlags_ColorMarkers = 1 << 121 << 12DragScalarN(), SliderScalarN(): Draw R/G/B/A color markers on each component.
ImGuiSliderFlags_AlwaysClamp = ImGuiSliderFlags_ClampOnInput | ImGuiSliderFlags_ClampZeroRangeSliderFlags_ClampOnInput | SliderFlags_ClampZeroRange
ImGuiSliderFlags_InvalidMask_ = 0x7000000F0x7000000F[Internal] We treat using those bits as being potentially a ‘float power’ argument from legacy API (obsoleted 2020-08) that has got miscast to this enum, and will trigger an assert if needed.

ImGuiMouseButton_ (enum)

enum ImGuiMouseButton_

The type of its values in the API: typedef int ImGuiMouseButton;

Identify a mouse button.
Those values are guaranteed to be stable and we frequently use 0/1 directly. Named enums provided for convenience.

MemberValue
ImGuiMouseButton_Left = 00
ImGuiMouseButton_Right = 11
ImGuiMouseButton_Middle = 22
ImGuiMouseButton_COUNT = 55

ImGuiMouseCursor_ (enum)

enum ImGuiMouseCursor_

See it live: Inputs & Focus › Mouse Cursors (also used in 1 other section)

Inputs & Focus › Mouse Cursors
Code from the demo
const char* mouse_cursors_names[] = { "Arrow", "TextInput", "ResizeAll", "ResizeNS", "ResizeEW", "ResizeNESW", "ResizeNWSE", "Hand", "Wait", "Progress", "NotAllowed" };
IM_ASSERT(IM_COUNTOF(mouse_cursors_names) == ImGuiMouseCursor_COUNT);

The type of its values in the API: typedef int ImGuiMouseCursor;

Enumeration for GetMouseCursor()
User code may request backend to display given cursor by calling SetMouseCursor(), which is why we have some cursors that are marked unused here

MemberValue
ImGuiMouseCursor_None = -1-1
ImGuiMouseCursor_Arrow = 00
ImGuiMouseCursor_TextInput1When hovering over InputText, etc.
ImGuiMouseCursor_ResizeAll2(Unused by Dear ImGui functions)
ImGuiMouseCursor_ResizeNS3When hovering over a horizontal border
ImGuiMouseCursor_ResizeEW4When hovering over a vertical border or a column
ImGuiMouseCursor_ResizeNESW5When hovering over the bottom-left corner of a window
ImGuiMouseCursor_ResizeNWSE6When hovering over the bottom-right corner of a window
ImGuiMouseCursor_Hand7(Unused by Dear ImGui functions. Use for e.g. hyperlinks)
ImGuiMouseCursor_Wait8When waiting for something to process/load.
ImGuiMouseCursor_Progress9When waiting for something to process/load, but application is still interactive.
ImGuiMouseCursor_NotAllowed10When hovering something with disallowed interaction. Usually a crossed circle.
ImGuiMouseCursor_COUNT11

ImGuiMouseSource (enum)

enum ImGuiMouseSource

Enumeration for AddMouseSourceEvent() actual source of Mouse Input data.
Historically we use “Mouse” terminology everywhere to indicate pointer data, e.g. MousePos, IsMousePressed(), io.AddMousePosEvent()
But that “Mouse” data can come from different source which occasionally may be useful for application to know about.
You can submit a change of pointer type using io.AddMouseSourceEvent().

MemberValue
ImGuiMouseSource_Mouse = 00Input is coming from an actual mouse.
ImGuiMouseSource_TouchScreen1Input is coming from a touch screen (no hovering prior to initial press, less precise initial press aiming, dual-axis wheeling possible).
ImGuiMouseSource_Pen2Input is coming from a pressure/magnetic pen (often used in conjunction with high-sampling rates).
ImGuiMouseSource_COUNT3

ImGuiCond_ (enum)

enum ImGuiCond_

The type of its values in the API: typedef int ImGuiCond;

Enumeration for ImGui::SetNextWindow***(), SetWindow***(), SetNextItem***() functions
Represent a condition.
Important: Treat as a regular enum! Do NOT combine multiple values using binary operators! All the functions above treat 0 as a shortcut to ImGuiCond_Always.

MemberValue
ImGuiCond_None = 00No condition (always set the variable), same as _Always
ImGuiCond_Always = 1 << 01 << 0No condition (always set the variable), same as _None
ImGuiCond_Once = 1 << 11 << 1Set the variable once per runtime session (only the first call will succeed)
ImGuiCond_FirstUseEver = 1 << 21 << 2Set the variable if the object/window has no persistently saved data (no entry in .ini file)
ImGuiCond_Appearing = 1 << 31 << 3Set the variable if the object/window is appearing after being hidden/inactive (or the first time)

Tables API flags and structures

ImGuiTableFlags_ (enum)

enum ImGuiTableFlags_

See it live: Tables › Columns flags (also used in 29 other sections)

Tables › Columns flags
Code from the demo
if (ImGui::BeginTable("table_columns_flags_checkboxes", column_count, ImGuiTableFlags_None))
{
    PushStyleCompact();
    for (int column = 0; column < column_count; column++)
    {
        ImGui::TableNextColumn();
        ImGui::PushID(column);
        ImGui::AlignTextToFramePadding(); // FIXME-TABLE: Workaround for wrong text baseline propagation across columns
        ImGui::Text("'%s'", column_names[column]);
        ImGui::Spacing();
        ImGui::Text("Input flags:");
        EditTableColumnsFlags(&column_flags[column]);
        ImGui::Spacing();
        ImGui::Text("Output flags:");
...

The type of its values in the API: typedef int ImGuiTableFlags;

Flags for ImGui::BeginTable()

MemberValue
ImGuiTableFlags_None = 00
ImGuiTableFlags_Resizable = 1 << 01 << 0Enable resizing columns.
ImGuiTableFlags_Reorderable = 1 << 11 << 1Enable reordering columns in header row. (Need calling TableSetupColumn() + TableHeadersRow() to display headers, or using ImGuiTableFlags_ContextMenuInBody to access context-menu without headers).
ImGuiTableFlags_Hideable = 1 << 21 << 2Enable hiding/disabling columns in context menu.
ImGuiTableFlags_Sortable = 1 << 31 << 3Enable sorting. Call TableGetSortSpecs() to obtain sort specs. Also see ImGuiTableFlags_SortMulti and ImGuiTableFlags_SortTristate.
ImGuiTableFlags_NoSavedSettings = 1 << 41 << 4Disable persisting columns order, width, visibility and sort settings in the .ini file.
ImGuiTableFlags_ContextMenuInBody = 1 << 51 << 5Right-click on columns body/contents will also display table context menu. By default it is available in TableHeadersRow().
ImGuiTableFlags_RowBg = 1 << 61 << 6Set each RowBg color with ImGuiCol_TableRowBg or ImGuiCol_TableRowBgAlt (equivalent of calling TableSetBgColor with ImGuiTableBgFlags_RowBg0 on each row manually)
ImGuiTableFlags_BordersInnerH = 1 << 71 << 7Draw horizontal borders between rows.
ImGuiTableFlags_BordersOuterH = 1 << 81 << 8Draw horizontal borders at the top and bottom.
ImGuiTableFlags_BordersInnerV = 1 << 91 << 9Draw vertical borders between columns.
ImGuiTableFlags_BordersOuterV = 1 << 101 << 10Draw vertical borders on the left and right sides.
ImGuiTableFlags_BordersH = ImGuiTableFlags_BordersInnerH | ImGuiTableFlags_BordersOuterHTableFlags_BordersInnerH | TableFlags_BordersOuterHDraw horizontal borders.
ImGuiTableFlags_BordersV = ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_BordersOuterVTableFlags_BordersInnerV | TableFlags_BordersOuterVDraw vertical borders.
ImGuiTableFlags_BordersInner = ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_BordersInnerHTableFlags_BordersInnerV | TableFlags_BordersInnerHDraw inner borders.
ImGuiTableFlags_BordersOuter = ImGuiTableFlags_BordersOuterV | ImGuiTableFlags_BordersOuterHTableFlags_BordersOuterV | TableFlags_BordersOuterHDraw outer borders.
ImGuiTableFlags_Borders = ImGuiTableFlags_BordersInner | ImGuiTableFlags_BordersOuterTableFlags_BordersInner | TableFlags_BordersOuterDraw all borders.
ImGuiTableFlags_NoBordersInBody = 1 << 111 << 11[ALPHA] Disable vertical borders in columns Body (borders will always appear in Headers). -> May move to style
ImGuiTableFlags_NoBordersInBodyUntilResize = 1 << 121 << 12[ALPHA] Disable vertical borders in columns Body until hovered for resize (borders will always appear in Headers). -> May move to style
ImGuiTableFlags_SizingFixedFit = 1 << 131 << 13Columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching contents width.
ImGuiTableFlags_SizingFixedSame = 2 << 132 << 13Columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching the maximum contents width of all columns. Implicitly enable ImGuiTableFlags_NoKeepColumnsVisible.
ImGuiTableFlags_SizingStretchProp = 3 << 133 << 13Columns default to _WidthStretch with default weights proportional to each columns contents widths.
ImGuiTableFlags_SizingStretchSame = 4 << 134 << 13Columns default to _WidthStretch with default weights all equal, unless overridden by TableSetupColumn().
ImGuiTableFlags_NoHostExtendX = 1 << 161 << 16Make outer width auto-fit to columns, overriding outer_size.x value. Only available when ScrollX/ScrollY are disabled and Stretch columns are not used.
ImGuiTableFlags_NoHostExtendY = 1 << 171 << 17Make outer height stop exactly at outer_size.y (prevent auto-extending table past the limit). Only available when ScrollX/ScrollY are disabled. Data below the limit will be clipped and not visible.
ImGuiTableFlags_NoKeepColumnsVisible = 1 << 181 << 18Disable keeping column always minimally visible when ScrollX is off and table gets too small. Not recommended if columns are resizable.
ImGuiTableFlags_PreciseWidths = 1 << 191 << 19Disable distributing remainder width to stretched columns (width allocation on a 100-wide table with 3 columns: Without this flag: 33,33,34. With this flag: 33,33,33). With larger number of columns, resizing will appear to be less smooth.
ImGuiTableFlags_NoClip = 1 << 201 << 20Disable clipping rectangle for every individual columns (reduce draw command count, items will be able to overflow into other columns). Generally incompatible with TableSetupScrollFreeze().
ImGuiTableFlags_PadOuterX = 1 << 211 << 21Default if BordersOuterV is on. Enable outermost padding. Generally desirable if you have headers.
ImGuiTableFlags_NoPadOuterX = 1 << 221 << 22Default if BordersOuterV is off. Disable outermost padding.
ImGuiTableFlags_NoPadInnerX = 1 << 231 << 23Disable inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off).
ImGuiTableFlags_ScrollX = 1 << 241 << 24Enable horizontal scrolling. Require ‘outer_size’ parameter of BeginTable() to specify the container size. Changes default sizing policy. Because this creates a child window, ScrollY is currently generally recommended when using ScrollX.
ImGuiTableFlags_ScrollY = 1 << 251 << 25Enable vertical scrolling. Require ‘outer_size’ parameter of BeginTable() to specify the container size.
ImGuiTableFlags_SortMulti = 1 << 261 << 26Hold shift when clicking headers to sort on multiple column. TableGetSortSpecs() may return specs where (SpecsCount > 1).
ImGuiTableFlags_SortTristate = 1 << 271 << 27Allow no sorting, disable default sorting. TableGetSortSpecs() may return specs where (SpecsCount == 0).
ImGuiTableFlags_HighlightHoveredColumn = 1 << 281 << 28Highlight column headers when hovered (may evolve into a fuller highlight)
ImGuiTableFlags_SizingMask_ = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_SizingFixedSame | ImGuiTableFlags_SizingStretchProp | ImGuiTableFlags_SizingStretchSame, } [Internal] Combinations and masksTableFlags_SizingFixedFit | TableFlags_SizingFixedSame | TableFlags_SizingStretchProp | TableFlags_SizingStretchSame

ImGuiTableColumnFlags_ (enum)

enum ImGuiTableColumnFlags_

See it live: Tables › Columns flags (also used in 11 other sections)

Tables › Columns flags
Code from the demo
const int column_count = 3;
const char* column_names[column_count] = { "One", "Two", "Three" };
static ImGuiTableColumnFlags column_flags[column_count] = { ImGuiTableColumnFlags_DefaultSort, ImGuiTableColumnFlags_None, ImGuiTableColumnFlags_DefaultHide };

The type of its values in the API: typedef int ImGuiTableColumnFlags;

Flags for ImGui::TableSetupColumn()

MemberValue
ImGuiTableColumnFlags_None = 00
ImGuiTableColumnFlags_Disabled = 1 << 01 << 0Overriding/master disable flag: hide column, won’t show in context menu (unlike calling TableSetColumnEnabled() which manipulates the user accessible state)
ImGuiTableColumnFlags_DefaultHide = 1 << 11 << 1Default as a hidden/disabled column.
ImGuiTableColumnFlags_DefaultSort = 1 << 21 << 2Default as a sorting column.
ImGuiTableColumnFlags_WidthStretch = 1 << 31 << 3Column will stretch. Preferable with horizontal scrolling disabled (default if table sizing policy is _SizingStretchSame or _SizingStretchProp).
ImGuiTableColumnFlags_WidthFixed = 1 << 41 << 4Column will not stretch. Preferable with horizontal scrolling enabled (default if table sizing policy is _SizingFixedFit and table is resizable).
ImGuiTableColumnFlags_NoResize = 1 << 51 << 5Disable manual resizing.
ImGuiTableColumnFlags_NoReorder = 1 << 61 << 6Disable manual reordering this column, this will also prevent other columns from crossing over this column.
ImGuiTableColumnFlags_NoHide = 1 << 71 << 7Disable ability to hide/disable this column.
ImGuiTableColumnFlags_NoClip = 1 << 81 << 8Disable clipping for this column (all NoClip columns will render in a same draw command).
ImGuiTableColumnFlags_NoSort = 1 << 91 << 9Disable ability to sort on this field (even if ImGuiTableFlags_Sortable is set on the table).
ImGuiTableColumnFlags_NoSortAscending = 1 << 101 << 10Disable ability to sort in the ascending direction.
ImGuiTableColumnFlags_NoSortDescending = 1 << 111 << 11Disable ability to sort in the descending direction.
ImGuiTableColumnFlags_NoHeaderLabel = 1 << 121 << 12TableHeadersRow() will submit an empty label for this column. Convenient for some small columns. Name will still appear in context menu or in angled headers. You may append into this cell by calling TableSetColumnIndex() right after the TableHeadersRow() call.
ImGuiTableColumnFlags_NoHeaderWidth = 1 << 131 << 13Disable header text width contribution to automatic column width.
ImGuiTableColumnFlags_PreferSortAscending = 1 << 141 << 14Make the initial sort direction Ascending when first sorting on this column (default).
ImGuiTableColumnFlags_PreferSortDescending = 1 << 151 << 15Make the initial sort direction Descending when first sorting on this column.
ImGuiTableColumnFlags_IndentEnable = 1 << 161 << 16Use current Indent value when entering cell (default for column 0).
ImGuiTableColumnFlags_IndentDisable = 1 << 171 << 17Ignore current Indent value when entering cell (default for columns > 0). Indentation changes within the cell will still be honored.
ImGuiTableColumnFlags_AngledHeader = 1 << 181 << 18TableHeadersRow() will submit an angled header row for this column. Note this will add an extra row.
ImGuiTableColumnFlags_IsEnabled = 1 << 241 << 24Status: is enabled == not hidden by user/api (referred to as “Hide” in _DefaultHide and _NoHide) flags.
ImGuiTableColumnFlags_IsVisible = 1 << 251 << 25Status: is visible == is enabled AND not clipped by scrolling.
ImGuiTableColumnFlags_IsSorted = 1 << 261 << 26Status: is currently part of the sort specs
ImGuiTableColumnFlags_IsHovered = 1 << 271 << 27Status: is hovered by mouse
ImGuiTableColumnFlags_WidthMask_ = ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_WidthFixedTableColumnFlags_WidthStretch | TableColumnFlags_WidthFixed
ImGuiTableColumnFlags_IndentMask_ = ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_IndentDisableTableColumnFlags_IndentEnable | TableColumnFlags_IndentDisable
ImGuiTableColumnFlags_StatusMask_ = ImGuiTableColumnFlags_IsEnabled | ImGuiTableColumnFlags_IsVisible | ImGuiTableColumnFlags_IsSorted | ImGuiTableColumnFlags_IsHoveredTableColumnFlags_IsEnabled | TableColumnFlags_IsVisible | TableColumnFlags_IsSorted | TableColumnFlags_IsHovered
ImGuiTableColumnFlags_NoDirectResize_ = 1 << 301 << 30[Internal] Disable user resizing this column directly (it may however we resized indirectly from its left edge)

ImGuiTableRowFlags_ (enum)

enum ImGuiTableRowFlags_

The type of its values in the API: typedef int ImGuiTableRowFlags;

Flags for ImGui::TableNextRow()

MemberValue
ImGuiTableRowFlags_None = 00
ImGuiTableRowFlags_Headers = 1 << 01 << 0Identify header row (set default background color + width of its contents accounted differently for auto column width)

ImGuiTableBgTarget_ (enum)

enum ImGuiTableBgTarget_

The type of its values in the API: typedef int ImGuiTableBgTarget;

Enum for ImGui::TableSetBgColor()
Background colors are rendering in 3 layers:

MemberValue
ImGuiTableBgTarget_None = 00
ImGuiTableBgTarget_RowBg0 = 11Set row background color 0 (generally used for background, automatically set when ImGuiTableFlags_RowBg is used)
ImGuiTableBgTarget_RowBg1 = 22Set row background color 1 (generally used for selection marking)
ImGuiTableBgTarget_CellBg = 33Set cell background color (top-most color)

ImGuiTableSortSpecs (struct)

struct ImGuiTableSortSpecs

Sorting specifications for a table (often handling sort specs for a single column, occasionally more)
Obtained by calling TableGetSortSpecs().
When ‘SpecsDirty == True’ you can sort your data. It will be True with sorting specs have changed since last call, or the first time.
Make sure to set ‘SpecsDirty = False’ after sorting, else you may wastefully sort your data every frame!

Member
const ImGuiTableColumnSortSpecs* Specs;Pointer to sort spec array. # (const)
int SpecsCount;Sort spec count. Most often 1. May be > 1 when ImGuiTableFlags_SortMulti is enabled. May be == 0 when ImGuiTableFlags_SortTristate is enabled.
bool SpecsDirty;Set to True when specs have changed since last time! Use this to sort again, then clear the flag.
ImGuiTableSortSpecs::ImGuiTableSortSpecs
ImGuiTableSortSpecs();

ImGuiTableColumnSortSpecs (struct)

struct ImGuiTableColumnSortSpecs

Sorting specification for one column of a table (sizeof == 12 bytes)

Member
ImGuiID ColumnUserID;User data for the column (if specified by a TableSetupColumn() call in the ‘ImGuiID user_data’ field). FIXME: Should be called ‘UserData’..
ImS16 ColumnIndex;Index of the column
ImS16 SortOrder;Index within parent ImGuiTableSortSpecs (always stored in order starting from 0, tables sorted on a single criteria will always have a 0 here)
ImGuiSortDirection SortDirection;ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending
ImGuiTableColumnSortSpecs::ImGuiTableColumnSortSpecs
ImGuiTableColumnSortSpecs();

Helpers: Debug log, memory allocations macros, ImVector<>

ImNewWrapper (struct)

struct ImNewWrapper

ImVector<>

Lightweight std::vector<>-like class to avoid dragging dependencies (also, some implementations of STL with debug enabled are absurdly slow, we bypass it so our code runs fast in debug).

ImVector<int> (struct)

struct ImVector<int>
ImVector<int>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<int>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<int>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<int>::empty
inline bool empty() const;

(private API)

ImVector<int>::size
inline int size() const;

(private API)

ImVector<int>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<int>::pop_back
inline void pop_back();

(private API)

ImVector<int>::push_front
inline void push_front(const T& v);

(private API)

ImVector<uint> (struct)

struct ImVector<uint>
ImVector<uint>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<uint>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<uint>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<uint>::empty
inline bool empty() const;

(private API)

ImVector<uint>::size
inline int size() const;

(private API)

ImVector<uint>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<uint>::pop_back
inline void pop_back();

(private API)

ImVector<uint>::push_front
inline void push_front(const T& v);

(private API)

ImVector<float> (struct)

struct ImVector<float>
ImVector<float>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<float>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<float>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<float>::empty
inline bool empty() const;

(private API)

ImVector<float>::size
inline int size() const;

(private API)

ImVector<float>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<float>::pop_back
inline void pop_back();

(private API)

ImVector<float>::push_front
inline void push_front(const T& v);

(private API)

ImVector<char> (struct)

struct ImVector<char>
ImVector<char>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<char>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<char>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<char>::empty
inline bool empty() const;

(private API)

ImVector<char>::size
inline int size() const;

(private API)

ImVector<char>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<char>::pop_back
inline void pop_back();

(private API)

ImVector<char>::push_front
inline void push_front(const T& v);

(private API)

ImVector<uchar> (struct)

struct ImVector<uchar>
ImVector<uchar>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<uchar>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<uchar>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<uchar>::empty
inline bool empty() const;

(private API)

ImVector<uchar>::size
inline int size() const;

(private API)

ImVector<uchar>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<uchar>::pop_back
inline void pop_back();

(private API)

ImVector<uchar>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImDrawCmd> (struct)

struct ImVector<ImDrawCmd>
ImVector<ImDrawCmd>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImDrawCmd>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImDrawCmd>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImDrawCmd>::empty
inline bool empty() const;

(private API)

ImVector<ImDrawCmd>::size
inline int size() const;

(private API)

ImVector<ImDrawCmd>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImDrawCmd>::pop_back
inline void pop_back();

(private API)

ImVector<ImDrawCmd>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImDrawChannel> (struct)

struct ImVector<ImDrawChannel>
ImVector<ImDrawChannel>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImDrawChannel>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImDrawChannel>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImDrawChannel>::empty
inline bool empty() const;

(private API)

ImVector<ImDrawChannel>::size
inline int size() const;

(private API)

ImVector<ImDrawChannel>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImDrawChannel>::pop_back
inline void pop_back();

(private API)

ImVector<ImDrawChannel>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImDrawVert> (struct)

struct ImVector<ImDrawVert>
ImVector<ImDrawVert>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImDrawVert>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImDrawVert>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImDrawVert>::empty
inline bool empty() const;

(private API)

ImVector<ImDrawVert>::size
inline int size() const;

(private API)

ImVector<ImDrawVert>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImDrawVert>::pop_back
inline void pop_back();

(private API)

ImVector<ImDrawVert>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImVec4> (struct)

struct ImVector<ImVec4>
ImVector<ImVec4>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImVec4>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImVec4>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImVec4>::empty
inline bool empty() const;

(private API)

ImVector<ImVec4>::size
inline int size() const;

(private API)

ImVector<ImVec4>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImVec4>::pop_back
inline void pop_back();

(private API)

ImVector<ImVec4>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImVec2> (struct)

struct ImVector<ImVec2>
ImVector<ImVec2>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImVec2>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImVec2>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImVec2>::empty
inline bool empty() const;

(private API)

ImVector<ImVec2>::size
inline int size() const;

(private API)

ImVector<ImVec2>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImVec2>::pop_back
inline void pop_back();

(private API)

ImVector<ImVec2>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImDrawList *> (struct)

struct ImVector<ImDrawList *>
ImVector<ImDrawList *>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImDrawList *>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImDrawList *>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImDrawList *>::empty
inline bool empty() const;

(private API)

ImVector<ImDrawList *>::size
inline int size() const;

(private API)

ImVector<ImDrawList *>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImDrawList *>::pop_back
inline void pop_back();

(private API)

ImVector<ImDrawList *>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImFont *> (struct)

struct ImVector<ImFont *>
ImVector<ImFont *>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImFont *>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImFont *>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImFont *>::empty
inline bool empty() const;

(private API)

ImVector<ImFont *>::size
inline int size() const;

(private API)

ImVector<ImFont *>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImFont *>::pop_back
inline void pop_back();

(private API)

ImVector<ImFont *>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImFontAtlas *> (struct)

struct ImVector<ImFontAtlas *>
ImVector<ImFontAtlas *>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImFontAtlas *>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImFontAtlas *>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImFontAtlas *>::empty
inline bool empty() const;

(private API)

ImVector<ImFontAtlas *>::size
inline int size() const;

(private API)

ImVector<ImFontAtlas *>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImFontAtlas *>::pop_back
inline void pop_back();

(private API)

ImVector<ImFontAtlas *>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImFontGlyph> (struct)

struct ImVector<ImFontGlyph>
ImVector<ImFontGlyph>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImFontGlyph>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImFontGlyph>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImFontGlyph>::empty
inline bool empty() const;

(private API)

ImVector<ImFontGlyph>::size
inline int size() const;

(private API)

ImVector<ImFontGlyph>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImFontGlyph>::pop_back
inline void pop_back();

(private API)

ImVector<ImFontGlyph>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiPlatformMonitor> (struct)

struct ImVector<ImGuiPlatformMonitor>
ImVector<ImGuiPlatformMonitor>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiPlatformMonitor>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiPlatformMonitor>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiPlatformMonitor>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiPlatformMonitor>::size
inline int size() const;

(private API)

ImVector<ImGuiPlatformMonitor>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiPlatformMonitor>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiPlatformMonitor>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiViewport *> (struct)

struct ImVector<ImGuiViewport *>
ImVector<ImGuiViewport *>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiViewport *>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiViewport *>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiViewport *>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiViewport *>::size
inline int size() const;

(private API)

ImVector<ImGuiViewport *>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiViewport *>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiViewport *>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiWindow *> (struct)

struct ImVector<ImGuiWindow *>
ImVector<ImGuiWindow *>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiWindow *>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiWindow *>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiWindow *>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiWindow *>::size
inline int size() const;

(private API)

ImVector<ImGuiWindow *>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiWindow *>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiWindow *>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImFontConfig> (struct)

struct ImVector<ImFontConfig>
ImVector<ImFontConfig>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImFontConfig>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImFontConfig>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImFontConfig>::empty
inline bool empty() const;

(private API)

ImVector<ImFontConfig>::size
inline int size() const;

(private API)

ImVector<ImFontConfig>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImFontConfig>::pop_back
inline void pop_back();

(private API)

ImVector<ImFontConfig>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImFontConfig *> (struct)

struct ImVector<ImFontConfig *>
ImVector<ImFontConfig *>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImFontConfig *>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImFontConfig *>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImFontConfig *>::empty
inline bool empty() const;

(private API)

ImVector<ImFontConfig *>::size
inline int size() const;

(private API)

ImVector<ImFontConfig *>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImFontConfig *>::pop_back
inline void pop_back();

(private API)

ImVector<ImFontConfig *>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiFocusScopeData> (struct)

struct ImVector<ImGuiFocusScopeData>
ImVector<ImGuiFocusScopeData>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiFocusScopeData>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiFocusScopeData>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiFocusScopeData>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiFocusScopeData>::size
inline int size() const;

(private API)

ImVector<ImGuiFocusScopeData>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiFocusScopeData>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiFocusScopeData>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiSelectionRequest> (struct)

struct ImVector<ImGuiSelectionRequest>
ImVector<ImGuiSelectionRequest>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiSelectionRequest>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiSelectionRequest>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiSelectionRequest>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiSelectionRequest>::size
inline int size() const;

(private API)

ImVector<ImGuiSelectionRequest>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiSelectionRequest>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiSelectionRequest>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImRect> (struct)

struct ImVector<ImRect>
ImVector<ImRect>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImRect>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImRect>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImRect>::empty
inline bool empty() const;

(private API)

ImVector<ImRect>::size
inline int size() const;

(private API)

ImVector<ImRect>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImRect>::pop_back
inline void pop_back();

(private API)

ImVector<ImRect>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiColorMod> (struct)

struct ImVector<ImGuiColorMod>
ImVector<ImGuiColorMod>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiColorMod>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiColorMod>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiColorMod>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiColorMod>::size
inline int size() const;

(private API)

ImVector<ImGuiColorMod>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiColorMod>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiColorMod>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiGroupData> (struct)

struct ImVector<ImGuiGroupData>
ImVector<ImGuiGroupData>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiGroupData>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiGroupData>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiGroupData>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiGroupData>::size
inline int size() const;

(private API)

ImVector<ImGuiGroupData>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiGroupData>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiGroupData>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiPopupData> (struct)

struct ImVector<ImGuiPopupData>
ImVector<ImGuiPopupData>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiPopupData>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiPopupData>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiPopupData>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiPopupData>::size
inline int size() const;

(private API)

ImVector<ImGuiPopupData>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiPopupData>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiPopupData>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiViewportP *> (struct)

struct ImVector<ImGuiViewportP *>
ImVector<ImGuiViewportP *>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiViewportP *>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiViewportP *>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiViewportP *>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiViewportP *>::size
inline int size() const;

(private API)

ImVector<ImGuiViewportP *>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiViewportP *>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiViewportP *>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiInputEvent> (struct)

struct ImVector<ImGuiInputEvent>
ImVector<ImGuiInputEvent>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiInputEvent>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiInputEvent>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiInputEvent>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiInputEvent>::size
inline int size() const;

(private API)

ImVector<ImGuiInputEvent>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiInputEvent>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiInputEvent>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiWindowStackData> (struct)

struct ImVector<ImGuiWindowStackData>
ImVector<ImGuiWindowStackData>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiWindowStackData>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiWindowStackData>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiWindowStackData>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiWindowStackData>::size
inline int size() const;

(private API)

ImVector<ImGuiWindowStackData>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiWindowStackData>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiWindowStackData>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiTableColumnSortSpecs> (struct)

struct ImVector<ImGuiTableColumnSortSpecs>
ImVector<ImGuiTableColumnSortSpecs>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiTableColumnSortSpecs>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiTableColumnSortSpecs>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiTableColumnSortSpecs>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiTableColumnSortSpecs>::size
inline int size() const;

(private API)

ImVector<ImGuiTableColumnSortSpecs>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiTableColumnSortSpecs>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiTableColumnSortSpecs>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiTableInstanceData> (struct)

struct ImVector<ImGuiTableInstanceData>
ImVector<ImGuiTableInstanceData>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiTableInstanceData>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiTableInstanceData>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiTableInstanceData>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiTableInstanceData>::size
inline int size() const;

(private API)

ImVector<ImGuiTableInstanceData>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiTableInstanceData>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiTableInstanceData>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiTableTempData> (struct)

struct ImVector<ImGuiTableTempData>
ImVector<ImGuiTableTempData>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiTableTempData>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiTableTempData>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiTableTempData>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiTableTempData>::size
inline int size() const;

(private API)

ImVector<ImGuiTableTempData>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiTableTempData>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiTableTempData>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiPtrOrIndex> (struct)

struct ImVector<ImGuiPtrOrIndex>
ImVector<ImGuiPtrOrIndex>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiPtrOrIndex>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiPtrOrIndex>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiPtrOrIndex>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiPtrOrIndex>::size
inline int size() const;

(private API)

ImVector<ImGuiPtrOrIndex>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiPtrOrIndex>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiPtrOrIndex>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiSettingsHandler> (struct)

struct ImVector<ImGuiSettingsHandler>
ImVector<ImGuiSettingsHandler>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiSettingsHandler>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiSettingsHandler>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiSettingsHandler>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiSettingsHandler>::size
inline int size() const;

(private API)

ImVector<ImGuiSettingsHandler>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiSettingsHandler>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiSettingsHandler>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiShrinkWidthItem> (struct)

struct ImVector<ImGuiShrinkWidthItem>
ImVector<ImGuiShrinkWidthItem>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiShrinkWidthItem>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiShrinkWidthItem>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiShrinkWidthItem>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiShrinkWidthItem>::size
inline int size() const;

(private API)

ImVector<ImGuiShrinkWidthItem>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiShrinkWidthItem>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiShrinkWidthItem>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiStackLevelInfo> (struct)

struct ImVector<ImGuiStackLevelInfo>
ImVector<ImGuiStackLevelInfo>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiStackLevelInfo>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiStackLevelInfo>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiStackLevelInfo>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiStackLevelInfo>::size
inline int size() const;

(private API)

ImVector<ImGuiStackLevelInfo>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiStackLevelInfo>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiStackLevelInfo>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiTabItem> (struct)

struct ImVector<ImGuiTabItem>
ImVector<ImGuiTabItem>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiTabItem>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiTabItem>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiTabItem>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiTabItem>::size
inline int size() const;

(private API)

ImVector<ImGuiTabItem>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiTabItem>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiTabItem>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiKeyRoutingData> (struct)

struct ImVector<ImGuiKeyRoutingData>
ImVector<ImGuiKeyRoutingData>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiKeyRoutingData>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiKeyRoutingData>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiKeyRoutingData>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiKeyRoutingData>::size
inline int size() const;

(private API)

ImVector<ImGuiKeyRoutingData>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiKeyRoutingData>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiKeyRoutingData>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiListClipperData> (struct)

struct ImVector<ImGuiListClipperData>
ImVector<ImGuiListClipperData>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiListClipperData>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiListClipperData>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiListClipperData>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiListClipperData>::size
inline int size() const;

(private API)

ImVector<ImGuiListClipperData>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiListClipperData>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiListClipperData>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiListClipperRange> (struct)

struct ImVector<ImGuiListClipperRange>
ImVector<ImGuiListClipperRange>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiListClipperRange>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiListClipperRange>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiListClipperRange>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiListClipperRange>::size
inline int size() const;

(private API)

ImVector<ImGuiListClipperRange>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiListClipperRange>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiListClipperRange>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiOldColumnData> (struct)

struct ImVector<ImGuiOldColumnData>
ImVector<ImGuiOldColumnData>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiOldColumnData>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiOldColumnData>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiOldColumnData>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiOldColumnData>::size
inline int size() const;

(private API)

ImVector<ImGuiOldColumnData>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiOldColumnData>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiOldColumnData>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiOldColumns> (struct)

struct ImVector<ImGuiOldColumns>
ImVector<ImGuiOldColumns>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiOldColumns>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiOldColumns>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiOldColumns>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiOldColumns>::size
inline int size() const;

(private API)

ImVector<ImGuiOldColumns>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiOldColumns>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiOldColumns>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiStyleMod> (struct)

struct ImVector<ImGuiStyleMod>
ImVector<ImGuiStyleMod>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiStyleMod>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiStyleMod>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiStyleMod>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiStyleMod>::size
inline int size() const;

(private API)

ImVector<ImGuiStyleMod>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiStyleMod>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiStyleMod>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiTableHeaderData> (struct)

struct ImVector<ImGuiTableHeaderData>
ImVector<ImGuiTableHeaderData>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiTableHeaderData>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiTableHeaderData>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiTableHeaderData>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiTableHeaderData>::size
inline int size() const;

(private API)

ImVector<ImGuiTableHeaderData>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiTableHeaderData>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiTableHeaderData>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiTreeNodeStackData> (struct)

struct ImVector<ImGuiTreeNodeStackData>
ImVector<ImGuiTreeNodeStackData>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiTreeNodeStackData>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiTreeNodeStackData>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiTreeNodeStackData>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiTreeNodeStackData>::size
inline int size() const;

(private API)

ImVector<ImGuiTreeNodeStackData>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiTreeNodeStackData>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiTreeNodeStackData>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImGuiMultiSelectTempData> (struct)

struct ImVector<ImGuiMultiSelectTempData>
ImVector<ImGuiMultiSelectTempData>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImGuiMultiSelectTempData>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImGuiMultiSelectTempData>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImGuiMultiSelectTempData>::empty
inline bool empty() const;

(private API)

ImVector<ImGuiMultiSelectTempData>::size
inline int size() const;

(private API)

ImVector<ImGuiMultiSelectTempData>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImGuiMultiSelectTempData>::pop_back
inline void pop_back();

(private API)

ImVector<ImGuiMultiSelectTempData>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImTextureData *> (struct)

struct ImVector<ImTextureData *>
ImVector<ImTextureData *>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImTextureData *>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImTextureData *>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImTextureData *>::empty
inline bool empty() const;

(private API)

ImVector<ImTextureData *>::size
inline int size() const;

(private API)

ImVector<ImTextureData *>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImTextureData *>::pop_back
inline void pop_back();

(private API)

ImVector<ImTextureData *>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImTextureRef> (struct)

struct ImVector<ImTextureRef>
ImVector<ImTextureRef>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImTextureRef>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImTextureRef>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImTextureRef>::empty
inline bool empty() const;

(private API)

ImVector<ImTextureRef>::size
inline int size() const;

(private API)

ImVector<ImTextureRef>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImTextureRef>::pop_back
inline void pop_back();

(private API)

ImVector<ImTextureRef>::push_front
inline void push_front(const T& v);

(private API)

ImVector<ImTextureRect> (struct)

struct ImVector<ImTextureRect>
ImVector<ImTextureRect>::ImVector
inline ImVector();
inline ImVector(const ImVector<T>& src);
ImVector<ImTextureRect>::clear
inline void clear();

(private API)

Important: does not destruct anything

ImVector<ImTextureRect>::clear_destruct
inline void clear_destruct();

(private API)

Important: never called automatically! always explicit.

ImVector<ImTextureRect>::empty
inline bool empty() const;

(private API)

ImVector<ImTextureRect>::size
inline int size() const;

(private API)

ImVector<ImTextureRect>::push_back
inline void push_back(const T& v);

(private API)

NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.

ImVector<ImTextureRect>::pop_back
inline void pop_back();

(private API)

ImVector<ImTextureRect>::push_front
inline void push_front(const T& v);

(private API)

ImGuiStyle (struct)

struct ImGuiStyle

See it live: Tools › Style Editor (also used in 9 other sections)

Tools › Style Editor
Code from the demo
ImGuiStyle& style = GetStyle();
Member
float FontSizeBase;Current base font size before external global factors are applied. Use PushFont(None, size) to modify. Use ImGui::GetFontSize() to obtain scaled value.
float FontScaleMain;Main global scale factor. May be set by application once, or exposed to end-user.
float FontScaleDpi;Additional global scale factor from viewport/monitor contents scale. In docking branch: when io.ConfigDpiScaleFonts is enabled, this is automatically overwritten when changing monitor DPI.
float Alpha;Global alpha applies to everything in Dear ImGui.
float DisabledAlpha;Additional alpha multiplier applied by BeginDisabled(). Multiply over current value of Alpha.
ImVec2 WindowPadding;Padding within a window.
float WindowRounding;Radius of window corners rounding. Set to 0.0 to have rectangular windows. Large values tend to lead to variety of artifacts and are not recommended.
float WindowBorderSize;Thickness of border around windows. Generally set to 0.0 or 1.0. (Other values are not well tested and more CPU/GPU costly).
float WindowBorderHoverPadding;Hit-testing extent outside/inside resizing border. Also extend determination of hovered window. Generally meaningfully larger than WindowBorderSize to make it easy to reach borders.
ImVec2 WindowMinSize;Minimum window size. This is a global setting. If you want to constrain individual windows, use SetNextWindowSizeConstraints().
ImVec2 WindowTitleAlign;Alignment for title bar text. Defaults to (0.0,0.5) for left-aligned,vertically centered.
ImGuiDir WindowMenuButtonPosition;Side of the collapsing/docking button in the title bar (None/Left/Right). Defaults to ImGuiDir_Left.
float ChildRounding;Radius of child window corners rounding. Set to 0.0 to have rectangular windows.
float ChildBorderSize;Thickness of border around child windows. Generally set to 0.0 or 1.0. (Other values are not well tested and more CPU/GPU costly).
float PopupRounding;Radius of popup window corners rounding. (Note that tooltip windows use WindowRounding)
float PopupBorderSize;Thickness of border around popup/tooltip windows. Generally set to 0.0 or 1.0. (Other values are not well tested and more CPU/GPU costly).
ImVec2 FramePadding;Padding within a framed rectangle (used by most widgets).
float FrameRounding;Radius of frame corners rounding. Set to 0.0 to have rectangular frame (used by most widgets).
float FrameBorderSize;Thickness of border around frames. Generally set to 0.0 or 1.0. (Other values are not well tested and more CPU/GPU costly).
ImVec2 ItemSpacing;Horizontal and vertical spacing between widgets/lines.
ImVec2 ItemInnerSpacing;Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label).
ImVec2 CellPadding;Padding within a table cell. Cellpadding.x is locked for entire table. CellPadding.y may be altered between different rows.
ImVec2 TouchExtraPadding;Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don’t sort widgets so priority on overlap will always be given to the first widget. So don’t grow this too much!
float IndentSpacing;Horizontal indentation when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).
float ColumnsMinSpacing;Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1).
float ScrollbarSize;Width of the vertical scrollbar, Height of the horizontal scrollbar.
float ScrollbarRounding;Radius of grab corners for scrollbar.
float ScrollbarPadding;Padding of scrollbar grab within its frame (same for both axes).
float GrabMinSize;Minimum width/height of a grab box for slider/scrollbar.
float GrabRounding;Radius of grabs corners rounding. Set to 0.0 to have rectangular slider grabs.
float LayoutAlign;Element alignment inside horizontal and vertical layouts (0.0 - left/top, 1.0 - right/bottom, 0.5 - center).
float LogSliderDeadzone;The size in pixels of the dead-zone around zero on logarithmic sliders that cross zero.
float ImageRounding;Rounding of Image() calls.
float ImageBorderSize;Thickness of border around Image() calls.
float TabRounding;Radius of upper corners of a tab. Set to 0.0 to have rectangular tabs.
float TabBorderSize;Thickness of border around tabs.
float TabMinWidthBase;Minimum tab width, to make tabs larger than their contents. TabBar buttons are not affected.
float TabMinWidthShrink;Minimum tab width after shrinking, when using ImGuiTabBarFlags_FittingPolicyMixed policy.
float TabCloseButtonMinWidthSelected;-1: always visible. 0.0: visible when hovered. >0.0: visible when hovered if minimum width. FLT_MAX: never shrink, will behave like ImGuiTabBarFlags_FittingPolicyScroll.
float TabCloseButtonMinWidthUnselected;-1: always visible. 0.0: visible when hovered. >0.0: visible when hovered if minimum width. FLT_MAX: never show close button when unselected.
float TabBarBorderSize;Thickness of tab-bar separator, which takes on the tab active color to denote focus.
float TabBarOverlineSize;Thickness of tab-bar overline, which highlights the selected tab-bar.
float TableAngledHeadersAngle;Angle of angled headers (supported values range from -50.0 degrees to +50.0 degrees).
ImVec2 TableAngledHeadersTextAlign;Alignment of angled headers within the cell
ImGuiTreeNodeFlags TreeLinesFlags;Default way to draw lines connecting TreeNode hierarchy. ImGuiTreeNodeFlags_DrawLinesNone or ImGuiTreeNodeFlags_DrawLinesFull or ImGuiTreeNodeFlags_DrawLinesToNodes.
float TreeLinesSize;Thickness of outlines when using ImGuiTreeNodeFlags_DrawLines.
float TreeLinesRounding;Radius of lines connecting child nodes to the vertical line.
float MenuItemRounding;Radius of MenuItem, BeginMenu rounding.
float SelectableRounding;Radius of Selectable rounding. MODIFYING THIS IS DISCOURAGED. CONTIGUOUS SELECTIONS WILL NOT LOOK RIGHT. (#7589)
float DragDropTargetRounding;Radius of the drag and drop target frame. When <0.0: use FrameRounding.
float DragDropTargetBorderSize;Thickness of the drag and drop target border.
float DragDropTargetPadding;Size to expand the drag and drop target from actual target item size.
float ColorMarkerSize;Size of R/G/B/A color markers for ColorEdit4() and for Drags/Sliders when using ImGuiSliderFlags_ColorMarkers.
ImGuiDir ColorButtonPosition;Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right.
ImVec2 ButtonTextAlign;Alignment of button text when button is larger than text. Defaults to (0.5, 0.5) (centered).
ImVec2 SelectableTextAlign;Alignment of selectable text. Defaults to (0.0, 0.0) (top-left aligned). It’s generally important to keep this left-aligned if you want to lay multiple items on a same line.
float InputTextCursorSize;Thickness of cursor/caret in InputText().
float SeparatorSize;Thickness of border in Separator(). Must be >= 1.0.
float SeparatorTextBorderSize;Thickness of border in SeparatorText()
ImVec2 SeparatorTextAlign;Alignment of text within the separator. Defaults to (0.0, 0.5) (left aligned, center).
ImVec2 SeparatorTextPadding;Horizontal offset of text from each edge of the separator + spacing on other axis. Generally small values. .y is recommended to be == FramePadding.y.
ImVec2 DisplayWindowPadding;Apply to regular windows: amount which we enforce to keep visible when moving near edges of your screen.
ImVec2 DisplaySafeAreaPadding;Apply to every windows, menus, popups, tooltips: amount where we avoid displaying contents. Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured).
bool DockingNodeHasCloseButton;Docking node has their own CloseButton() to close all docked windows.
float DockingSeparatorSize;Thickness of resizing border between docked windows
float MouseCursorScale;Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). We apply per-monitor DPI scaling over this scale. May be removed later.
bool AntiAliasedLines;Enable anti-aliased lines/borders. Used at the beginning of the frame to set ImDrawFlags_AALines in all draw-lists.
bool AntiAliasedLineEnds;Enable anti-aliased lines/borders ends. Nicer for thick lines but more expensive. Used at the beginning of the frame to set ImDrawFlags_AALineEnds in all draw-lists.
bool AntiAliasedFill;Enable anti-aliased edges around filled shapes (rounded rectangles, circles, etc.). Used at the beginning of the frame to set ImDrawFlags_AAFill in all draw-lists.
float CurveTessellationMaxError;Maximum error (in pixels) when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality.
float CircleTessellationMaxError;Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. Decrease for higher quality but more geometry.
float HoverStationaryDelay;Delay for IsItemHovered(ImGuiHoveredFlags_Stationary). Time required to consider mouse stationary.
float HoverDelayShort;Delay for IsItemHovered(ImGuiHoveredFlags_DelayShort). Usually used along with HoverStationaryDelay.
float HoverDelayNormal;Delay for IsItemHovered(ImGuiHoveredFlags_DelayNormal). "
ImGuiHoveredFlags HoverFlagsForTooltipMouse;Default flags when using IsItemHovered(ImGuiHoveredFlags_ForTooltip) or BeginItemTooltip()/SetItemTooltip() while using mouse.
ImGuiHoveredFlags HoverFlagsForTooltipNav;Default flags when using IsItemHovered(ImGuiHoveredFlags_ForTooltip) or BeginItemTooltip()/SetItemTooltip() while using keyboard/gamepad.
float _MainScale;FIXME-WIP: Reference scale, as applied by ScaleAllSizes(). PLEASE DO NOT USE THIS FOR NOW.
float _NextFrameFontSizeBase;FIXME: Temporary hack until we finish remaining work.
ImGuiStyle::ImGuiStyle
IMGUI_API ImGuiStyle();
ImGuiStyle::ScaleAllSizes
IMGUI_API void ScaleAllSizes(float scale_factor);

Scale all spacing/padding/thickness values. Do not scale fonts. See comments in definition. Consider not calling this if your initial scale factor if <1.0.

ImGuiIO

ImGuiKeyData (struct)

struct ImGuiKeyData

[Internal] Storage used by IsKeyDown(), IsKeyPressed() etc functions.
If prior to 1.87 you used io.KeysDownDuration[] (which was marked as internal), you should use GetKeyData(key)->DownDuration and NOT io.KeysData[key]->DownDuration.

Member
bool Down;True for if key is down
float DownDuration;Duration the key has been down (<0.0: not pressed, 0.0: just pressed, >0.0: time held)
float DownDurationPrev;Last frame duration the key has been down
float AnalogValue;0.0..1.0 for gamepad values

ImGuiIO (struct)

struct ImGuiIO
Member
ImGuiConfigFlags ConfigFlags;= 0 // See ImGuiConfigFlags_ enum. Set by user/application. Keyboard/Gamepad navigation options, etc.
ImGuiBackendFlags BackendFlags;= 0 // See ImGuiBackendFlags_ enum. Set by backend (imgui_impl_xxx files or custom backend) to communicate features supported by the backend.
ImVec2 DisplaySize;<unset> // Main display size, in pixels (== GetMainViewport()->Size). May change every frame.
ImVec2 DisplayFramebufferScale;= (1, 1) // Main display density. For retina display where window coordinates are different from framebuffer coordinates. This will affect font density + will end up in ImDrawData::FramebufferScale.
float DeltaTime;= 1.0/60.0 // Time elapsed since last frame, in seconds. May change every frame.
float IniSavingRate;= 5.0 // Minimum time between saving positions/sizes to .ini file, in seconds.
void* UserData;= None // Store your own data.
ImFontAtlas*Fonts;<auto> // Font atlas: load, rasterize and pack one or more fonts into a single texture.
ImFont* FontDefault;= None // Font to use on NewFrame(). Use None to uses Fonts->Fonts[0].
bool FontAllowUserScaling;= False // Allow user scaling text of individual window with Ctrl+Wheel.
bool ConfigNavSwapGamepadButtons;= False // Swap Activate<>Cancel (A<>B) buttons, matching typical “Nintendo/Japanese style” gamepad layout.
bool ConfigNavMoveSetMousePos;= False // Directional/tabbing navigation teleports the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is difficult. Will update io.MousePos and set io.WantSetMousePos=True.
bool ConfigNavCaptureKeyboard;= True // Sets io.WantCaptureKeyboard when io.NavActive is set.
bool ConfigNavEscapeClearFocusItem;= True // Pressing Escape can clear focused item + navigation id/highlight. Set to False if you want to always keep highlight on.
bool ConfigNavEscapeClearFocusWindow;= False // Pressing Escape can clear focused window as well (super set of io.ConfigNavEscapeClearFocusItem).
bool ConfigNavCursorVisibleAuto;= True // Using directional navigation key makes the cursor visible. Mouse click hides the cursor.
bool ConfigNavCursorVisibleAlways;= False // Navigation cursor is always visible.
bool ConfigDockingNoSplit;= False // Simplified docking mode: disable window splitting, so docking is limited to merging multiple windows together into tab-bars.
bool ConfigDockingNoDockingOver;= False // Simplified docking mode: disable window merging into a same tab-bar, so docking is limited to splitting windows.
bool ConfigDockingWithShift;= False // Enable docking with holding Shift key (reduce visual noise, allows dropping in wider space)
bool ConfigDockingAlwaysTabBar;= False // [BETA] [FIXME: This currently creates regression with auto-sizing and general overhead] Make every single floating window display within a docking node.
bool ConfigDockingTransparentPayload;= False // [BETA] Make window or viewport transparent when docking and only display docking boxes on the target viewport. Useful if rendering of multiple viewport cannot be synced. Best used with ConfigViewportsNoAutoMerge.
bool ConfigViewportsNoAutoMerge;= False; // Set to make all floating imgui windows always create their own viewport. Otherwise, they are merged into the main host viewports when overlapping it. May also set ImGuiViewportFlags_NoAutoMerge on individual viewport.
bool ConfigViewportsNoTaskBarIcon;= False // Disable default OS task bar icon flag for secondary viewports. When a viewport doesn’t want a task bar icon, ImGuiViewportFlags_NoTaskBarIcon will be set on it.
bool ConfigViewportsNoDecoration;= True // Disable default OS window decoration flag for secondary viewports. When a viewport doesn’t want window decorations, ImGuiViewportFlags_NoDecoration will be set on it. Enabling decoration can create subsequent issues at OS levels (e.g. minimum window size).
bool ConfigViewportsNoDefaultParent;= True // Disable setting OS window parent to main viewport by default. The platform backend is expected to honor viewport->ParentViewportID to setup a parent/child relationship between the OS windows (supported if ImGuiBackendFlags_HasParentViewport is set). When parented: child windows always appear in front of their parent. Set to False if you want viewports to automatically be parent of main viewport, otherwise all viewports will be top-level OS windows. Parent/child relationship may be set on a per-window basis using ImGuiWindowClass.
bool ConfigViewportsPlatformFocusSetsImGuiFocus;= True // When a platform window is focused (e.g. using Alt+Tab, clicking Platform Title Bar), apply corresponding focus on imgui windows (may clear focus/active id from imgui windows location in other platform windows). In principle this is better enabled but we provide an opt-out, because some Linux window managers tend to eagerly focus windows (e.g. on mouse hover, or even a simple window pos/size change).
bool ConfigDpiScaleFonts;= False // [EXPERIMENTAL] Automatically overwrite style.FontScaleDpi when Monitor DPI changes. This will scale fonts but NOT scale sizes/padding for now.
bool ConfigDpiScaleViewports;= False // [EXPERIMENTAL] Scale Dear ImGui and Platform Windows when Monitor DPI changes.
bool ConfigMacOSXBehaviors;= defined(APPLE) // Swap Cmd<>Ctrl keys + OS X style text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl.
bool ConfigInputTrickleEventQueue;= True // Enable input queue trickling: some types of events submitted during the same frame (e.g. button down + up) will be spread over multiple frames, improving interactions with low framerates.
bool ConfigInputTextCursorBlink;= True // Enable blinking cursor (optional as some users consider it to be distracting).
bool ConfigInputTextEnterKeepActive;= False // [BETA] Pressing Enter will reactivate item and select all text (single-line only). Ctrl+Enter or Shift+Enter will deactivate normally.
ImGuiColorEditFlags ConfigColorEditFlags;= <defaults> // Current settings for ColorEdit/ColorPicker widgets. Must have one bit of ImGuiColorEditFlags_DisplayMask_, one bit of ImGuiColorEditFlags_DataTypeMask_, one bit of ImGuiColorEditFlags_PickerMask_, one bit of ImGuiColorEditFlags_InputMask_. Defaults to ImGuiColorEditFlags_DefaultOptions_. May be further edited by users, unless you also set ImGuiColorEditFlags_NoOptions.
bool ConfigDragClickToInputText;= False // [BETA] Enable turning DragXXX widgets into text input with a simple mouse click-release (without moving). Not desirable on devices without a keyboard.
bool ConfigWindowsResizeFromEdges;= True // Enable resizing of windows from their edges and from the lower-left corner. This requires ImGuiBackendFlags_HasMouseCursors for better mouse cursor feedback. (This used to be a per-window ImGuiWindowFlags_ResizeFromAnySide flag)
bool ConfigWindowsMoveFromTitleBarOnly;= False // Enable allowing to move windows only when clicking on their title bar. Does not apply to windows without a title bar.
bool ConfigWindowsCopyContentsWithCtrlC;= False // [EXPERIMENTAL] Ctrl+C copy the contents of focused window into the clipboard. Experimental because: (1) has known issues with nested Begin/End pairs (2) text output quality varies (3) text output is in submission order rather than spatial order.
bool ConfigScrollbarScrollByPage;= True // Enable scrolling page by page when clicking outside the scrollbar grab. When disabled, always scroll to clicked location. When enabled, Shift+Click scrolls to clicked location.
bool ConfigIniSettingsSaveLastUsedDate;= True // Enable loading/saving last used day (YYYYMMDD) in some .ini struct, making things easier to audit and allowing custom tools to cleanup old data.
int ConfigIniSettingsAutoDiscardMonths;= 0 // [BETA] Set number of months after which unused .ini entries are discarded on load. Require platform_io.Platform_SessionDate to be set. For systems supporting the feature, .ini entries without a LastUsed field will always be discarded! Please report if you are using this.
bool ConfigDebugIniSettings;= False // Save .ini data with extra comments (particularly helpful for Docking, but makes saving slower)
bool MouseDrawCursor;= False // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor). Cannot be easily renamed to ‘io.ConfigXXX’ because this is frequently used by backend implementations.
float ConfigMemoryCompactTimer;= 60.0 // Timer (in seconds) to free transient windows/tables memory buffers when unused. Set to -1.0 to disable.
float MouseDoubleClickTime;= 0.30 // Time for consecutive clicks to account as a double-click, in seconds.
float MouseDoubleClickMaxDist;= 6.0 // Distance threshold to stay in to validate a double-click or multiple clicks, in pixels.
float MouseSingleClickDelay;= 0.60 // Time for a delayed click when using GetItemClickedCountWithSingleClickDelay() or IsMouseReleasedWithDelay(), in seconds. Must be > io.MouseDoubleClickTime.
float MouseDragThreshold;= 6.0 // Distance threshold before considering we are dragging.
float KeyRepeatDelay;= 0.275 // When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.).
float KeyRepeatRate;= 0.050 // When holding a key/button, rate at which it repeats, in seconds.
bool ConfigErrorRecovery;= True // Enable error recovery support. Some errors won’t be detected and lead to direct crashes if recovery is disabled.
bool ConfigErrorRecoveryEnableAssert;= True // Enable asserts on recoverable error. By default call IM_ASSERT() when returning from a failing IM_ASSERT_USER_ERROR()
bool ConfigErrorRecoveryEnableDebugLog;= True // Enable debug log output on recoverable errors.
bool ConfigErrorRecoveryEnableTooltip;= True // Enable tooltip on recoverable errors. The tooltip include a way to enable asserts if they were disabled.
bool ConfigDebugIsDebuggerPresent;= False // Enable various tools calling IM_DEBUG_BREAK().
bool ConfigDebugHighlightIdConflicts;= True // Highlight and show an error message popup when multiple items have conflicting identifiers.
bool ConfigDebugHighlightIdConflictsShowItemPicker;=True // Show “Item Picker” button in aforementioned popup.
bool ConfigDebugBeginReturnValueOnce;= False // First-time calls to Begin()/BeginChild() will return False. NEEDS TO BE SET AT APPLICATION BOOT TIME if you don’t want to miss windows.
bool ConfigDebugBeginReturnValueLoop;= False // Some calls to Begin()/BeginChild() will return False. Will cycle through window depths then repeat. Suggested use: add “io.ConfigDebugBeginReturnValue = io.KeyShift” in your main loop then occasionally press SHIFT. Windows should be flickering while running.
bool ConfigDebugIgnoreFocusLoss;= False // Ignore io.AddFocusEvent(False), consequently not calling io.ClearInputKeys()/io.ClearInputMouse() in input processing.
bool ConfigDebugDrawListDefaultsToStrokeLegacy;False // Default all ImDrawList to ImDrawFlags_StrokeLegacy mode, mimicking pre-1.93.0 rendering.
const char* BackendPlatformName;= None # (const)
const char* BackendRendererName;= None # (const)
void* BackendPlatformUserData;= None // User data for platform backend
void* BackendRendererUserData;= None // User data for renderer backend
void* BackendLanguageUserData;= None // User data for non C++ programming language backend
bool WantCaptureMouse;Set when Dear ImGui will use mouse inputs, in this case do not dispatch them to your main game/application (either way, always pass on mouse inputs to imgui). (e.g. unclicked mouse is hovering over an imgui window, widget is active, mouse was clicked over an imgui window, etc.).
bool WantCaptureKeyboard;Set when Dear ImGui will use keyboard inputs, in this case do not dispatch them to your main game/application (either way, always pass keyboard inputs to imgui). (e.g. InputText active, or an imgui window is focused and navigation is enabled, etc.).
bool WantTextInput;Mobile/console: when set, you may display an on-screen keyboard. This is set by Dear ImGui when it wants textual keyboard input to happen (e.g. when a InputText widget is active).
bool WantSetMousePos;MousePos has been altered, backend should reposition mouse on next frame. Rarely used! Set only when io.ConfigNavMoveSetMousePos is enabled.
bool WantSaveIniSettings;When manual .ini load/save is active (io.IniFilename == None), this will be set to notify your application that you can call SaveIniSettingsToMemory() and save yourself. Important: clear io.WantSaveIniSettings yourself after saving!
bool NavActive;Keyboard/Gamepad navigation is currently allowed (will handle ImGuiKey_NavXXX events) = a window is focused and it doesn’t use the ImGuiWindowFlags_NoNavInputs flag.
bool NavVisible;Keyboard/Gamepad navigation highlight is visible and allowed (will handle ImGuiKey_NavXXX events).
float Framerate;Estimate of application framerate (rolling average over 60 frames, based on io.DeltaTime), in frame per second. Solely for convenience. Slow applications may not want to use a moving average or may want to reset underlying buffers occasionally.
int MetricsRenderVertices;Vertices output during last call to Render()
int MetricsRenderIndices;Indices output during last call to Render() = number of triangles * 3
int MetricsRenderWindows;Number of visible windows
int MetricsActiveWindows;Number of active windows
ImVec2 MouseDelta;Mouse delta. Note that this is zero if either current or previous position are invalid (-FLT_MAX,-FLT_MAX), so a disappearing/reappearing mouse won’t have a huge delta.
ImGuiContext* Ctx;Parent UI context (needs to be set explicitly by parent).
ImVec2 MousePos;Mouse position, in pixels. Set to ImVec2(-FLT_MAX, -FLT_MAX) if mouse is unavailable (on another screen, etc.)
bool MouseDown[5];ndarray[type=bool, size=5] # Mouse buttons: 0=left, 1=right, 2=middle + extras (ImGuiMouseButton_COUNT == 5). Dear ImGui mostly uses left and right buttons. Other buttons allow us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API.
float MouseWheel;Mouse wheel Vertical: 1 unit scrolls about 5 lines text. >0 scrolls Up, <0 scrolls Down. Hold Shift to turn vertical scroll into horizontal scroll.
float MouseWheelH;Mouse wheel Horizontal. >0 scrolls Left, <0 scrolls Right. Most users don’t have a mouse with a horizontal wheel, may not be filled by all backends.
ImGuiMouseSource MouseSource;Mouse actual input peripheral (Mouse/TouchScreen/Pen).
ImGuiID MouseHoveredViewport;(Optional) Modify using io.AddMouseViewportEvent(). With multi-viewports: viewport the OS mouse is hovering. If possible IGNORING viewports with the ImGuiViewportFlags_NoInputs flag is much better (few backends can handle that). Set io.BackendFlags |= ImGuiBackendFlags_HasMouseHoveredViewport if you can provide this info. If you don’t imgui will infer the value using the rectangles and last focused time of the viewports it knows about (ignoring other OS windows).
bool KeyCtrl;Keyboard modifier down: Ctrl (non-macOS), Cmd (macOS)
bool KeyShift;Keyboard modifier down: Shift
bool KeyAlt;Keyboard modifier down: Alt
bool KeySuper;Keyboard modifier down: Windows/Super (non-macOS), Ctrl (macOS)
ImGuiKeyChord KeyMods;Key mods flags (any of ImGuiMod_Ctrl/ImGuiMod_Shift/ImGuiMod_Alt/ImGuiMod_Super flags, same as io.KeyCtrl/KeyShift/KeyAlt/KeySuper but merged into flags). Read-only, updated by NewFrame()
bool WantCaptureMouseUnlessPopupClose;Alternative to WantCaptureMouse: (WantCaptureMouse == True && WantCaptureMouseUnlessPopupClose == False) when a click over None is expected to close a popup.
ImVec2 MousePosPrev;Previous mouse position (note that MouseDelta is not necessary == MousePos-MousePosPrev, in case either position is invalid)
double MouseClickedTime[5];ndarray[type=double, size=5] # Time of last click (used to figure out double-click)
bool MouseClicked[5];ndarray[type=bool, size=5] # Mouse button went from !Down to Down (same as MouseClickedCount[x] != 0)
bool MouseDoubleClicked[5];ndarray[type=bool, size=5] # Has mouse button been double-clicked? (same as MouseClickedCount[x] == 2)
ImU16 MouseClickedCount[5];ndarray[type=ImU16, size=5] # == 0 (not clicked), == 1 (same as MouseClicked[]), == 2 (double-clicked), == 3 (triple-clicked) etc. when going from !Down to Down
ImU16 MouseClickedLastCount[5];ndarray[type=ImU16, size=5] # Count successive number of clicks. Stays valid after mouse release. Reset after another click is done.
bool MouseReleased[5];ndarray[type=bool, size=5] # Mouse button went from Down to !Down
double MouseReleasedTime[5];ndarray[type=double, size=5] # Time of last released (rarely used! but useful to handle delayed single-click when trying to disambiguate them from double-click).
bool MouseDownOwned[5];ndarray[type=bool, size=5] # Track if button was clicked inside a dear imgui window or over None blocked by a popup. We don’t request mouse capture from the application if click started outside ImGui bounds.
bool MouseDownOwnedUnlessPopupClose[5];ndarray[type=bool, size=5] # Track if button was clicked inside a dear imgui window.
bool MouseWheelRequestAxisSwap;On a non-Mac system, holding Shift requests WheelY to perform the equivalent of a WheelX event. On a Mac system this is already enforced by the system.
bool MouseCtrlLeftAsRightClick;(OSX) Set to True when the current click was a Ctrl+Click that spawned a simulated right click
float MouseDownDuration[5];ndarray[type=float, size=5] # Duration the mouse button has been down (0.0 == just clicked)
float MouseDownDurationPrev[5];ndarray[type=float, size=5] # Previous time the mouse button has been down
float MouseDragMaxDistanceSqr[5];ndarray[type=float, size=5] # Squared maximum distance of how much mouse has traveled from the clicking point (used for moving thresholds)
float PenPressure;Touch/Pen pressure (0.0 to 1.0, should be >0.0 only when MouseDown[0] == True). Helper storage currently unused by Dear ImGui.
bool AppFocusLost;Only modify via AddFocusEvent()
bool AppAcceptingEvents;Only modify via SetAppAcceptingEvents()
ImWchar16 InputQueueSurrogate;For AddInputCharacterUTF16()
ImVector<ImWchar> InputQueueCharacters;Queue of characters input (obtained by platform backend). Fill using AddInputCharacter() helper.
ImGuiIO::AddKeyEvent
IMGUI_API void AddKeyEvent(ImGuiKey key, bool down);

Queue a new key down/up event. Key should be “translated” (as in, generally ImGuiKey_A matches the key end-user would use to emit an ‘A’ character)

ImGuiIO::AddKeyAnalogEvent
IMGUI_API void AddKeyAnalogEvent(ImGuiKey key, bool down, float v);

Queue a new key down/up event for analog values (e.g. ImGuiKey_Gamepad_ values). Dead-zones should be handled by the backend.

ImGuiIO::AddMousePosEvent
IMGUI_API void AddMousePosEvent(float x, float y);

Queue a mouse position update. Use -FLT_MAX,-FLT_MAX to signify no mouse (e.g. app not focused and not hovered)

ImGuiIO::AddMouseButtonEvent
IMGUI_API void AddMouseButtonEvent(int button, bool down);

Queue a mouse button change

ImGuiIO::AddMouseWheelEvent
IMGUI_API void AddMouseWheelEvent(float wheel_x, float wheel_y);

Queue a mouse wheel update. wheel_y<0: scroll down, wheel_y>0: scroll up, wheel_x<0: scroll right, wheel_x>0: scroll left.

ImGuiIO::AddMouseSourceEvent
IMGUI_API void AddMouseSourceEvent(ImGuiMouseSource source);

Queue a mouse source change (Mouse/TouchScreen/Pen)

ImGuiIO::AddMouseViewportEvent
IMGUI_API void AddMouseViewportEvent(ImGuiID id);

Queue a mouse hovered viewport. Requires backend to set ImGuiBackendFlags_HasMouseHoveredViewport to call this (for multi-viewport support).

ImGuiIO::AddFocusEvent
IMGUI_API void AddFocusEvent(bool focused);

Queue a gain/loss of focus for the application (generally based on OS/platform focus of your window)

ImGuiIO::AddInputCharacter
IMGUI_API void AddInputCharacter(unsigned int c);

Queue a new character input

ImGuiIO::AddInputCharacterUTF16
IMGUI_API void AddInputCharacterUTF16(ImWchar16 c);

Queue a new character input from a UTF-16 character, it can be a surrogate

ImGuiIO::AddInputCharactersUTF8
IMGUI_API void AddInputCharactersUTF8(const char* str);

Queue a new characters input from a UTF-8 string

ImGuiIO::SetKeyEventNativeData
IMGUI_API void SetKeyEventNativeData(ImGuiKey key, int native_keycode, int native_scancode, int native_legacy_index = -1);

[Optional] Specify index for legacy <1.87 IsKeyXXX() functions with native indices + specify native keycode, scancode.

ImGuiIO::SetAppAcceptingEvents
IMGUI_API void SetAppAcceptingEvents(bool accepting_events);

Set master flag for accepting key/mouse/text events (default to True). Useful if you have native dialog boxes that are interrupting your application loop/refresh, and you want to disable events being queued while your app is frozen.

ImGuiIO::ClearEventsQueue
IMGUI_API void ClearEventsQueue();

Clear all incoming events.

ImGuiIO::ClearInputKeys
IMGUI_API void ClearInputKeys();

Clear current keyboard/gamepad state + current frame text input buffer. Equivalent to releasing all keys/buttons.

ImGuiIO::ClearInputMouse
IMGUI_API void ClearInputMouse();

Clear current mouse state.

ImGuiIO::ImGuiIO
IMGUI_API ImGuiIO();

Legacy: before 1.87, we required backend to fill io.KeyMap[] (imgui->native map) during initialization and io.KeysDown[] (native indices) every frame.
This is still temporarily supported as a legacy feature. However the new preferred scheme is for backend to call io.AddKeyEvent().
Old (<1.87): ImGui::IsKeyPressed(ImGui::GetIO().KeyMap[ImGuiKey_Space]) --> New (1.87+) ImGui::IsKeyPressed(ImGuiKey_Space) Old (<1.87): ImGui::IsKeyPressed(MYPLATFORM_KEY_SPACE) --> New (1.87+) ImGui::IsKeyPressed(ImGuiKey_Space) Read ocornut/imgui#4921 for details.

int       KeyMap[ImGuiKey_COUNT];             // [LEGACY] Input: map of indices into the KeysDown[512] entries array which represent your "native" keyboard state. The first 512 are now unused and should be kept zero. Legacy backend will write into KeyMap[] using ImGuiKey_ indices which are always >512.
bool      KeysDown[ImGuiKey_COUNT];           // [LEGACY] Input: Keyboard keys that are pressed (ideally left in the "native" order your engine has access to keyboard keys, so you can use your own defines/enums for keys). This used to be [512] sized. It is now ImGuiKey_COUNT to allow legacy io.KeysDown[GetKeyIndex(...)] to work without an overflow.
float     NavInputs[ImGuiNavInput_COUNT];     // [LEGACY] Since 1.88, NavInputs[] was removed. Backends from 1.60 to 1.86 won't build. Feed gamepad inputs via io.AddKeyEvent() and ImGuiKey_GamepadXXX enums.
None*     ImeWindowHandle;                    // [Obsoleted in 1.87] Set ImGuiViewport::PlatformHandleRaw instead. Set this to your HWND to get automatic IME cursor positioning.

Misc data structures

ImGuiInputTextCallbackData (struct)

struct ImGuiInputTextCallbackData

Shared state of InputText(), passed as an argument to your callback when a ImGuiInputTextFlags_Callback* flag is used.
The callback function should return 0 by default.
Callbacks (follow a flag name and see comments in ImGuiInputTextFlags_ declarations for more details)

- ImGuiInputTextFlags_CallbackEdit:        Callback on buffer edit. Note that InputText() already returns True on edit + you can always use IsItemEdited(). The callback is useful to manipulate the underlying buffer while focus is active.
- ImGuiInputTextFlags_CallbackAlways:      Callback on each iteration
- ImGuiInputTextFlags_CallbackResize:      Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow.
Member
ImGuiContext* Ctx;Parent UI context
ImGuiInputTextFlags EventFlag;One ImGuiInputTextFlags_Callback* // Read-only
ImGuiInputTextFlags Flags;What user passed to InputText() // Read-only
void* UserData;What user passed to InputText() // Read-only
ImGuiID ID;Widget ID // Read-only
ImGuiKey EventKey;Key pressed (Up/Down/TAB) // Read-only // [Completion,History]
ImWchar EventChar;Character input // Read-write // [CharFilter] Replace character with another one, or set to zero to drop. return 1 is equivalent to setting EventChar=0;
bool EventActivated;Input field just got activated // Read-only // [Always]
bool BufDirty;Set if you modify Buf/BufTextLen! // Write // [Completion,History,Always]
char* Buf;Text buffer // Read-write // [Resize] Can replace pointer / [Completion,History,Always] Only write to pointed data, don’t replace the actual pointer! # (read-only)
int BufTextLen;Text length (in bytes) // Read-write // [Resize,Completion,History,Always] Exclude zero-terminator storage. In C land: == strlen(some_text), in C++ land: string.length()
int BufSize;Buffer size (in bytes) = capacity+1 // Read-only // [Resize,Completion,History,Always] Include zero-terminator storage. In C land: == ARRAYSIZE(my_char_array), in C++ land: string.capacity()+1
int CursorPos;// Read-write // [Completion,History,Always,CharFilter]
int SelectionStart;// Read-write // [Completion,History,Always,CharFilter] == to SelectionEnd when no selection
int SelectionEnd;// Read-write // [Completion,History,Always,CharFilter]
ImGuiInputTextCallbackData::ImGuiInputTextCallbackData
IMGUI_API ImGuiInputTextCallbackData();

Helper functions for text manipulation.
Use those function to benefit from the CallbackResize behaviors. Calling those function reset the selection.

ImGuiInputTextCallbackData::DeleteChars
IMGUI_API void DeleteChars(int pos, int bytes_count);
ImGuiInputTextCallbackData::InsertChars
IMGUI_API void InsertChars(int pos, const char* text, const char* text_end = NULL);
ImGuiInputTextCallbackData::SelectAll
void SelectAll();

(private API)

ImGuiInputTextCallbackData::SetSelection
void SetSelection(int s, int e);

(private API)

ImGuiInputTextCallbackData::ClearSelection
void ClearSelection();

(private API)

ImGuiInputTextCallbackData::HasSelection
bool HasSelection() const;

(private API)

ImGuiSizeCallbackData (struct)

struct ImGuiSizeCallbackData

Resizing callback data to apply custom constraint. As enabled by SetNextWindowSizeConstraints(). Callback is called during the next Begin().
NB: For basic min/max size constraint on each axis you don’t need to use the callback! The SetNextWindowSizeConstraints() parameters are enough.

Member
void* UserData;Read-only. What user passed to SetNextWindowSizeConstraints(). Generally store an integer or float in here (need reinterpret_cast<>).
ImVec2 Pos;Read-only. Window position, for reference.
ImVec2 CurrentSize;Read-only. Current window size.
ImVec2 DesiredSize;Read-write. Desired size, based on user’s mouse position. Write to this field to restrain resizing.

ImGuiWindowClass (struct)

struct ImGuiWindowClass

[ALPHA] Rarely used / very advanced uses only. Use with SetNextWindowClass() and DockSpace() functions.
Important: the content of this class is still highly WIP and likely to change and be refactored before we stabilize Docking features. Please be mindful if using this.
Provide hints:

Member
ImGuiID ClassId;User data. 0 = Default class (unclassed). Windows of different classes cannot be docked with each others.
ImGuiID ParentViewportId;Hint for the platform backend. -1: use default. 0: request platform backend to not parent the platform. != 0: request platform backend to create a parent<>child relationship between the platform windows. Not conforming backends are free to e.g. parent every viewport to the main viewport or not.
ImGuiID FocusRouteParentWindowId;ID of parent window for shortcut focus route evaluation, e.g. Shortcut() call from Parent Window will succeed when this window is focused.
ImGuiViewportFlags ViewportFlagsOverrideSet;Viewport flags to set when a window of this class owns a viewport. This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
ImGuiViewportFlags ViewportFlagsOverrideClear;Viewport flags to clear when a window of this class owns a viewport. This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
ImGuiTabItemFlags TabItemFlagsOverrideSet;[EXPERIMENTAL] TabItem flags to set when a window of this class gets submitted into a dock node tab bar. May use with ImGuiTabItemFlags_Leading or ImGuiTabItemFlags_Trailing.
ImGuiDockNodeFlags DockNodeFlagsOverrideSet;[EXPERIMENTAL] Dock node flags to set when a window of this class is hosted by a dock node (it doesn’t have to be selected!)
bool DockingAlwaysTabBar;Set to True to enforce single floating windows of this class always having their own docking node (equivalent of setting the global io.ConfigDockingAlwaysTabBar)
bool DockingAllowUnclassed;Set to True to allow windows of this class to be docked/merged with an unclassed window. // FIXME-DOCK: Move to DockNodeFlags override?
void* PlatformIconData;[EXPERIMENTAL] Pass opaque data for Platform backend to handle.
ImGuiWindowClass::ImGuiWindowClass
ImGuiWindowClass();

ImGuiPayload (struct)

struct ImGuiPayload

Data payload for Drag and Drop operations: AcceptDragDropPayload(), GetDragDropPayload()

Member
void* Data;Data (copied and owned by dear imgui)
int DataSize;Data size
ImGuiID SourceId;Source item id
ImGuiID SourceParentId;Source parent id (if available)
int DataFrameCount;Data timestamp
bool Preview;Set when AcceptDragDropPayload() was called and mouse has been hovering the target item (nb: handle overlapping drag targets)
bool Delivery;Set when AcceptDragDropPayload() was called and mouse button is released over the target item.
ImGuiPayload::ImGuiPayload
ImGuiPayload();
ImGuiPayload::Clear
void Clear();

(private API)

ImGuiPayload::IsDataType
bool IsDataType(const char* type) const;

(private API)

ImGuiPayload::IsPreview
bool IsPreview() const;

(private API)

ImGuiPayload::IsDelivery
bool IsDelivery() const;

(private API)

Helpers

Helper: Unicode defines

ImGuiOnceUponAFrame (struct)

struct ImGuiOnceUponAFrame

Helper: Execute a block of code at maximum once a frame. Convenient if you want to quickly create a UI within deep-nested code that runs multiple times every frame.

Usage: static ImGuiOnceUponAFrame oaf; if (oaf) ImGui::Text("This will be called only once per frame");
Member
mutable int RefFrame;
ImGuiOnceUponAFrame::ImGuiOnceUponAFrame
ImGuiOnceUponAFrame();

ImGuiTextFilter (struct)

struct ImGuiTextFilter

See it live: Widgets › Text Filter (also used in 4 other sections)

Widgets › Text Filter
Code from the demo
HelpMarker("Not a widget per-se, but ImGuiTextFilter is a helper to perform simple filtering on text strings.");
static ImGuiTextFilter filter;
Member
int _CountExclude;[Internal] >= 0 count of leading exclude
ImGuiTextFilter::ImGuiTextFilter
IMGUI_API ImGuiTextFilter(const char* default_filter = "");
ImGuiTextFilter::PassFilter
IMGUI_API bool PassFilter(const char* text, const char* text_end = NULL) const;

See it live: Widgets › Text Filter (also used in 4 other sections)

Widgets › Text Filter
Code from the demo
const char* lines[] = { "aaa1.c", "bbb1.c", "ccc1.c", "aaa2.cpp", "bbb2.cpp", "ccc2.cpp", "abc.h", "hello, world" };
for (const char* item : lines)
    if (filter.PassFilter(item))
        ImGui::TextUnformatted(item);
ImGuiTextFilter::Build
IMGUI_API void Build();

Update internal data when filter changes

ImGuiTextFilter::Clear
inline void Clear();

(private API)

Clear filter

ImGuiTextFilter::IsActive
inline bool IsActive() const;

(private API)

Useful if you need e.g. an alternative code-path when there are no filters

ImGuiTextFilter::Draw
IMGUI_API bool Draw(const char* label = "Filter");

Helper to call InputText() + Build() when buffer is changed.

ImGuiTextFilter::DrawWithHint
IMGUI_API bool DrawWithHint(const char* label = "Filter", const char* hint = "incl -excl");

See it live: Widgets › Text Filter (also used in 3 other sections)

Widgets › Text Filter
Code from the demo
ImGui::SetNextItemWidth(-FLT_MIN);
filter.DrawWithHint("##Filter", "Filter (incl -excl)");

ImGuiTextBuffer (struct)

struct ImGuiTextBuffer

Helper: Growable text buffer for logging/accumulating text (this could be called ‘ImGuiTextBuilder’ / ‘ImGuiStringBuilder’)

Member
ImVector<char> Buf;
ImGuiTextBuffer::ImGuiTextBuffer
ImGuiTextBuffer();
ImGuiTextBuffer::begin
const char* begin() const;

(private API)

ImGuiTextBuffer::end
const char* end() const;

(private API)

Buf is zero-terminated, so end() will point on the zero-terminator

ImGuiTextBuffer::size
int size() const;

(private API)

ImGuiTextBuffer::empty
bool empty() const;

(private API)

ImGuiTextBuffer::clear
void clear();

(private API)

ImGuiTextBuffer::resize
void resize(int size);

(private API)

Similar to resize(0) on ImVector: empty string but don’t free buffer.

ImGuiTextBuffer::reserve
void reserve(int capacity);

(private API)

ImGuiTextBuffer::c_str
const char* c_str() const;

(private API)

ImGuiTextBuffer::append
IMGUI_API void append(const char* str, const char* str_end = NULL);
ImGuiTextBuffer::appendf
IMGUI_API void appendf(const char* fmt, ...) ;

ImGuiStoragePair (struct)

struct ImGuiStoragePair

[Internal] Key+Value for ImGuiStorage

Member
ImGuiID key;
ImGuiStoragePair::ImGuiStoragePair
ImGuiStoragePair(ImGuiID _key, int _val);
ImGuiStoragePair(ImGuiID _key, float _val);
ImGuiStoragePair(ImGuiID _key, void* _val);

ImGuiStorage (struct)

struct ImGuiStorage

Helper: Key->Value storage
Typically you don’t have to worry about this since a storage is held within each Window.
We use it to e.g. store collapse state for a tree (Int 0/1)
This is optimized for efficient lookup (dichotomy into a contiguous buffer) and rare insertion (typically tied to user interactions aka max once a frame)
You can use it as custom user storage for temporary values. Declare your own storage if, for example:

ImGuiStorage::Clear
void Clear();
ImGuiStorage::GetInt
IMGUI_API int GetInt(ImGuiID key, int default_val = 0) const;
ImGuiStorage::SetInt
IMGUI_API void SetInt(ImGuiID key, int val);
ImGuiStorage::GetBool
IMGUI_API bool GetBool(ImGuiID key, bool default_val = false) const;
ImGuiStorage::SetBool
IMGUI_API void SetBool(ImGuiID key, bool val);
ImGuiStorage::GetFloat
IMGUI_API float GetFloat(ImGuiID key, float default_val = 0.0f) const;
ImGuiStorage::SetFloat
IMGUI_API void SetFloat(ImGuiID key, float val);
ImGuiStorage::GetVoidPtr
IMGUI_API void* GetVoidPtr(ImGuiID key) const;

default_val is None

ImGuiStorage::SetVoidPtr
IMGUI_API void SetVoidPtr(ImGuiID key, void* val);
ImGuiStorage::GetIntRef
IMGUI_API int* GetIntRef(ImGuiID key, int default_val = 0);
     float* pvar = ImGui::GetFloatRef(key); ImGui::SliderFloat("var", pvar, 0, 100.0); some_var += *pvar;
ImGuiStorage::GetBoolRef
IMGUI_API bool* GetBoolRef(ImGuiID key, bool default_val = false);
ImGuiStorage::GetFloatRef
IMGUI_API float* GetFloatRef(ImGuiID key, float default_val = 0.0f);
ImGuiStorage::BuildSortByKey
IMGUI_API void BuildSortByKey();

Advanced: for quicker full rebuild of a storage (instead of an incremental one), you may add all your contents and then sort once.

ImGuiStorage::SetAllInt
IMGUI_API void SetAllInt(int val);

Obsolete: use on your own storage if you know only integer are being stored (open/close all tree nodes)

ImGuiListClipperFlags_ (enum)

enum ImGuiListClipperFlags_

The type of its values in the API: typedef int ImGuiListClipperFlags;

Flags for ImGuiListClipper (currently not fully exposed in function calls: a future refactor will likely add this to ImGuiListClipper::Begin function equivalent)

MemberValue
ImGuiListClipperFlags_None = 00
ImGuiListClipperFlags_NoSetTableRowCounters = 1 << 01 << 0[Internal] Disabled modifying table row counters. Avoid assumption that 1 clipper item == 1 table row.

ImGuiListClipper (struct)

struct ImGuiListClipper

Helper: Manually clip large list of items.
If you have lots evenly spaced items and you have random access to the list, you can perform coarse clipping based on visibility to only submit items that are in view.
The clipper calculates the range of visible items and advance the cursor to compensate for the non-visible items we have skipped. (Dear ImGui already clip items based on their bounds but: it needs to first layout the item to do so, and generally fetching/submitting your own data incurs additional cost. Coarse clipping using ImGuiListClipper allows you to easily scale using lists with tens of thousands of items without a problem)
Usage:

  ImGuiListClipper clipper;
  clipper.Begin(1000);         // We have 1000 elements, evenly spaced.

while (clipper.Step()) for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) ImGui::Text(“line number %d”, i); Generally what happens is:

Member
int DisplayStart;First item to display, updated by each call to Step()
int DisplayEnd;End of items to display (exclusive)
int UserIndex;Helper storage for user convenience/code. Optional, and otherwise unused if you don’t use it.
int ItemsCount;[Internal] Number of items
float ItemsHeight;[Internal] Height of item after a first step and item submission can calculate it
ImGuiListClipperFlags Flags;[Internal] Flags, currently not yet well exposed.
double StartPosY;[Internal] Cursor position at the time of Begin() or after table frozen rows are all processed
double StartSeekOffsetY;[Internal] Account for frozen rows in a table and initial loss of precision in very large windows.
ImGuiContext* Ctx;[Internal] Parent UI context
void* TempData;[Internal] Internal data
ImGuiListClipper::ImGuiListClipper
IMGUI_API ImGuiListClipper();

items_count: Use INT_MAX if you don’t know how many items you have (in which case the cursor won’t be advanced in the final step, and you can call SeekCursorForItem() manually if you need) items_height: Use -1.0 to be calculated automatically on first step. Otherwise pass in the distance between your items, typically GetTextLineHeightWithSpacing() or GetFrameHeightWithSpacing().

ImGuiListClipper::Begin
IMGUI_API void Begin(int items_count, float items_height = -1.0f);
ImGuiListClipper::End
IMGUI_API void End();

Automatically called on the last call of Step() that returns False.

ImGuiListClipper::Step
IMGUI_API bool Step();

Call until it returns False. The DisplayStart/DisplayEnd fields will be set and you can process/draw those items.

ImGuiListClipper::IncludeItemByIndex
inline void IncludeItemByIndex(int item_index);

Call IncludeItemByIndex() or IncludeItemsByIndex() BEFORE first call to Step() if you need a range of items to not be clipped, regardless of their visibility. (Due to alignment / padding of certain items it is possible that an extra item may be included on either end of the display range). (private API)

ImGuiListClipper::IncludeItemsByIndex
IMGUI_API void IncludeItemsByIndex(int item_begin, int item_end);

item_end is exclusive e.g. use (42, 42+1) to make item 42 never clipped.

ImGuiListClipper::SeekCursorForItem
IMGUI_API void SeekCursorForItem(int item_index);

Seek cursor toward given item. This is automatically called while stepping.

Helpers: ImVec2/ImVec4 operators

Helpers macros to generate 32-bit encoded colors

ImColor (struct)

struct ImColor

Helper: ImColor() implicitly converts colors to either ImU32 (packed 4x1 byte) or ImVec4 (4x1 float)
Prefer using IM_COL32() macros if you want a guaranteed compile-time ImU32 for usage with ImDrawList API.
**Avoid storing ImColor! Store either u32 of ImVec4. This is not a full-featured color class. MAY OBSOLETE.
**None of the ImGui API are using ImColor directly but you can use it as a convenience to pass colors in either ImU32 or ImVec4 formats. Explicitly cast to ImU32 or ImVec4 if needed.

Member
ImVec4 Value;
ImColor::ImColor
constexpr ImColor();
constexpr ImColor(float r, float g, float b, float a = 1.0f) : Value(r, g, b, a);
constexpr ImColor(const ImVec4& col) : Value(col);
constexpr ImColor(int r, int g, int b, int a = 255) : Value((float)r * (1.0f / 255.0f), (float)g * (1.0f / 255.0f), (float)b * (1.0f / 255.0f), (float)a* (1.0f / 255.0f));
constexpr ImColor(ImU32 rgba) : Value((float)((rgba >> IM_COL32_R_SHIFT) & 0xFF) * (1.0f / 255.0f), (float)((rgba >> IM_COL32_G_SHIFT) & 0xFF) * (1.0f / 255.0f), (float)((rgba >> IM_COL32_B_SHIFT) & 0xFF) * (1.0f / 255.0f), (float)((rgba >> IM_COL32_A_SHIFT) & 0xFF) * (1.0f / 255.0f));
ImColor::SetHSV
inline void SetHSV(float h, float s, float v, float a = 1.0f);

(private API)

FIXME-OBSOLETE: May need to obsolete/cleanup those helpers.

ImColor::HSV
static ImColor HSV(float h, float s, float v, float a = 1.0f);

(private API)

Multi-Select API flags and structures

Multi-selection system

Documentation at: https://github.com/ocornut/imgui/wiki/Multi-Select

ImGuiMultiSelectFlags_ (enum)

enum ImGuiMultiSelectFlags_

Flags for BeginMultiSelect()

MemberValue
ImGuiMultiSelectFlags_None = 00
ImGuiMultiSelectFlags_SingleSelect = 1 << 01 << 0Disable selecting more than one item. This is available to allow single-selection code to share same code/logic if desired. It essentially disables the main purpose of BeginMultiSelect() tho!
ImGuiMultiSelectFlags_NoSelectAll = 1 << 11 << 1Disable Ctrl+A shortcut to select all.
ImGuiMultiSelectFlags_NoRangeSelect = 1 << 21 << 2Disable Shift+selection mouse/keyboard support (useful for unordered 2D selection). With BoxSelect is also ensure contiguous SetRange requests are not combined into one. This allows not handling interpolation in SetRange requests.
ImGuiMultiSelectFlags_NoAutoSelect = 1 << 31 << 3Disable selecting items when navigating (useful for e.g. supporting range-select in a list of checkboxes).
ImGuiMultiSelectFlags_NoAutoClear = 1 << 41 << 4Disable clearing selection when navigating or selecting another one (generally used with ImGuiMultiSelectFlags_NoAutoSelect. useful for e.g. supporting range-select in a list of checkboxes).
ImGuiMultiSelectFlags_NoAutoClearOnReselect = 1 << 51 << 5Disable clearing selection when clicking/selecting an already selected item.
ImGuiMultiSelectFlags_BoxSelect1d = 1 << 61 << 6Enable box-selection with same width and same x pos items (e.g. full row Selectable()). Box-selection works better with little bit of spacing between items hit-box in order to be able to aim at empty space.
ImGuiMultiSelectFlags_BoxSelect2d = 1 << 71 << 7Enable box-selection with varying width or varying x pos items support (e.g. different width labels, or 2D layout/grid). This is slower: alters clipping logic so that e.g. horizontal movements will update selection of normally clipped items.
ImGuiMultiSelectFlags_BoxSelectNoScroll = 1 << 81 << 8Disable scrolling when box-selecting and moving mouse near edges of scope.
ImGuiMultiSelectFlags_ClearOnEscape = 1 << 91 << 9Clear selection when pressing Escape while scope is focused.
ImGuiMultiSelectFlags_ClearOnClickVoid = 1 << 101 << 10Clear selection when clicking on empty location within scope.
ImGuiMultiSelectFlags_ScopeWindow = 1 << 111 << 11Scope for _BoxSelect and _ClearOnClickVoid is whole window (Default). Use if BeginMultiSelect() covers a whole window or used a single time in same window.
ImGuiMultiSelectFlags_ScopeRect = 1 << 121 << 12Scope for _BoxSelect and _ClearOnClickVoid is rectangle encompassing BeginMultiSelect()/EndMultiSelect(). Use if BeginMultiSelect() is called multiple times in same window.
ImGuiMultiSelectFlags_SelectOnAuto = 1 << 131 << 13Apply selection on mouse down when clicking on unselected item, on mouse up when clicking on selected item. (Default)
ImGuiMultiSelectFlags_SelectOnClickAlways = 1 << 141 << 14Apply selection on mouse down when clicking on any items. Prevents Drag and Drop from being used on multiple-selection, but allows e.g. BoxSelect to always reselect even when clicking inside an existing selection. (Excel style behavior)
ImGuiMultiSelectFlags_SelectOnClickRelease = 1 << 151 << 15Apply selection on mouse release when clicking an unselected item. Allow dragging an unselected item without altering selection.
ImGuiMultiSelectFlags_NavWrapX = 1 << 161 << 16[Temporary] Enable navigation wrapping on X axis. Provided as a convenience because we don’t have a design for the general Nav API for this yet. When the more general feature be public we may obsolete this flag in favor of new one.
ImGuiMultiSelectFlags_NoSelectOnRightClick = 1 << 171 << 17Disable default right-click processing, which selects item on mouse down, and is designed for context-menus.
ImGuiMultiSelectFlags_SelectOnMask_ = ImGuiMultiSelectFlags_SelectOnAuto | ImGuiMultiSelectFlags_SelectOnClickAlways | ImGuiMultiSelectFlags_SelectOnClickReleaseMultiSelectFlags_SelectOnAuto | MultiSelectFlags_SelectOnClickAlways | MultiSelectFlags_SelectOnClickRelease
ImGuiMultiSelectFlags_CheckboxMode_ = 1 << 201 << 20[Internal]

ImGuiMultiSelectIO (struct)

struct ImGuiMultiSelectIO

Main IO structure returned by BeginMultiSelect()/EndMultiSelect().
This mainly contains a list of selection requests.

Member
ImVector<ImGuiSelectionRequest> Requests;ms:w, app:r / ms:w app:r // Requests to apply to your selection data.
ImGuiSelectionUserData RangeSrcItem;ms:w app:r / // (If using clipper) Begin: Source item (often the first selected item) must never be clipped: use clipper.IncludeItemByIndex() to ensure it is submitted.
ImGuiSelectionUserData NavIdItem;ms:w, app:r / // (If using deletion) Last known SetNextItemSelectionUserData() value for NavId (if part of submitted items).
bool NavIdSelected;ms:w, app:r / app:r // (If using deletion) Last known selection state for NavId (if part of submitted items).
bool RangeSrcReset;app:w / ms:r // (If using deletion) Set before EndMultiSelect() to reset ResetSrcItem (e.g. if deleted selection).
int ItemsCount;ms:w, app:r / app:r // ‘int items_count’ parameter to BeginMultiSelect() is copied here for convenience, allowing simpler calls to your ApplyRequests handler. Not used internally.

ImGuiSelectionRequestType (enum)

enum ImGuiSelectionRequestType

Selection request type

MemberValue
ImGuiSelectionRequestType_None = 00
ImGuiSelectionRequestType_SetAll1Request app to clear selection (if Selected==False) or select all items (if Selected==True). We cannot set RangeFirstItem/RangeLastItem as its contents is entirely up to user (not necessarily an index)
ImGuiSelectionRequestType_SetRange2Request app to select/unselect [RangeFirstItem..RangeLastItem] items (inclusive) based on value of Selected. Only EndMultiSelect() request this, app code can read after BeginMultiSelect() and it will always be False.

ImGuiSelectionRequest (struct)

struct ImGuiSelectionRequest

Selection request item

Member
ImGuiSelectionRequestType Type;ms:w, app:r / ms:w, app:r // Request type. You’ll most often receive 1 Clear + 1 SetRange with a single-item range.
bool Selected;ms:w, app:r / ms:w, app:r // Parameter for SetAll/SetRange requests (True = select, False = unselect)
ImS8 RangeDirection;/ ms:w app:r // Parameter for SetRange request: +1 when RangeFirstItem comes before RangeLastItem, -1 otherwise. Useful if you want to preserve selection order on a backward Shift+Click.
ImGuiSelectionUserData RangeFirstItem;/ ms:w, app:r // Parameter for SetRange request (this is generally == RangeSrcItem when shift selecting from top to bottom).
ImGuiSelectionUserData RangeLastItem;/ ms:w, app:r // Parameter for SetRange request (this is generally == RangeSrcItem when shift selecting from bottom to top). Inclusive!

ImGuiSelectionBasicStorage (struct)

struct ImGuiSelectionBasicStorage

Optional helper to store multi-selection state + apply multi-selection requests.

Member
int Size;// Number of selected items, maintained by this helper.
bool PreserveOrder;= False // GetNextSelectedItem() will return ordered selection (currently implemented by two additional sorts of selection. Could be improved)
void* UserData;= None // User data for use by adapter function // e.g. selection.UserData = (None*)my_items;
int _SelectionOrder;[Internal] Increasing counter to store selection order
ImGuiStorage _Storage;[Internal] Selection set. Think of this as similar to e.g. std::set<ImGuiID>. Prefer not accessing directly: iterate with GetNextSelectedItem().
ImGuiSelectionBasicStorage::ImGuiSelectionBasicStorage
IMGUI_API ImGuiSelectionBasicStorage();
ImGuiSelectionBasicStorage::ApplyRequests
IMGUI_API void ApplyRequests(ImGuiMultiSelectIO* ms_io);

Apply selection requests coming from BeginMultiSelect() and EndMultiSelect() functions. It uses ‘items_count’ passed to BeginMultiSelect()

ImGuiSelectionBasicStorage::Contains
IMGUI_API bool Contains(ImGuiID id) const;

Query if an item id is in selection.

ImGuiSelectionBasicStorage::Clear
IMGUI_API void Clear();

Clear selection

ImGuiSelectionBasicStorage::Swap
IMGUI_API void Swap(ImGuiSelectionBasicStorage& r);

Swap two selections

ImGuiSelectionBasicStorage::SetItemSelected
IMGUI_API void SetItemSelected(ImGuiID id, bool selected);

Add/remove an item from selection (generally done by ApplyRequests() function)

ImGuiSelectionBasicStorage::GetStorageIdFromIndex
inline ImGuiID GetStorageIdFromIndex(int idx);

(private API)

Convert index to item id based on provided adapter.

ImGuiSelectionExternalStorage (struct)

struct ImGuiSelectionExternalStorage

Optional helper to apply multi-selection requests to existing randomly accessible storage.
Convenient if you want to quickly wire multi-select API on e.g. an array of bool or items storing their own selection state.

Member
void* UserData;User data for use by adapter function // e.g. selection.UserData = (None*)my_items;
ImGuiSelectionExternalStorage::ImGuiSelectionExternalStorage
IMGUI_API ImGuiSelectionExternalStorage();
ImGuiSelectionExternalStorage::ApplyRequests
IMGUI_API void ApplyRequests(ImGuiMultiSelectIO* ms_io);

Apply selection requests by using AdapterSetItemSelected() calls

Drawing API

Hold a series of drawing commands. The user provides a renderer for ImDrawData which essentially contains an array of ImDrawList.

ImDrawIdx: vertex index. [Compile-time configurable type]

ImDrawCallback: Draw callbacks for advanced uses [configurable type: override in imconfig.h]
NB: You most likely do NOT need to use draw callbacks just to create your own widget or customized UI rendering, you can poke into the draw list for that! Draw callback may be useful for example to:
A) Change your GPU render state,
B) render a complex 3D scene inside a UI element without an intermediate texture/render target, etc.
The expected behavior from your rendering function is ‘if (cmd.UserCallback != None) { cmd.UserCallback(parent_list, cmd); } else { RenderTriangles() }’
If you want to override the signature of ImDrawCallback, you can simply use e.g. ‘#define ImDrawCallback MyDrawCallback’ (in imconfig.h) + update rendering backend accordingly.

ImDrawCmd (struct)

struct ImDrawCmd

Typically, 1 command = 1 GPU draw call (unless command is a callback)

Member
ImVec4 ClipRect;4*4 // Clipping rectangle (x1, y1, x2, y2). Subtract ImDrawData->DisplayPos to get clipping rectangle in “viewport” coordinates
ImTextureRef TexRef;16 // Reference to a font/texture atlas (where backend called ImTextureData::SetTexID()) or to a user-provided texture ID (via e.g. ImGui::Image() calls). Both will lead to a ImTextureID value.
unsigned int VtxOffset;4 // Start offset in vertex buffer. ImGuiBackendFlags_RendererHasVtxOffset: always 0, otherwise may be >0 to support meshes larger than 64K vertices with 16-bit indices.
unsigned int IdxOffset;4 // Start offset in index buffer.
unsigned int ElemCount;4 // Number of indices (multiple of 3) to be rendered as triangles. Vertices are stored in the callee ImDrawList’s vtx_buffer[] array, indices in idx_buffer[].
void* UserCallbackData;4-8 // Callback user data (when UserCallback != None). If called AddCallback() with size == 0, this is a copy of the AddCallback() argument. If called AddCallback() with size > 0, this is pointing to a buffer where data is stored.
int UserCallbackDataSize;4 // Size of callback user data when using storage, otherwise 0.
int UserCallbackDataOffset;4 // [Internal] Offset of callback user data when using storage, otherwise -1.
ImDrawCmd::ImDrawCmd
ImDrawCmd();

Also ensure our padding fields are zeroed

ImDrawCmd::GetTexID
inline ImTextureID GetTexID() const;

(private API)

== (TexRef._TexData ? TexRef._TexData->TexID : TexRef._TexID)

Since 1.83: returns ImTextureID associated with this draw call. Warning: DO NOT assume this is always same as ‘TextureId’ (we will change this function for an upcoming feature)
Since 1.92: removed ImDrawCmd::TextureId field, the getter function must be used!

Vertex layout

ImDrawVert (struct)

struct ImDrawVert
Member
ImVec2 pos;
ImVec2 uv;
ImU32 col;

ImDrawCmdHeader (struct)

struct ImDrawCmdHeader

[Internal] For use by ImDrawList

Member
ImVec4 ClipRect;
ImTextureRef TexRef;
unsigned int VtxOffset;

ImDrawChannel (struct)

struct ImDrawChannel

[Internal] For use by ImDrawListSplitter

Member
ImVector<ImDrawCmd> _CmdBuffer;
ImVector<ImDrawIdx> _IdxBuffer;

ImDrawListSplitter (struct)

struct ImDrawListSplitter

Split/Merge functions are used to split the draw list into different layers which can be drawn into out of order.
This is used by the Columns/Tables API, so items of each column can be batched together in a same draw call.

Member
int _Current;Current channel number (0)
int _Count;Number of active channels (1+)
ImVector<ImDrawChannel> _Channels;Draw channels (not resized down so _Count might be < Channels.Size)
ImDrawListSplitter::ImDrawListSplitter
inline ImDrawListSplitter();
ImDrawListSplitter::Clear
inline void Clear();

(private API)

Do not clear Channels[] so our allocations are reused next frame

ImDrawListSplitter::ClearFreeMemory
IMGUI_API void ClearFreeMemory();
ImDrawListSplitter::Split
IMGUI_API void Split(ImDrawList* draw_list, int count);
ImDrawListSplitter::Merge
IMGUI_API void Merge(ImDrawList* draw_list);
ImDrawListSplitter::SetCurrentChannel
IMGUI_API void SetCurrentChannel(ImDrawList* draw_list, int channel_idx);

ImDrawFlags_ (enum)

enum ImDrawFlags_

The type of its values in the API: typedef int ImDrawFlags;

Flags for ImDrawList functions

MemberValue
ImDrawFlags_None = 00
ImDrawFlags_RoundTopLeft = 1 << 41 << 4OK -- // Round top-left corner only (when ‘rounding > 0.0’, we default to all corners).
ImDrawFlags_RoundTopRight = 1 << 51 << 5OK -- // Round top-right corner only (when ‘rounding > 0.0’, we default to all corners).
ImDrawFlags_RoundBottomLeft = 1 << 61 << 6OK -- // Round bottom-left corner only (when ‘rounding > 0.0’, we default to all corners).
ImDrawFlags_RoundBottomRight = 1 << 71 << 7OK -- // Round bottom-right corner only (when ‘rounding > 0.0’, we default to all corners).
ImDrawFlags_RoundNone = 1 << 81 << 8OK -- // Disable rounding even when ‘rounding > 0.0’. This value is NOT zero, it is NOT an implicit flag!
ImDrawFlags_RoundAll = ImDrawFlags_RoundTopLeft | ImDrawFlags_RoundTopRight | ImDrawFlags_RoundBottomLeft | ImDrawFlags_RoundBottomRightImDrawFlags_.round_top_left | ImDrawFlags_.round_top_right | ImDrawFlags_.round_bottom_left | ImDrawFlags_.round_bottom_right(Default!!)
ImDrawFlags_RoundTop = ImDrawFlags_RoundTopLeft | ImDrawFlags_RoundTopRightImDrawFlags_.round_top_left | ImDrawFlags_.round_top_right
ImDrawFlags_RoundBottom = ImDrawFlags_RoundBottomLeft | ImDrawFlags_RoundBottomRightImDrawFlags_.round_bottom_left | ImDrawFlags_.round_bottom_right
ImDrawFlags_RoundLeft = ImDrawFlags_RoundBottomLeft | ImDrawFlags_RoundTopLeftImDrawFlags_.round_bottom_left | ImDrawFlags_.round_top_left
ImDrawFlags_RoundRight = ImDrawFlags_RoundBottomRight | ImDrawFlags_RoundTopRightImDrawFlags_.round_bottom_right | ImDrawFlags_.round_top_right
ImDrawFlags_Closed = 1 << 91 << 9OK -- // PathStroke(), AddPolyline(): specify that shape should be closed.
ImDrawFlags_JoinMiter = 1 << 101 << 10OK -- // PathStroke(), AddPolyline(): use miter joins/corners only. This assumes that the input polyline does not have corners sharper than 90 degrees. Slightly faster.
ImDrawFlags_CapSquare = 1 << 111 << 11OK -- // PathStroke(), AddPolyline(): use square cap line ends.
ImDrawFlags_AAFill = 1 << 121 << 12OK* OK(1) // Enable anti-aliasing for Filled shapes.
ImDrawFlags_AALines = 1 << 131 << 13OK* OK(1) // Enable anti-aliasing for Strokes (lines, borders).
ImDrawFlags_AALineEnds = 1 << 141 << 14OK OK(0) // Enable anti-aliasing for Strokes Ends. Requires AALines to also be enabled. Useful on thick strokes or for precise continuity of multiple lines. A little more costly.
ImDrawFlags_StrokeInside = 1 << 171 << 17OK -- // Draw stroke inside of the shape outline (default for closed shapes and AddLineH, AddLineV functions)
ImDrawFlags_StrokeCenter = 2 << 172 << 17OK -- // Draw stroke at the center of the shape outline (default for paths, bezier, and AddLine functions)
ImDrawFlags_StrokeCenterBiased = 3 << 173 << 17OK -- // Draw stroke at the center of the shape outline, so that half thickness rounded down will be outside, and the rest inside the shape outline. Useful for axis-aligned shapes: AddLineH, AddLineV, AddRect. Does not animate well!
ImDrawFlags_StrokeOutside = 4 << 174 << 17OK -- // Draw stroke outside of the shape outline
ImDrawFlags_StrokeLegacy = 7 << 177 << 17OK OK(0) // Use legacy positioning + enable JoinMiter + disable AALineEnds. Must be all bits set.
ImDrawFlags_TextNoPixelSnap = 1 << 201 << 20OK OK(0) // Disable automatically snapping AddText() calls to pixel boundaries.
ImDrawFlags_UseTexForRoundCorners = 1 << 211 << 21-- OK(1) // Enable using textures instead of strokes to draw rounded corners/circles where possible (faster). Used by default unless ‘ImFontAtlasFlags_NoBakedRoundCorners’ is enabled in the font atlas.
ImDrawFlags_UseVtxOffset = 1 << 221 << 22-- OK(1) // Can emit ‘VtxOffset > 0’ to allow large meshes with 16-bit ImDrawIdx. Used by default when ‘ImGuiBackendFlags_RendererHasVtxOffset’ is enabled by the backend.
ImDrawFlags_AllowTexForRoundCorners_= 1 << 231 << 23-- OK(1) // [Internal]
ImDrawFlags_RoundMask_ = ImDrawFlags_RoundAll | ImDrawFlags_RoundNoneImDrawFlags_.round_all | ImDrawFlags_.round_none[Internal]
ImDrawFlags_AllowInPushScope_ = ImDrawFlags_AAFill | ImDrawFlags_AALines | ImDrawFlags_AALineEnds | ImDrawFlags_StrokeLegacy | ImDrawFlags_TextNoPixelSnap | ImDrawFlags_UseTexForRoundCorners | ImDrawFlags_UseVtxOffset | ImDrawFlags_RoundMask_ImDrawFlags_.aa_fill | ImDrawFlags_.aa_lines | ImDrawFlags_.aa_line_ends | ImDrawFlags_.stroke_legacy | ImDrawFlags_.text_no_pixel_snap | ImDrawFlags_.use_tex_for_round_corners | ImDrawFlags_.use_vtx_offset | ImDrawFlags_.round_mask_[Internal] Values allowed in PushDrawFlag() scope.
ImDrawFlags_AllowInFrameScope_ = ImDrawFlags_AllowInPushScope_ | ImDrawFlags_AllowTexForRoundCorners_ImDrawFlags_.allow_in_push_scope_ | ImDrawFlags_.allow_tex_for_round_corners_
ImDrawFlags_StrokeMask_ = 0x07 << 170x07 << 17[Internal]
ImDrawFlags_InvalidMask_ = ~0x7FFFFFF0~0x7FFFFFF0[Internal] == 0x8000000F. Reserved to detect misuses.

ImDrawList (struct)

struct ImDrawList

See it live: Examples › Custom rendering › Primitives (also used in 9 other sections)

Examples › Custom rendering › Primitives
Code from the demo
ImGui::PushItemWidth(-ImGui::GetFontSize() * 15);
ImGui::PushItemFlag(ImGuiItemFlags_LiveEditOnInput, true);
ImDrawList* draw_list = ImGui::GetWindowDrawList();

Draw command list
This is the low-level list of polygons that ImGui:: functions are filling. At the end of the frame, all command lists are passed to your ImGuiIO::RenderDrawListFn function for rendering.
Each dear imgui window contains its own ImDrawList. You can use ImGui::GetWindowDrawList() to access the current window draw list and draw custom primitives.
You can interleave normal ImGui:: calls and adding primitives to the current draw list.
In single viewport mode, top-left is == GetMainViewport()->Pos (generally 0,0), bottom-right is == GetMainViewport()->Pos+Size (generally io.DisplaySize).
You are totally free to apply whatever transformation matrix you want to the data (depending on the use of the transformation you may want to apply it to ClipRect as well!)
Important: Primitives are always added to the list and not culled (culling is done at higher-level by ImGui:: functions), if you use this API a lot consider coarse culling your drawn objects.

Member
ImVector<ImDrawCmd> CmdBuffer;Draw commands. Typically 1 command = 1 GPU draw call, unless the command is a callback.
ImVector<ImDrawIdx> IdxBuffer;Index buffer. Each command consume ImDrawCmd::ElemCount of those
ImVector<ImDrawVert> VtxBuffer;Vertex buffer.
ImDrawFlags Flags;Current flags for drawing primitives. Alter with PushDrawFlag()/PopDrawFlags() to adjust defaults to a given scope.
unsigned int _VtxCurrentIdx;[Internal] generally == VtxBuffer.Size unless we are past 64K vertices, in which case this gets reset to 0.
ImDrawListSharedData* _Data;Pointer to shared draw data (you can use ImGui::GetDrawListSharedData() to get the one from current ImGui context)
ImDrawVert* _VtxWritePtr;[Internal] point within VtxBuffer.Data after each add command (to avoid using the ImVector<> operators too much)
ImDrawIdx* _IdxWritePtr;[Internal] point within IdxBuffer.Data after each add command (to avoid using the ImVector<> operators too much)
ImVector<ImVec2> _Path;[Internal] current path building
ImDrawCmdHeader _CmdHeader;[Internal] template of active commands. Fields should match those of CmdBuffer.back().
ImDrawListSplitter _Splitter;[Internal] for channels api (note: prefer using your own persistent instance of ImDrawListSplitter!)
ImVector<ImVec4> _ClipRectStack;[Internal]
ImVector<ImTextureRef> _TextureStack;[Internal]
ImVector<ImU8> _CallbacksDataBuf;[Internal]
float _FringeScale;[Internal] anti-alias fringe is scaled by this value, this helps to keep things sharp while zooming at vertex buffer content
float _InvFringeScale;[internal] 1.0 / _FringeScale // FIXME: Consider renaming to _PixelDensity.
bool _FringeScaleIsInteger;[Internal] True if 1/_FringeScale is a whole number, used to select fast path for rendering
const char* _OwnerName;Pointer to owner window’s name for debugging # (const)
ImDrawList::ImDrawList
IMGUI_API ImDrawList(ImDrawListSharedData* shared_data);

If you want to create ImDrawList instances, pass them ImGui::GetDrawListSharedData(). (advanced: you may create and use your own ImDrawListSharedData so you can use ImDrawList without ImGui, but that’s more involved)

ImDrawList::PushClipRect
IMGUI_API void PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect = false);

See it live: Examples › Custom rendering › Canvas (also used in 1 other section)

Code from the demo
draw_list->PushClipRect(canvas_p0, canvas_p1, true);

Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling)

ImDrawList::PushClipRectFullScreen
IMGUI_API void PushClipRectFullScreen();
ImDrawList::PopClipRect
IMGUI_API void PopClipRect();

See it live: Examples › Custom rendering › Canvas (also used in 1 other section)

Code from the demo
draw_list->PopClipRect();
ImDrawList::PushTexture
IMGUI_API void PushTexture(ImTextureRef tex_ref);
ImDrawList::PopTexture
IMGUI_API void PopTexture();
ImDrawList::PushDrawFlag
IMGUI_API void PushDrawFlag(ImDrawFlags flags, bool enabled);

See it live: Examples › Custom rendering › Primitives

Examples › Custom rendering › Primitives
Code from the demo
draw_list->PushDrawFlag(ImDrawFlags_AllowInPushScope_, false); // Reset all existing (very unusual: done for this demo)
draw_list->PushDrawFlag(scope_flags, true);

[BETA] Please notify me if you are using this.

ImDrawList::PopDrawFlag
IMGUI_API void PopDrawFlag();

See it live: Examples › Custom rendering › Primitives

Examples › Custom rendering › Primitives
Code from the demo
ImGui::Dummy(ImVec2(step * 15.5f, step * 4.0f));
draw_list->PopDrawFlag();
ImDrawList::GetClipRectMin
inline ImVec2 GetClipRectMin() const;

(private API)

ImDrawList::GetClipRectMax
inline ImVec2 GetClipRectMax() const;

(private API)

ImDrawList::AddLine
IMGUI_API void AddLine(const ImVec2& p1, const ImVec2& p2, ImU32 col, float thickness = 1.0f, ImDrawFlags flags = 0);

See it live: Examples › Custom rendering › Primitives (also used in 2 other sections)

Examples › Custom rendering › Primitives
Code from the demo
const float off = (float)(int)(sz * 0.4f);
draw_list->AddLineH(x, x + sz, y, col, th, flags);
draw_list->AddLine({ x, y + off }, { x + sz, y + off }, col, th, flags);
ImDrawList::AddLineH
IMGUI_API void AddLineH(float min_x, float max_x, float y, ImU32 col, float thickness = 1.0f, ImDrawFlags flags = 0);

See it live: Examples › Custom rendering › Primitives (also used in 1 other section)

Examples › Custom rendering › Primitives
Code from the demo
const float off = (float)(int)(sz * 0.4f);
draw_list->AddLineH(x, x + sz, y, col, th, flags);
ImDrawList::AddLineV
IMGUI_API void AddLineV(float x, float min_y, float max_y, ImU32 col, float thickness = 1.0f, ImDrawFlags flags = 0);

See it live: Examples › Custom rendering › Primitives (also used in 1 other section)

Examples › Custom rendering › Primitives
Code from the demo
draw_list->AddLineH(x, x + sz, y, col, th, flags);
draw_list->AddLine({ x, y + off }, { x + sz, y + off }, col, th, flags);
x += step;
draw_list->AddLineV(x, y, y + sz, col, th, flags);
ImDrawList::AddRect
IMGUI_API void AddRect(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0.0f, float thickness = 1.0f, ImDrawFlags flags = 0);

See it live: Examples › Custom rendering › Primitives (also used in 3 other sections)

Examples › Custom rendering › Primitives
Code from the demo
draw_list->AddNgon({ x + half_sz, y + half_sz }, half_sz, col, ngon_segments, th, flags);               x += step;  // N-gon
draw_list->AddCircle({ x + half_sz, y + half_sz }, half_sz, col, circle_segments, th, flags);           x += step;  // Circle
draw_list->AddEllipse({ x + half_sz, y + half_sz }, { half_sz, sz * 0.3f }, col, -0.3f, circle_segments, th, flags); x += step;  // Ellipse
draw_list->AddRect({ x, y }, { x + sz, y + sz }, col, 0.0f, th, flags);                                 x += step;  // Square

a: upper-left, b: lower-right (== upper-left + size)

ImDrawList::AddRectFilled
IMGUI_API void AddRectFilled(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0.0f, ImDrawFlags flags = 0);

See it live: Examples › Custom rendering › Primitives (also used in 7 other sections)

Examples › Custom rendering › Primitives
Code from the demo
x = start_pos.x;
bool draw_fill = (row == 2 || row == 3);
bool draw_strokes = (row == 0 || row == 1 || row == 3);
if (draw_fill)
{
    // FILLED SHAPES
    const ImU32 col = ImColor(colf_fill);
    draw_list->AddNgonFilled({ x + half_sz, y + half_sz }, half_sz, col, ngon_segments);                x += step;  // N-gon
    draw_list->AddCircleFilled({ x + half_sz, y + half_sz }, half_sz, col, circle_segments);            x += step;  // Circle
    draw_list->AddEllipseFilled({ x + half_sz, y + half_sz }, { half_sz, sz * 0.3f }, col, -0.3f, circle_segments); x += step;// Ellipse
    draw_list->AddRectFilled({ x, y }, { x + sz, y + sz }, col, 0.0f, flags);                           x += step;  // Square
    draw_list->AddRectFilled({ x, y }, { x + sz, y + sz }, col, rounding, flags);                       x += step;  // Square with all rounded corners
    draw_list->AddRectFilled({ x, y }, { x + sz, y + sz }, col, rounding, flags | corners_tl_br);       x += step;  // Square with two rounded corners
    draw_list->AddTriangleFilled({ x + sz * 0.5f, y }, { x + sz, y + sz }, { x, y + sz }, col);         x += step;  // Triangle
...

a: upper-left, b: lower-right (== upper-left + size)

ImDrawList::AddRectFilledMultiColor
IMGUI_API void AddRectFilledMultiColor(const ImVec2& p_min, const ImVec2& p_max, ImU32 col_upr_left, ImU32 col_upr_right, ImU32 col_bot_right, ImU32 col_bot_left);

See it live: Examples › Custom rendering › Primitives

Examples › Custom rendering › Primitives
Code from the demo
ImGui::Text("Gradients");
ImVec2 gradient_size = ImVec2(ImGui::CalcItemWidth(), ImGui::GetFrameHeight());
ImDrawList::AddQuad
IMGUI_API void AddQuad(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness = 1.0f, ImDrawFlags flags = 0);
ImDrawList::AddQuadFilled
IMGUI_API void AddQuadFilled(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col);
ImDrawList::AddTriangle
IMGUI_API void AddTriangle(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col, float thickness = 1.0f, ImDrawFlags flags = 0);

See it live: Examples › Custom rendering › Primitives

Examples › Custom rendering › Primitives
Code from the demo
draw_list->AddRect({ x, y }, { x + sz, y + sz }, col, 0.0f, th, flags);                                 x += step;  // Square
draw_list->AddRect({ x, y }, { x + sz, y + sz }, col, rounding, th, flags);                             x += step;  // Square with all rounded corners
draw_list->AddRect({ x, y }, { x + sz, y + sz }, col, rounding, th, flags | corners_tl_br);             x += step;  // Square with two rounded corners
draw_list->AddTriangle({ x + sz * 0.5f, y }, { x + sz, y + sz }, { x, y + sz }, col, th, flags);        x += step;  // Triangle
ImDrawList::AddTriangleFilled
IMGUI_API void AddTriangleFilled(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col);

See it live: Examples › Custom rendering › Primitives

Examples › Custom rendering › Primitives
Code from the demo
draw_list->AddRectFilled({ x, y }, { x + sz, y + sz }, col, 0.0f, flags);                           x += step;  // Square
draw_list->AddRectFilled({ x, y }, { x + sz, y + sz }, col, rounding, flags);                       x += step;  // Square with all rounded corners
draw_list->AddRectFilled({ x, y }, { x + sz, y + sz }, col, rounding, flags | corners_tl_br);       x += step;  // Square with two rounded corners
draw_list->AddTriangleFilled({ x + sz * 0.5f, y }, { x + sz, y + sz }, { x, y + sz }, col);         x += step;  // Triangle
ImDrawList::AddCircle
IMGUI_API void AddCircle(const ImVec2& center, float radius, ImU32 col, int num_segments = 0, float thickness = 1.0f, ImDrawFlags flags = 0);

See it live: Examples › Custom rendering › Primitives (also used in 2 other sections)

Examples › Custom rendering › Primitives
Code from the demo
if (draw_strokes)
{
    // STROKES
    // First row uses a thickness of 1.0f, second row uses the configurable thickness
    const ImU32 col = ImColor(colf_stroke);
    float th = (row == 0) ? 1.0f : thickness;
    draw_list->AddNgon({ x + half_sz, y + half_sz }, half_sz, col, ngon_segments, th, flags);               x += step;  // N-gon
    draw_list->AddCircle({ x + half_sz, y + half_sz }, half_sz, col, circle_segments, th, flags);           x += step;  // Circle
    draw_list->AddEllipse({ x + half_sz, y + half_sz }, { half_sz, sz * 0.3f }, col, -0.3f, circle_segments, th, flags); x += step;  // Ellipse
    draw_list->AddRect({ x, y }, { x + sz, y + sz }, col, 0.0f, th, flags);                                 x += step;  // Square
    draw_list->AddRect({ x, y }, { x + sz, y + sz }, col, rounding, th, flags);                             x += step;  // Square with all rounded corners
    draw_list->AddRect({ x, y }, { x + sz, y + sz }, col, rounding, th, flags | corners_tl_br);             x += step;  // Square with two rounded corners
    draw_list->AddTriangle({ x + sz * 0.5f, y }, { x + sz, y + sz }, { x, y + sz }, col, th, flags);        x += step;  // Triangle
    draw_list->AddTriangle({ x + sz * 0.2f, y }, { x + sz * 0.4f, y + sz }, { x, y + sz }, col, th, flags); x += step - (float)(int)(sz * 0.6f); // Thin triangle
...
ImDrawList::AddCircleFilled
IMGUI_API void AddCircleFilled(const ImVec2& center, float radius, ImU32 col, int num_segments = 0);

See it live: Examples › Custom rendering › Primitives (also used in 1 other section)

Examples › Custom rendering › Primitives
Code from the demo
x = start_pos.x;
bool draw_fill = (row == 2 || row == 3);
bool draw_strokes = (row == 0 || row == 1 || row == 3);
if (draw_fill)
{
    // FILLED SHAPES
    const ImU32 col = ImColor(colf_fill);
    draw_list->AddNgonFilled({ x + half_sz, y + half_sz }, half_sz, col, ngon_segments);                x += step;  // N-gon
    draw_list->AddCircleFilled({ x + half_sz, y + half_sz }, half_sz, col, circle_segments);            x += step;  // Circle
    draw_list->AddEllipseFilled({ x + half_sz, y + half_sz }, { half_sz, sz * 0.3f }, col, -0.3f, circle_segments); x += step;// Ellipse
    draw_list->AddRectFilled({ x, y }, { x + sz, y + sz }, col, 0.0f, flags);                           x += step;  // Square
    draw_list->AddRectFilled({ x, y }, { x + sz, y + sz }, col, rounding, flags);                       x += step;  // Square with all rounded corners
    draw_list->AddRectFilled({ x, y }, { x + sz, y + sz }, col, rounding, flags | corners_tl_br);       x += step;  // Square with two rounded corners
    draw_list->AddTriangleFilled({ x + sz * 0.5f, y }, { x + sz, y + sz }, { x, y + sz }, col);         x += step;  // Triangle
...
ImDrawList::AddNgon
IMGUI_API void AddNgon(const ImVec2& center, float radius, ImU32 col, int num_segments, float thickness = 1.0f, ImDrawFlags flags = 0);

See it live: Examples › Custom rendering › Primitives

Examples › Custom rendering › Primitives
Code from the demo
if (draw_strokes)
{
    // STROKES
    // First row uses a thickness of 1.0f, second row uses the configurable thickness
    const ImU32 col = ImColor(colf_stroke);
    float th = (row == 0) ? 1.0f : thickness;
    draw_list->AddNgon({ x + half_sz, y + half_sz }, half_sz, col, ngon_segments, th, flags);               x += step;  // N-gon
    draw_list->AddCircle({ x + half_sz, y + half_sz }, half_sz, col, circle_segments, th, flags);           x += step;  // Circle
    draw_list->AddEllipse({ x + half_sz, y + half_sz }, { half_sz, sz * 0.3f }, col, -0.3f, circle_segments, th, flags); x += step;  // Ellipse
    draw_list->AddRect({ x, y }, { x + sz, y + sz }, col, 0.0f, th, flags);                                 x += step;  // Square
    draw_list->AddRect({ x, y }, { x + sz, y + sz }, col, rounding, th, flags);                             x += step;  // Square with all rounded corners
    draw_list->AddRect({ x, y }, { x + sz, y + sz }, col, rounding, th, flags | corners_tl_br);             x += step;  // Square with two rounded corners
    draw_list->AddTriangle({ x + sz * 0.5f, y }, { x + sz, y + sz }, { x, y + sz }, col, th, flags);        x += step;  // Triangle
    draw_list->AddTriangle({ x + sz * 0.2f, y }, { x + sz * 0.4f, y + sz }, { x, y + sz }, col, th, flags); x += step - (float)(int)(sz * 0.6f); // Thin triangle
...
ImDrawList::AddNgonFilled
IMGUI_API void AddNgonFilled(const ImVec2& center, float radius, ImU32 col, int num_segments);

See it live: Examples › Custom rendering › Primitives

Examples › Custom rendering › Primitives
Code from the demo
x = start_pos.x;
bool draw_fill = (row == 2 || row == 3);
bool draw_strokes = (row == 0 || row == 1 || row == 3);
if (draw_fill)
{
    // FILLED SHAPES
    const ImU32 col = ImColor(colf_fill);
    draw_list->AddNgonFilled({ x + half_sz, y + half_sz }, half_sz, col, ngon_segments);                x += step;  // N-gon
    draw_list->AddCircleFilled({ x + half_sz, y + half_sz }, half_sz, col, circle_segments);            x += step;  // Circle
    draw_list->AddEllipseFilled({ x + half_sz, y + half_sz }, { half_sz, sz * 0.3f }, col, -0.3f, circle_segments); x += step;// Ellipse
    draw_list->AddRectFilled({ x, y }, { x + sz, y + sz }, col, 0.0f, flags);                           x += step;  // Square
    draw_list->AddRectFilled({ x, y }, { x + sz, y + sz }, col, rounding, flags);                       x += step;  // Square with all rounded corners
    draw_list->AddRectFilled({ x, y }, { x + sz, y + sz }, col, rounding, flags | corners_tl_br);       x += step;  // Square with two rounded corners
    draw_list->AddTriangleFilled({ x + sz * 0.5f, y }, { x + sz, y + sz }, { x, y + sz }, col);         x += step;  // Triangle
...
ImDrawList::AddEllipse
IMGUI_API void AddEllipse(const ImVec2& center, const ImVec2& radius, ImU32 col, float rot = 0.0f, int num_segments = 0, float thickness = 1.0f, ImDrawFlags flags = 0);

See it live: Examples › Custom rendering › Primitives

Examples › Custom rendering › Primitives
Code from the demo
float th = (row == 0) ? 1.0f : thickness;
draw_list->AddNgon({ x + half_sz, y + half_sz }, half_sz, col, ngon_segments, th, flags);               x += step;  // N-gon
draw_list->AddCircle({ x + half_sz, y + half_sz }, half_sz, col, circle_segments, th, flags);           x += step;  // Circle
draw_list->AddEllipse({ x + half_sz, y + half_sz }, { half_sz, sz * 0.3f }, col, -0.3f, circle_segments, th, flags); x += step;  // Ellipse
ImDrawList::AddEllipseFilled
IMGUI_API void AddEllipseFilled(const ImVec2& center, const ImVec2& radius, ImU32 col, float rot = 0.0f, int num_segments = 0);

See it live: Examples › Custom rendering › Primitives

Examples › Custom rendering › Primitives
Code from the demo
x = start_pos.x;
bool draw_fill = (row == 2 || row == 3);
bool draw_strokes = (row == 0 || row == 1 || row == 3);
if (draw_fill)
{
    // FILLED SHAPES
    const ImU32 col = ImColor(colf_fill);
    draw_list->AddNgonFilled({ x + half_sz, y + half_sz }, half_sz, col, ngon_segments);                x += step;  // N-gon
    draw_list->AddCircleFilled({ x + half_sz, y + half_sz }, half_sz, col, circle_segments);            x += step;  // Circle
    draw_list->AddEllipseFilled({ x + half_sz, y + half_sz }, { half_sz, sz * 0.3f }, col, -0.3f, circle_segments); x += step;// Ellipse
    draw_list->AddRectFilled({ x, y }, { x + sz, y + sz }, col, 0.0f, flags);                           x += step;  // Square
    draw_list->AddRectFilled({ x, y }, { x + sz, y + sz }, col, rounding, flags);                       x += step;  // Square with all rounded corners
    draw_list->AddRectFilled({ x, y }, { x + sz, y + sz }, col, rounding, flags | corners_tl_br);       x += step;  // Square with two rounded corners
    draw_list->AddTriangleFilled({ x + sz * 0.5f, y }, { x + sz, y + sz }, { x, y + sz }, col);         x += step;  // Triangle
...
ImDrawList::AddText
IMGUI_API void AddText(const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL);
IMGUI_API void AddText(ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f, const ImVec4* cpu_fine_clip_rect = NULL);
ImDrawList::AddBezierCubic
IMGUI_API void AddBezierCubic(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0, ImDrawFlags flags = 0);

See it live: Examples › Custom rendering › Primitives

Examples › Custom rendering › Primitives
Code from the demo
if (!(draw_fill && draw_strokes)) //-V560
{
    draw_list->AddBezierCubic({ x + cp4[0].x, y + cp4[0].y }, { x + cp4[1].x, y + cp4[1].y }, { x + cp4[2].x, y + cp4[2].y }, { x + cp4[3].x, y + cp4[3].y }, col, th, curve_segments, flags);
    x += step;
}

Cubic Bezier (4 control points)

ImDrawList::AddBezierQuadratic
IMGUI_API void AddBezierQuadratic(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col, float thickness, int num_segments = 0, ImDrawFlags flags = 0);

See it live: Examples › Custom rendering › Primitives

Examples › Custom rendering › Primitives
Code from the demo
draw_list->AddBezierQuadratic({ x + cp3[0].x, y + cp3[0].y }, { x + cp3[1].x, y + cp3[1].y }, { x + cp3[2].x, y + cp3[2].y }, col, th, curve_segments, flags);

Quadratic Bezier (3 control points)

ImDrawList::AddImage
IMGUI_API void AddImage(ImTextureRef tex_ref, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min = ImVec2(0, 0), const ImVec2& uv_max = ImVec2(1, 1), ImU32 col = IM_COL32_WHITE);
ImDrawList::AddImageQuad
IMGUI_API void AddImageQuad(ImTextureRef tex_ref, const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& uv1 = ImVec2(0, 0), const ImVec2& uv2 = ImVec2(1, 0), const ImVec2& uv3 = ImVec2(1, 1), const ImVec2& uv4 = ImVec2(0, 1), ImU32 col = IM_COL32_WHITE);
ImDrawList::AddImageRounded
IMGUI_API void AddImageRounded(ImTextureRef tex_ref, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min, const ImVec2& uv_max, ImU32 col, float rounding, ImDrawFlags flags = 0);
ImDrawList::PathClear
inline void PathClear();

(private API)

Stateful path API, add points then finish with PathFillConvex() or PathStroke()

ImDrawList::PathLineTo
inline void PathLineTo(const ImVec2& pos);

See it live: Examples › Custom rendering › Primitives

Examples › Custom rendering › Primitives
Code from the demo
for (const ImVec2& p : concave_shape)
    draw_list->PathLineTo({ x + (int)(sz * p.x), y + (int)(sz * p.y) });

(private API)

ImDrawList::PathLineToMergeDuplicate
inline void PathLineToMergeDuplicate(const ImVec2& pos);

(private API)

ImDrawList::PathFillConvex
inline void PathFillConvex(ImU32 col, ImDrawFlags flags = 0);

See it live: Examples › Custom rendering › Primitives

Examples › Custom rendering › Primitives
Code from the demo
draw_list->PathFillConvex(col, flags);

(private API)

ImDrawList::PathFillConcave
inline void PathFillConcave(ImU32 col);

See it live: Examples › Custom rendering › Primitives

Examples › Custom rendering › Primitives
Code from the demo
draw_list->PathFillConcave(col);

(private API)

ImDrawList::PathStroke
inline void PathStroke(ImU32 col, float thickness = 1.0f, ImDrawFlags flags = 0);

See it live: Examples › Custom rendering › Primitives

Examples › Custom rendering › Primitives
Code from the demo
draw_list->PathStroke(col, th, flags | ImDrawFlags_Closed);

(private API)

ImDrawList::PathArcTo
IMGUI_API void PathArcTo(const ImVec2& center, float radius, float a_min, float a_max, int num_segments = 0);

See it live: Examples › Custom rendering › Primitives

Examples › Custom rendering › Primitives
Code from the demo
draw_list->PathArcTo({ x + half_sz, y + half_sz }, half_sz, pi * -0.5f, pi * 1.1f);
ImDrawList::PathArcToFast
IMGUI_API void PathArcToFast(const ImVec2& center, float radius, int a_min_of_12, int a_max_of_12);

Use precomputed angles for a 12 steps circle

ImDrawList::PathEllipticalArcTo
IMGUI_API void PathEllipticalArcTo(const ImVec2& center, const ImVec2& radius, float rot, float a_min, float a_max, int num_segments = 0);

Ellipse

ImDrawList::PathBezierCubicCurveTo
IMGUI_API void PathBezierCubicCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments = 0);

Cubic Bezier (4 control points)

ImDrawList::PathBezierQuadraticCurveTo
IMGUI_API void PathBezierQuadraticCurveTo(const ImVec2& p2, const ImVec2& p3, int num_segments = 0);

See it live: Examples › Custom rendering › Primitives

Examples › Custom rendering › Primitives
Code from the demo
draw_list->PathLineTo({ x + cp3[0].x, y + cp3[0].y });
draw_list->PathBezierQuadraticCurveTo({ x + cp3[1].x, y + cp3[1].y }, { x + cp3[2].x, y + cp3[2].y }, curve_segments);

Quadratic Bezier (3 control points)

ImDrawList::PathRect
IMGUI_API void PathRect(const ImVec2& rect_min, const ImVec2& rect_max, float rounding = 0.0f, ImDrawFlags flags = 0);
ImDrawList::AddDrawCmd
IMGUI_API void AddDrawCmd();

This is useful if you need to forcefully create a new draw call (to allow for dependent rendering / blending). Otherwise primitives are merged into the same draw-call as much as possible

ImDrawList::CloneOutput
IMGUI_API ImDrawList* CloneOutput() const;

Create a clone of the CmdBuffer/IdxBuffer/VtxBuffer. For multi-threaded rendering, consider using imgui_threaded_rendering from https://github.com/ocornut/imgui_club instead.

ImDrawList::ChannelsSplit
inline void ChannelsSplit(int count);

See it live: Examples › Custom rendering › Draw Channels

Code from the demo
draw_list->ChannelsSplit(2);

(private API)

ImDrawList::ChannelsMerge
inline void ChannelsMerge();

See it live: Examples › Custom rendering › Draw Channels

Code from the demo
draw_list->ChannelsMerge();

(private API)

ImDrawList::ChannelsSetCurrent
inline void ChannelsSetCurrent(int n);

See it live: Examples › Custom rendering › Draw Channels

Code from the demo
draw_list->ChannelsSplit(2);
draw_list->ChannelsSetCurrent(1);

(private API)

ImDrawList::PrimReserve
IMGUI_API void PrimReserve(int idx_count, int vtx_count);
ImDrawList::PrimUnreserve
IMGUI_API void PrimUnreserve(int idx_count, int vtx_count);
ImDrawList::PrimRect
IMGUI_API void PrimRect(const ImVec2& a, const ImVec2& b, ImU32 col);

Axis aligned rectangle (composed of two triangles)

ImDrawList::PrimRectUV
IMGUI_API void PrimRectUV(const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, ImU32 col);
ImDrawList::PrimQuadUV
IMGUI_API void PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, const ImVec2& uv_a, const ImVec2& uv_b, const ImVec2& uv_c, const ImVec2& uv_d, ImU32 col);
ImDrawList::PrimWriteVtx
inline void PrimWriteVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col);

(private API)

ImDrawList::PrimWriteIdx
inline void PrimWriteIdx(ImDrawIdx idx);

(private API)

ImDrawList::PrimVtx
inline void PrimVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col);

(private API)

Write vertex with unique index

ImDrawData (struct)

struct ImDrawData

All draw data to render a Dear ImGui frame (NB: the style and the naming convention here is a little inconsistent, we currently preserve them for backward compatibility purpose, as this is one of the oldest structure exposed by the library! Basically, ImDrawList == CmdList)

Member
bool Valid;Only valid after Render() is called and before the next NewFrame() is called.
int FrameCount;Frame counter of the emitter context. Mostly for debugging purpose.
int TotalIdxCount;For convenience, sum of all ImDrawList’s IdxBuffer.Size
int TotalVtxCount;For convenience, sum of all ImDrawList’s VtxBuffer.Size
ImVector<ImDrawList*> CmdLists;Array of ImDrawList* to render. The ImDrawLists are owned by ImGuiContext and only pointed to from here.
ImVec2 DisplayPos;Top-left position of the viewport to render (== top-left of the orthogonal projection matrix to use) (== GetMainViewport()->Pos for the main viewport, == (0.0) in most single-viewport applications)
ImVec2 DisplaySize;Size of the viewport to render (== GetMainViewport()->Size for the main viewport, == io.DisplaySize in most single-viewport applications)
ImVec2 FramebufferScale;Amount of pixels for each unit of DisplaySize. Copied from viewport->FramebufferScale (== io.DisplayFramebufferScale for main viewport). Generally (1,1) on normal display, (2,2) on OSX with Retina display.
ImGuiViewport* OwnerViewport;Viewport carrying the ImDrawData instance, might be of use to the renderer (generally not).
ImVector<ImTextureData*>* Textures;List of textures to update. Most of the times the list is shared by all ImDrawData, has only 1 texture and it doesn’t need any update. This almost always points to ImGui::GetPlatformIO().Textures[]. May be overridden or set to None if you want to manually update textures.
ImDrawData::ImDrawData
ImDrawData();

Functions

ImDrawData::Clear
IMGUI_API void Clear();
ImDrawData::AddDrawList
IMGUI_API void AddDrawList(ImDrawList* draw_list);

Helper to add an external draw list into an existing ImDrawData.

ImDrawData::DeIndexAllBuffers
IMGUI_API void DeIndexAllBuffers();

Helper to convert all buffers from indexed to non-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering!

ImDrawData::ScaleClipRects
IMGUI_API void ScaleClipRects(const ImVec2& fb_scale);

Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than Dear ImGui expects, or if there is a difference between your window resolution and framebuffer resolution.

Texture API

ImTextureFormat (enum)

enum ImTextureFormat

We intentionally support a limited amount of texture formats to limit burden on CPU-side code and extension.
Most standard backends only support RGBA32 but we provide a single channel option for low-resource/embedded systems.

MemberValue
ImTextureFormat_RGBA3204 components per pixel, each is unsigned 8-bit. Total size = TexWidth * TexHeight * 4
ImTextureFormat_Alpha811 component per pixel, each is unsigned 8-bit. Total size = TexWidth * TexHeight

ImTextureStatus (enum)

enum ImTextureStatus

Status of a texture to communicate with Renderer Backend.

MemberValue
ImTextureStatus_OK0
ImTextureStatus_Destroyed1Backend destroyed the texture.
ImTextureStatus_WantCreate2Requesting backend to create the texture. Set status OK when done.
ImTextureStatus_WantUpdates3Requesting backend to update specific blocks of pixels (write to texture portions which have never been used before). Set status OK when done.
ImTextureStatus_WantDestroy4Requesting backend to destroy the texture. Set status to Destroyed when done.

ImTextureRect (struct)

struct ImTextureRect

Coordinates of a rectangle within a texture.
When a texture is in ImTextureStatus_WantUpdates state, we provide a list of individual rectangles to copy to the graphics system.
You may use ImTextureData::Updates[] for the list, or ImTextureData::UpdateBox for a single bounding box.

Member
unsigned short x,Upper-left coordinates of rectangle to update, within the parent Pixels[] array.
y;Upper-left coordinates of rectangle to update, within the parent Pixels[] array.
unsigned short w,Size of rectangle to update (in pixels)
h;Size of rectangle to update (in pixels)

ImTextureData (struct)

struct ImTextureData

Specs and pixel storage for a texture used by Dear ImGui.
This is only useful for (1) core library and (2) backends. End-user/applications do not need to care about this.
Renderer Backends will create a GPU-side version of this.
Why does we store two identifiers: TexID and BackendUserData?

- ImTextureID    TexID           = lower-level identifier stored in ImDrawCmd. ImDrawCmd can refer to textures not created by the backend, and for which there's no ImTextureData.
- None*          BackendUserData = higher-level opaque storage for backend own book-keeping. Some backends may have enough with TexID and not need both.

In columns below: who reads/writes each fields? ‘r’=read, ‘w’=write, ‘core’=main library, ‘backend’=renderer backend

Member
int UniqueID;w - // [DEBUG] Sequential index to facilitate identifying a texture when debugging/printing. Unique per atlas.
ImTextureStatus Status;rw rw // ImTextureStatus_OK/_WantCreate/_WantUpdates/_WantDestroy. Always use SetStatus() to modify!
void* BackendUserData;- rw // Convenience storage for backend. Some backends may have enough with TexID.
void* QueueUserData;r - // Convenience storage for a staged/multi-threaded rendering texture queue (e.g. imgui_threaded_rendering.h. See #8597). When != None, core assumes the texture is referenced by the queue.
ImTextureID TexID;r w // Backend-specific texture identifier. Always use SetTexID() to modify! The identifier will stored in ImDrawCmd::GetTexID() and passed to backend’s RenderDrawData function.
ImTextureFormat Format;w r // ImTextureFormat_RGBA32 (default) or ImTextureFormat_Alpha8
int Width;w r // Texture width
int Height;w r // Texture height
int BytesPerPixel;w r // 4 or 1
uchar* Pixels;w r // Pointer to whole texture buffer holding ‘WidthHeight’ pixels and 'WidthHeight*BytesPerPixels’ bytes.
ImTextureRect UsedRect;w r // Bounding box encompassing all past and queued Updates[].
ImTextureRect UpdateRect;w r // Bounding box encompassing all queued Updates[].
ImVector<ImTextureRect> Updates;w r // Array of individual updates.
int UnusedFrames;w r // In order to facilitate handling Status==WantDestroy in some backend: this is a count successive frames where the texture was not used. Always >0 when Status==WantDestroy.
unsigned short RefCount;w r // Number of contexts using this texture. Used during backend shutdown.
bool UseColors;w r // Tell whether our texture data is known to use colors (rather than just white + alpha).
bool WantDestroyNextFrame;rw - // [Internal] Queued to set ImTextureStatus_WantDestroy next frame. May still be used in the current frame.
ImTextureData::ImTextureData
ImTextureData();

Functions

ImTextureData::Create
IMGUI_API void Create(ImTextureFormat format, int w, int h);
ImTextureData::DestroyPixels
IMGUI_API void DestroyPixels();
ImTextureData::GetSizeInBytes
int GetSizeInBytes() const;

(private API)

ImTextureData::GetPitch
int GetPitch() const;

(private API)

ImTextureData::GetTexRef
ImTextureRef GetTexRef();

(private API)

ImTextureData::GetTexID
ImTextureID GetTexID() const;

(private API)

ImTextureData::SetTexID
void SetTexID(ImTextureID tex_id);

(private API)

ImTextureData::SetStatus
void SetStatus(ImTextureStatus status);

(private API)

Font API

ImFontConfig (struct)

struct ImFontConfig

A font input/source (we may rename this to ImFontSource in the future)

Member
void* FontData;// TTF/OTF data
int FontDataSize;// TTF/OTF data size
bool FontDataOwnedByAtlas;True // TTF/OTF data ownership taken by the owner ImFontAtlas (will delete memory itself). SINCE 1.92, THE DATA NEEDS TO PERSIST FOR WHOLE DURATION OF ATLAS.
bool MergeMode;False // Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs). You may want to use GlyphOffset.y when merge font of different heights.
bool PixelSnapH;False // Align every glyph AdvanceX to pixel boundaries. Prevents fractional font size from working correctly! Useful e.g. if you are merging a non-pixel aligned font with the default font. If enabled, OversampleH/V will default to 1.
ImS8 OversampleH;0 (2) // Rasterize at higher quality for sub-pixel positioning. 0 == auto == 1 or 2 depending on size. Note the difference between 2 and 3 is minimal. You can reduce this to 1 for large glyphs save memory. Read tests/oversample/README.md for details.
ImS8 OversampleV;0 (1) // Rasterize at higher quality for sub-pixel positioning. 0 == auto == 1. This is not really useful as we don’t use sub-pixel positions on the Y axis.
ImWchar EllipsisChar;0 // Explicitly specify Unicode codepoint of ellipsis character. When fonts are being merged first specified ellipsis will be used.
float SizePixels;// Output size in pixels for rasterizer (more or less maps to the resulting font height).
ImVec2 GlyphOffset;0, 0 // Offset (in pixels) all glyphs from this font input. Absolute value for default size, other sizes will scale this value.
float GlyphMinAdvanceX;0 // Minimum AdvanceX for glyphs, set Min to align font icons, set both Min/Max to enforce mono-space font. Absolute value for default size, other sizes will scale this value.
float GlyphMaxAdvanceX;FLT_MAX // Maximum AdvanceX for glyphs
float GlyphExtraAdvanceX;0 // Extra spacing (in pixels) between glyphs. Please contact us if you are using this. // FIXME-NEWATLAS: Intentionally unscaled
ImU32 FontNo;0 // Index of font within TTF/OTF file
unsigned int FontLoaderFlags;0 // Settings for custom font builder. THIS IS BUILDER IMPLEMENTATION DEPENDENT. Leave as zero if unsure.
float RasterizerMultiply;1.0 // Linearly brighten (>1.0) or darken (<1.0) font output. Brightening small fonts may be a good workaround to make them more readable. This is a silly thing we may remove in the future.
float RasterizerDensity;1.0 // [LEGACY: this only makes sense when ImGuiBackendFlags_RendererHasTextures is not supported] DPI scale multiplier for rasterization. Not altering other font metrics: makes it easy to swap between e.g. a 100% and a 400% fonts for a zooming display, or handle Retina screen. IMPORTANT: If you change this it is expected that you increase/decrease font scale roughly to the inverse of this, otherwise quality may look lowered.
float ExtraSizeScale;1.0 // Extra rasterizer scale over SizePixels.
ImFontFlags Flags;Font flags (don’t use just yet, will be exposed in upcoming 1.92.X updates)
ImFont* DstFont;Target font (as we merging fonts, multiple ImFontConfig may target the same font)
void* FontLoaderData;Font loader opaque storage (per font config)
ImFontConfig::ImFontConfig
IMGUI_API ImFontConfig();

ImFontGlyph (struct)

struct ImFontGlyph

Hold rendering data for one glyph. (Note: some language parsers may fail to convert the bitfield members, in this case maybe drop store a single u32 or we can rework this)

Member
float AdvanceX;Horizontal distance to advance cursor/layout position.
float X0,Glyph corners. Offsets from current cursor/layout position.
Y0,Glyph corners. Offsets from current cursor/layout position.
X1,Glyph corners. Offsets from current cursor/layout position.
Y1;Glyph corners. Offsets from current cursor/layout position.
float U0,Texture coordinates for the current value of ImFontAtlas->TexRef. Cached equivalent of calling GetCustomRect() with PackId.
V0,Texture coordinates for the current value of ImFontAtlas->TexRef. Cached equivalent of calling GetCustomRect() with PackId.
U1,Texture coordinates for the current value of ImFontAtlas->TexRef. Cached equivalent of calling GetCustomRect() with PackId.
V1;Texture coordinates for the current value of ImFontAtlas->TexRef. Cached equivalent of calling GetCustomRect() with PackId.
int PackId;[Internal] ImFontAtlasRectId value (FIXME: Cold data, could be moved elsewhere?)
ImFontGlyph::ImFontGlyph
ImFontGlyph();

ImFontGlyphRangesBuilder (struct)

struct ImFontGlyphRangesBuilder

Helper to build glyph ranges from text/string data. Feed your application strings/characters to it then call BuildRanges().
This is essentially a tightly packed of vector of 64k booleans = 8KB storage.

Member
ImVector<ImU32> UsedChars;Store 1-bit per Unicode code point (0=unused, 1=used)
ImFontGlyphRangesBuilder::ImFontGlyphRangesBuilder
ImFontGlyphRangesBuilder();
ImFontGlyphRangesBuilder::Clear
inline void Clear();

(private API)

ImFontGlyphRangesBuilder::GetBit
inline bool GetBit(size_t n) const;

(private API)

Get bit n in the array

ImFontGlyphRangesBuilder::SetBit
inline void SetBit(size_t n);

(private API)

Set bit n in the array

ImFontGlyphRangesBuilder::AddChar
inline void AddChar(ImWchar c);

(private API)

Add character

ImFontGlyphRangesBuilder::AddText
IMGUI_API void AddText(const char* text, const char* text_end = NULL);

Add string (each character of the UTF-8 string are added)

ImFontGlyphRangesBuilder::BuildRanges
IMGUI_API void BuildRanges(ImVector<ImWchar>* out_ranges);

Output new ranges

ImFontAtlasRect (struct)

struct ImFontAtlasRect

Output of ImFontAtlas::GetCustomRect() when using custom rectangles.
Those values may not be cached/stored as they are only valid for the current value of atlas->TexRef (this is in theory derived from ImTextureRect but we use separate structures for reasons)

Member
unsigned short x,Position (in current texture)
y;Position (in current texture)
unsigned short w,Size
h;Size
ImVec2 uv0,UV coordinates (in current texture)
uv1;UV coordinates (in current texture)
ImFontAtlasRect::ImFontAtlasRect
ImFontAtlasRect();

ImFontAtlasFlags_ (enum)

enum ImFontAtlasFlags_

The type of its values in the API: typedef int ImFontAtlasFlags;

Flags for ImFontAtlas build

MemberValue
ImFontAtlasFlags_None = 00
ImFontAtlasFlags_NoPowerOfTwoHeight = 1 << 01 << 0Don’t round the height to next power of two
ImFontAtlasFlags_NoMouseCursors = 1 << 11 << 1Don’t build software mouse cursors into the atlas (save a little texture memory)
ImFontAtlasFlags_NoBakedLines = 1 << 21 << 2Don’t build anti-aliased line textures into the atlas (save a little texture memory). SINCE 1.93.0 THIS PREVENTS ANTI-ALIASED LINES FROM WORKING AND WILL DISABLE THEM.
ImFontAtlasFlags_NoBakedRoundCorners= 1 << 31 << 3Don’t build round corners into the atlas.

ImFontAtlas (struct)

struct ImFontAtlas

Load and rasterize multiple TTF/OTF fonts into a same texture. The font atlas will build a single texture holding:

Member
ImFontAtlasFlags Flags;Build flags (see ImFontAtlasFlags_)
ImTextureFormat TexDesiredFormat;Desired texture format (default to ImTextureFormat_RGBA32 but may be changed to ImTextureFormat_Alpha8).
int TexGlyphPadding;FIXME: Should be called “TexPackPadding”. Padding between glyphs within texture in pixels. Defaults to 1. If your rendering method never relies on bilinear filtering you may set this to 0.
int TexMinWidth;Minimum desired texture width. Must be a power of two. Default to 512.
int TexMinHeight;Minimum desired texture height. Must be a power of two. Default to 128.
int TexMaxWidth;Maximum desired texture width. Must be a power of two. Default to 8192.
int TexMaxHeight;Maximum desired texture height. Must be a power of two. Default to 8192.
void* UserData;Store your own atlas related user-data (if e.g. you have multiple font atlas).
ImTextureData* TexData;Latest texture.
ImVector<ImTextureData*> TexList;Texture list (most often TexList.Size == 1). TexData is always == TexList.back(). DO NOT USE DIRECTLY, USE GetDrawData().Textures[]/GetPlatformIO().Textures[] instead!
bool Locked;Marked as locked during ImGui::NewFrame()..EndFrame() scope if TexUpdates are not supported. Any attempt to modify the atlas will assert.
bool RendererHasTextures;Copy of (BackendFlags & ImGuiBackendFlags_RendererHasTextures) from supporting context.
bool TexIsBuilt;Set when texture was built matching current font input. Mostly useful for legacy IsBuilt() call.
bool TexPixelsUseColors;Tell whether our texture data is known to use colors (rather than just alpha channel), in order to help backend select a format or conversion process.
ImVec2 TexUvScale;= (1.0/TexData->TexWidth, 1.0/TexData->TexHeight). May change as new texture gets created.
ImVec2 TexUvWhitePixel;Texture coordinates to a white pixel. May change as new texture gets created.
ImVector<ImFont*> Fonts;Hold all the fonts returned by AddFont*. Fonts[0] is the default font upon calling ImGui::NewFrame(), use ImGui::PushFont()/PopFont() to change the current font.
ImVector<ImFontConfig> Sources;Source/configuration data
int TexNextUniqueID;Next value to be stored in TexData->UniqueID
int FontNextUniqueID;Next value to be stored in ImFont->FontID
const char* FontLoaderName;Font loader name (for display e.g. in About box) == FontLoader->Name # (const)
void* FontLoaderData;Font backend opaque storage
unsigned int FontLoaderFlags;Shared flags (for all fonts) for font loader. THIS IS BUILD IMPLEMENTATION DEPENDENT (e.g. Per-font override is also available in ImFontConfig).
int RefCount;Number of contexts using this atlas
ImGuiContext* OwnerContext;Context which own the atlas will be in charge of updating and destroying it.
ImFontAtlas::ImFontAtlas
IMGUI_API ImFontAtlas();
ImFontAtlas::AddFont
IMGUI_API ImFont* AddFont(const ImFontConfig* font_cfg);
ImFontAtlas::AddFontDefault
IMGUI_API ImFont* AddFontDefault(const ImFontConfig* font_cfg = NULL);

Selects between AddFontDefaultVector() and AddFontDefaultBitmap().

ImFontAtlas::AddFontDefaultVector
IMGUI_API ImFont* AddFontDefaultVector(const ImFontConfig* font_cfg = NULL);

Embedded scalable font. Recommended at any higher size.

ImFontAtlas::AddFontDefaultBitmap
IMGUI_API ImFont* AddFontDefaultBitmap(const ImFontConfig* font_cfg = NULL);

Embedded classic pixel-clean font. Recommended at Size 13px with no scaling.

ImFontAtlas::RemoveFont
IMGUI_API void RemoveFont(ImFont* font);

Remove a font

ImFontAtlas::CompactCache
IMGUI_API void CompactCache();

Compact cached glyphs and texture.

ImFontAtlas::SetFontLoader
IMGUI_API void SetFontLoader(const ImFontLoader* font_loader);

Change font loader at runtime.

ImFontAtlas::Clear
IMGUI_API void Clear();

Clear everything (fonts + textures). Don’t call mid-frame!

Clearing the atlas/fonts has little use nowadays, unless you want to batch remove all fonts.

ImFontAtlas::ClearFonts
IMGUI_API void ClearFonts();

Clear input+output font data/glyphs. New fonts and textures will be recreated afterwards.

ImFontAtlas::ClearInputData
IMGUI_API void ClearInputData();

[OBSOLETE] Clear input data (all ImFontConfig structures including sizes, TTF data, glyph ranges, etc.) = all the data used to build the texture and fonts.

ImFontAtlas::ClearTexData
IMGUI_API void ClearTexData();

[OBSOLETE] Clear CPU-side copy of the texture data. Saves RAM once the texture has been copied to graphics memory.

ImFontAtlas::AddCustomRect
IMGUI_API ImFontAtlasRectId AddCustomRect(int width, int height, ImFontAtlasRect* out_r = NULL);

Register a rectangle. Return -1 (ImFontAtlasRectId_Invalid) on error.

Since 1.92: specifying glyph ranges is only useful/necessary if your backend doesn’t support ImGuiBackendFlags_RendererHasTextures!

[ALPHA] Custom Rectangles/Glyphs API

Register and retrieve custom rectangles

  - GetCustomRectByIndex()   --> Use GetCustomRect()
  - CalcCustomRectUV()       --> Use GetCustomRect() and read uv0, uv1 fields.
  - AddCustomRectRegular()   --> Renamed to AddCustomRect()
  - ImFontAtlasCustomRect    --> Renamed to ImFontAtlasRect
ImFontAtlas::RemoveCustomRect
IMGUI_API void RemoveCustomRect(ImFontAtlasRectId id);

Unregister a rectangle. Existing pixels will stay in texture until resized / garbage collected.

ImFontAtlas::GetCustomRect
IMGUI_API bool GetCustomRect(ImFontAtlasRectId id, ImFontAtlasRect* out_r) const;

Get rectangle coordinates for current texture. Valid immediately, never store this (read above)!

ImFontBaked (struct)

struct ImFontBaked

Font runtime data for a given size
Important: pointers to ImFontBaked are only valid for the current frame.

Member
ImVector<float> IndexAdvanceX;12-16 // out // Sparse. Glyphs->AdvanceX in a directly indexable way (cache-friendly for CalcTextSize functions which only this info, and are often bottleneck in large UI).
float FallbackAdvanceX;4 // out // FindGlyph(FallbackChar)->AdvanceX
float Size;4 // in // Height of characters/line, set during loading (doesn’t change after loading)
float RasterizerDensity;4 // in // Density this is baked at
ImVector<ImU16> IndexLookup;12-16 // out // Sparse. Index glyphs by Unicode code-point.
ImVector<ImFontGlyph> Glyphs;12-16 // out // All glyphs.
int FallbackGlyphIndex;4 // out // Index of FontFallbackChar
float Ascent,4+4 // out // Ascent: distance from top to bottom of e.g. ‘A’ [0..FontSize] (unscaled)
Descent;4+4 // out // Ascent: distance from top to bottom of e.g. ‘A’ [0..FontSize] (unscaled)
int LastUsedFrame;4 // // Record of that time this was bounds
ImGuiID BakedId;4 // // Unique ID for this baked storage
ImFont* OwnerFont;4-8 // in // Parent font
void* FontLoaderDatas;4-8 // // Font loader opaque storage (per baked font * sources): single contiguous buffer allocated by imgui, passed to loader.
ImFontBaked::ImFontBaked
IMGUI_API ImFontBaked();
ImFontBaked::ClearOutputData
IMGUI_API void ClearOutputData();
ImFontBaked::FindGlyph
IMGUI_API ImFontGlyph* FindGlyph(ImWchar c);

Return U+FFFD glyph if requested glyph doesn’t exists.

ImFontBaked::FindGlyphNoFallback
IMGUI_API ImFontGlyph* FindGlyphNoFallback(ImWchar c);

Return None if glyph doesn’t exist

ImFontBaked::GetCharAdvance
IMGUI_API float GetCharAdvance(ImWchar c);
ImFontBaked::IsGlyphLoaded
IMGUI_API bool IsGlyphLoaded(ImWchar c);

ImFontFlags_ (enum)

enum ImFontFlags_

The type of its values in the API: typedef int ImFontFlags;

Font flags (in future versions as we redesign font loading API, this will become more important and better documented. for now please consider this as internal/advanced use)

MemberValue
ImFontFlags_None = 00
ImFontFlags_NoLoadError = 1 << 11 << 1Disable throwing an error/assert when calling AddFontXXX() with missing file/data. Calling code is expected to check AddFontXXX() return value.
ImFontFlags_NoLoadGlyphs = 1 << 21 << 2[Internal] Disable loading new glyphs.
ImFontFlags_LockBakedSizes = 1 << 31 << 3[Internal] Disable loading new baked sizes, disable garbage collecting current ones. e.g. if you want to lock a font to a single size. Important: if you use this to preload given sizes, consider the possibility of multiple font density used on Retina display.
ImFontFlags_ImplicitRefSize = 1 << 41 << 4[Internal] Reference size was not set explicitly.

ImFont (struct)

struct ImFont

Font runtime data and rendering

Member
ImFontBaked* LastBaked;4-8 // Cache last bound baked. NEVER USE DIRECTLY. Use GetFontBaked().
ImFontAtlas* OwnerAtlas;4-8 // What we have been loaded into.
ImFontFlags Flags;4 // Font flags.
float CurrentRasterizerDensity;Current rasterizer density. This is a varying state of the font.
ImGuiID FontId;Unique identifier for the font
float LegacySize;4 // in // Font size passed to AddFont(). Use for old code calling PushFont() expecting to use that size. (use ImGui::GetFontBaked() to get font baked at current bound size).
ImVector<ImFontConfig*> Sources;16 // in // List of sources. Pointers within OwnerAtlas->Sources[]
ImWchar EllipsisChar;2-4 // out // Character used for ellipsis rendering (‘...’). If you ever want to temporarily swap this for an alternative/dummy char, make sure to clear EllipsisAutoBake.
ImWchar FallbackChar;2-4 // out // Character used if a glyph isn’t found (U+FFFD, ‘?’)
bool EllipsisAutoBake;1 // // Mark when the “...” glyph (== EllipsisChar) needs to be generated by combining multiple ‘.’.
ImGuiStorage RemapPairs;16 // // Remapping pairs when using AddRemapCodepointXXX().
ImFont::ImFont
IMGUI_API ImFont();

Methods

ImFont::IsGlyphInFont
IMGUI_API bool IsGlyphInFont(ImWchar c);
ImFont::IsLoaded
bool IsLoaded() const;

(private API)

ImFont::GetDebugName
const char* GetDebugName() const;

(private API)

Fill ImFontConfig::Name.

ImFont::GetFontBaked
IMGUI_API ImFontBaked* GetFontBaked(float font_size, float density = -1.0f);

Get or create baked data for given size

ImFont::RenderChar
IMGUI_API void RenderChar(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, ImWchar c, const ImVec4* cpu_fine_clip = NULL);
ImFont::RenderText
IMGUI_API void RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width = 0.0f, ImDrawTextFlags flags = 0);
ImFont::ClearOutputData
IMGUI_API void ClearOutputData();
ImFont::AddRemapCodepoint
IMGUI_API void AddRemapCodepoint(ImWchar from_codepoint, ImWchar to_codepoint);

Makes ‘from_codepoint’ character points to ‘to_codepoint’ glyph.

ImFont::AddRemapCodepointToGlyphIndex
IMGUI_API void AddRemapCodepointToGlyphIndex(ImWchar from_codepoint, int font_src_idx, int glyph_idx);
ImFont::IsGlyphRangeUnused
IMGUI_API bool IsGlyphRangeUnused(unsigned int c_begin, unsigned int c_last);

Viewports

ImGuiViewportFlags_ (enum)

enum ImGuiViewportFlags_

The type of its values in the API: typedef int ImGuiViewportFlags;

Flags stored in ImGuiViewport::Flags, giving indications to the platform backends.

MemberValue
ImGuiViewportFlags_None = 00
ImGuiViewportFlags_IsPlatformWindow = 1 << 01 << 0Represent a Platform Window
ImGuiViewportFlags_IsPlatformMonitor = 1 << 11 << 1Represent a Platform Monitor (unused yet)
ImGuiViewportFlags_OwnedByApp = 1 << 21 << 2Platform Window: Is created/managed by the user application? (rather than our backend)
ImGuiViewportFlags_NoDecoration = 1 << 31 << 3Platform Window: Disable platform decorations: title bar, borders, etc. (generally set all windows, but if ImGuiConfigFlags_ViewportsDecoration is set we only set this on popups/tooltips)
ImGuiViewportFlags_NoTaskBarIcon = 1 << 41 << 4Platform Window: Disable platform task bar icon (generally set on popups/tooltips, or all windows if ImGuiConfigFlags_ViewportsNoTaskBarIcon is set)
ImGuiViewportFlags_NoFocusOnAppearing = 1 << 51 << 5Platform Window: Don’t take focus when created.
ImGuiViewportFlags_NoFocusOnClick = 1 << 61 << 6Platform Window: Don’t take focus when clicked on.
ImGuiViewportFlags_NoInputs = 1 << 71 << 7Platform Window: Make mouse pass through so we can drag this window while peaking behind it.
ImGuiViewportFlags_NoRendererClear = 1 << 81 << 8Platform Window: Renderer doesn’t need to clear the framebuffer ahead (because we will fill it entirely).
ImGuiViewportFlags_NoAutoMerge = 1 << 91 << 9Platform Window: Avoid merging this window into another host window. This can only be set via ImGuiWindowClass viewport flags override (because we need to now ahead if we are going to create a viewport in the first place!).
ImGuiViewportFlags_TopMost = 1 << 101 << 10Platform Window: Display on top (for tooltips only).
ImGuiViewportFlags_CanHostOtherWindows = 1 << 111 << 11Viewport can host multiple imgui windows (secondary viewports are associated to a single window). // FIXME: In practice there’s still probably code making the assumption that this is always and only on the MainViewport. Will fix once we add support for “no main viewport”.
ImGuiViewportFlags_IsMinimized = 1 << 121 << 12Platform Window: Window is minimized, can skip render. When minimized we tend to avoid using the viewport pos/size for clipping window or testing if they are contained in the viewport.
ImGuiViewportFlags_IsFocused = 1 << 131 << 13Platform Window: Window is focused (last call to Platform_GetWindowFocus() returned True)

ImGuiViewport (struct)

struct ImGuiViewport
Member
ImGuiID ID;Unique identifier for the viewport
ImGuiViewportFlags Flags;See ImGuiViewportFlags_
ImVec2 Pos;Main Area: Position of the viewport (Dear ImGui coordinates are the same as OS desktop/native coordinates)
ImVec2 Size;Main Area: Size of the viewport.
ImVec2 FramebufferScale;Density of the viewport for Retina display (always 1,1 on Windows, may be 2,2 etc on macOS/iOS). This will affect font rasterizer density.
ImVec2 WorkPos;Work Area: Position of the viewport minus task bars, menus bars, status bars (>= Pos)
ImVec2 WorkSize;Work Area: Size of the viewport minus task bars, menu bars, status bars (<= Size)
float DpiScale;1.0 = 96 DPI = No extra scale.
ImGuiID ParentViewportId;(Advanced) 0: no parent. Instruct the platform backend to setup a parent/child relationship between platform windows.
ImGuiViewport* ParentViewport;(Advanced) Direct shortcut to ImGui::FindViewportByID(ParentViewportId). None: no parent.
ImDrawData* DrawData;The ImDrawData corresponding to this viewport. Valid after Render() and until the next call to NewFrame().
void* RendererUserData;None* to hold custom data structure for the renderer (e.g. swap chain, framebuffers etc.). generally set by your Renderer_CreateWindow function.
void* PlatformUserData;None* to hold custom data structure for the OS / platform (e.g. windowing info, render context). generally set by your Platform_CreateWindow function.
void* PlatformIconData;None* to hold custom data structure for the OS / platform to specify an icon. Currently unused for exposed to allow experiments.
void* PlatformHandle;None* to hold higher-level, platform window handle (e.g. HWND for Win32 backend, Uint32 WindowID for SDL, GLFWWindow* for GLFW), for FindViewportByPlatformHandle().
void* PlatformHandleRaw;None* to hold lower-level, platform-native window handle (always HWND on Win32 platform, unused for other platforms).
bool PlatformWindowCreated;Platform window has been created (Platform_CreateWindow() has been called). This is False during the first frame where a viewport is being created.
bool PlatformRequestMove;Platform window requested move (e.g. window was moved by the OS / host window manager, authoritative position will be OS window position)
bool PlatformRequestResize;Platform window requested resize (e.g. window was resized by the OS / host window manager, authoritative size will be OS window size)
bool PlatformRequestClose;Platform window requested closure (e.g. window was moved by the OS / host window manager, e.g. pressing ALT-F4)
ImGuiViewport::ImGuiViewport
ImGuiViewport();
ImGuiViewport::GetCenter
ImVec2 GetCenter() const;

(private API)

ImGuiViewport::GetWorkCenter
ImVec2 GetWorkCenter() const;

(private API)

ImGuiViewport::GetDebugName
IMGUI_API const char* GetDebugName() const;

ImGuiPlatformIO + other Platform Dependent Interfaces

[BETA] (Optional) Multi-Viewport Support!

If you are new to Dear ImGui and trying to integrate it into your engine, you can probably ignore this for now.
This feature allows you to seamlessly drag Dear ImGui windows outside of your application viewport.
This is achieved by creating new Platform/OS windows on the fly, and rendering into them.
Dear ImGui manages the viewport structures, and the backend create and maintain one Platform/OS window for each of those viewports. See Recap: https://github.com/ocornut/imgui/wiki/Multi-Viewports See Glossary https://github.com/ocornut/imgui/wiki/Glossary for details about some of the terminology.
About the coordinates system:

ImGuiPlatformIO (struct)

struct ImGuiPlatformIO

Access via ImGui::GetPlatformIO()

Member
void* Platform_ClipboardUserData;
void* Platform_OpenInShellUserData;
void* Platform_ImeUserData;
ImWchar Platform_LocaleDecimalPoint;‘.’
int Platform_SessionDate;Integer storing YYYYMMDD e.g. 20261231 corresponding to the beginning of application session.
int Renderer_TextureMaxWidth;
int Renderer_TextureMaxHeight;
void* Renderer_RenderState;
ImVector<ImGuiPlatformMonitor> Monitors;
ImVector<ImTextureData*> Textures;List of textures used by Dear ImGui (most often 1) + contents of external texture list is automatically appended into this.
ImVector<ImGuiViewport*> Viewports;Main viewports, followed by all secondary viewports.
``
``
``
ImGuiPlatformIO::ImGuiPlatformIO
IMGUI_API ImGuiPlatformIO();
ImGuiPlatformIO::ClearPlatformHandlers
IMGUI_API void ClearPlatformHandlers();

Clear all Platform_XXX fields. Typically called on Platform Backend shutdown.

ImGuiPlatformIO::ClearRendererHandlers
IMGUI_API void ClearRendererHandlers();

Clear all Renderer_XXX fields. Typically called on Renderer Backend shutdown.

ImGuiPlatformMonitor (struct)

struct ImGuiPlatformMonitor

(Optional) This is required when enabling multi-viewport. Represent the bounds of each connected monitor/display and their DPI.
We use this information for multiple DPI support + clamping the position of popups and tooltips so they don’t straddle multiple monitors.

Member
ImVec2 MainPos,Coordinates of the area displayed on this monitor (Min = upper left, Max = bottom right)
MainSize;Coordinates of the area displayed on this monitor (Min = upper left, Max = bottom right)
ImVec2 WorkPos,Coordinates without task bars / side bars / menu bars. Used to avoid positioning popups/tooltips inside this region. If you don’t have this info, please copy the value for MainPos/MainSize.
WorkSize;Coordinates without task bars / side bars / menu bars. Used to avoid positioning popups/tooltips inside this region. If you don’t have this info, please copy the value for MainPos/MainSize.
float DpiScale;1.0 = 96 DPI
void* PlatformHandle;Backend dependant data (e.g. HMONITOR, GLFWmonitor*, SDL Display Index, NSScreen*)
ImGuiPlatformMonitor::ImGuiPlatformMonitor
ImGuiPlatformMonitor();

ImGuiPlatformImeData (struct)

struct ImGuiPlatformImeData

(Optional) Support for IME (Input Method Editor) via the platform_io.Platform_SetImeDataFn() function. Handler is called during EndFrame().

Member
bool WantVisible;A widget wants the IME to be visible.
bool WantTextInput;A widget wants text input, not necessarily IME to be visible. This is automatically set to the upcoming value of io.WantTextInput.
ImVec2 InputPos;Position of input cursor (for IME).
float InputLineHeight;Line height (for IME).
ImGuiID ViewportId;ID of platform window/viewport.
ImGuiPlatformImeData::ImGuiPlatformImeData
ImGuiPlatformImeData();

imgui_stacklayout.h

Stack Layout API

ImGuiLayoutDebugFlags_ (enum)

enum ImGuiLayoutDebugFlags_

The type of its values in the API: typedef int ImGuiLayoutDebugFlags;

Flags for SetNextLayoutDebugFlags()

MemberValue
ImGuiLayoutDebugFlags_None = 00
ImGuiLayoutDebugFlags_DrawSprings = 1 << 01 << 0Draw springs and their spacing.
ImGuiLayoutDebugFlags_DrawItems = 1 << 11 << 1Draw the bounds of the items between springs.

ImGui::BeginHorizontal

IMGUI_API void BeginHorizontal(const char* str_id, const ImVec2& size = ImVec2(0, 0), float align = -1.0f);
IMGUI_API void BeginHorizontal(const void* ptr_id, const ImVec2& size = ImVec2(0, 0), float align = -1.0f);
IMGUI_API void BeginHorizontal(int id, const ImVec2& size = ImVec2(0, 0), float align = -1);

See it live: Layout › Stack Layout (also used in 1 other section)

Layout › Stack Layout
Code from the demo
ImGui::SetNextLayoutDebugFlags(draw_springs ? ImGuiLayoutDebugFlags_DrawSprings : ImGuiLayoutDebugFlags_None);
if (horizontal) { ImGui::BeginHorizontal("h1", layout_size, alignment); } else { ImGui::BeginVertical("v1", layout_size, alignment); }

Stack layouts: items flow along the layout, and springs share the free space by weight.

ImGui::EndHorizontal

IMGUI_API void EndHorizontal();

See it live: Layout › Stack Layout

Layout › Stack Layout
Code from the demo
if (horizontal) { ImGui::EndHorizontal(); } else { ImGui::EndVertical(); }

ImGui::BeginVertical

IMGUI_API void BeginVertical(const char* str_id, const ImVec2& size = ImVec2(0, 0), float align = -1.0f);
IMGUI_API void BeginVertical(const void* ptr_id, const ImVec2& size = ImVec2(0, 0), float align = -1.0f);
IMGUI_API void BeginVertical(int id, const ImVec2& size = ImVec2(0, 0), float align = -1);

See it live: Layout › Stack Layout (also used in 1 other section)

Layout › Stack Layout
Code from the demo
ImGui::SetNextLayoutDebugFlags(draw_springs ? ImGuiLayoutDebugFlags_DrawSprings : ImGuiLayoutDebugFlags_None);
if (horizontal) { ImGui::BeginHorizontal("h1", layout_size, alignment); } else { ImGui::BeginVertical("v1", layout_size, alignment); }

ImGui::EndVertical

IMGUI_API void EndVertical();

See it live: Layout › Stack Layout

Layout › Stack Layout
Code from the demo
if (horizontal) { ImGui::EndHorizontal(); } else { ImGui::EndVertical(); }

ImGui::Spring

IMGUI_API void Spring(float weight = 1.0f, float spacing = -1.0f);

See it live: Layout › Stack Layout

Layout › Stack Layout
Code from the demo
if (spring_a)   { ImGui::Spring(a_c_spring_weight); }

ImGui::SuspendLayout

IMGUI_API void SuspendLayout();

ImGui::ResumeLayout

IMGUI_API void ResumeLayout();

ImGui::SetNextLayoutDebugFlags

IMGUI_API void SetNextLayoutDebugFlags(ImGuiLayoutDebugFlags flags);

See it live: Layout › Stack Layout

Layout › Stack Layout
Code from the demo
ImGui::SetNextLayoutDebugFlags(draw_springs ? ImGuiLayoutDebugFlags_DrawSprings : ImGuiLayoutDebugFlags_None);

Draw the next layout and the layouts nested in it. Exact once the outermost layout ends, as their sizes settle there.

imgui_stdlib.h

ImGui::InputText() with std::string

Because text input needs dynamic resizing, we need to setup a callback to grow the capacity

ImGui::InputText

IMGUI_API bool InputText(const char* label, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr);

See it live: Widgets › Basic › InputText (also used in 18 other sections)

Widgets › Basic › InputText
Code from the demo
static char str0[128] = "Hello, world!";
ImGui::InputText("input text", str0, IM_COUNTOF(str0));

ImGui::InputTextMultiline

IMGUI_API bool InputTextMultiline(const char* label, std::string* str, const ImVec2& size = ImVec2(0, 0), ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr);

See it live: Widgets › Text Input › Multi-line Text Input (also used in 2 other sections)

Widgets › Text Input › Multi-line Text Input
Code from the demo
ImGui::CheckboxFlags("ImGuiInputTextFlags_AllowTabInput", &flags, ImGuiInputTextFlags_AllowTabInput);
ImGui::SameLine(); HelpMarker("When _AllowTabInput is set, passing through the widget with Tabbing doesn't automatically activate it, in order to also cycling through subsequent widgets.");
ImGui::CheckboxFlags("ImGuiInputTextFlags_CtrlEnterForNewLine", &flags, ImGuiInputTextFlags_CtrlEnterForNewLine);
ImGui::InputTextMultiline("##source", text, IM_COUNTOF(text), ImVec2(-FLT_MIN, ImGui::GetTextLineHeight() * 16), flags);

ImGui::InputTextWithHint

IMGUI_API bool InputTextWithHint(const char* label, const char* hint, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr);

See it live: Widgets › Basic › InputText (also used in 2 other sections)

Widgets › Basic › InputText
Code from the demo
static char str1[128] = "";
ImGui::InputTextWithHint("input text (w/ hint)", "enter text here", str1, IM_COUNTOF(str1));
}

Typedefs

ImFontAtlasRectId (typedef)

typedef int ImFontAtlasRectId;

ImGuiKeyChord (typedef)

typedef int ImGuiKeyChord;

== int. We generally use ImGuiKeyChord to mean “a ImGuiKey or-ed with any number of ImGuiMod_XXX value”, but you may store only mods in there.

ImTextureID (typedef)

typedef ImU64 ImTextureID;

ImDrawIdx (typedef)

typedef unsigned short ImDrawIdx;

ImGuiID (typedef)

typedef unsigned int ImGuiID;

A unique ID used by widgets (typically the result of hashing a stack of string)

ImS8 (typedef)

typedef signed char ImS8;

8-bit integer

ImU8 (typedef)

typedef unsigned char ImU8;

8-bit integer

ImS16 (typedef)

typedef signed short ImS16;

16-bit integer

ImU16 (typedef)

typedef unsigned short ImU16;

16-bit integer

ImS32 (typedef)

typedef signed int ImS32;

32-bit integer == int

ImU32 (typedef)

typedef unsigned int ImU32;

32-bit integer (often used to store packed colors)

ImS64 (typedef)

typedef signed long long ImS64;

64-bit integer

ImU64 (typedef)

typedef unsigned long long ImU64;

64-bit integer

ImWchar (typedef)

typedef ImWchar32 ImWchar;

ImWchar16 (typedef)

typedef unsigned short ImWchar16;

ImWchar32 (typedef)

typedef unsigned int ImWchar32;

ImGuiMemAllocFunc (typedef)

typedef void* (*ImGuiMemAllocFunc)(size_t sz, void* user_data);

ImGuiMemFreeFunc (typedef)

typedef void (*ImGuiMemFreeFunc)(void* ptr, void* user_data);

ImDrawCallback (typedef)

typedef void (*ImDrawCallback)(const ImDrawList* parent_list, const ImDrawCmd* cmd);

ImGuiInputTextCallback (typedef)

typedef int (*ImGuiInputTextCallback)(ImGuiInputTextCallbackData* data);

ImGuiSizeCallback (typedef)

typedef void (*ImGuiSizeCallback)(ImGuiSizeCallbackData* data);