Skip to main content

Crate dear_imgui_rs

Crate dear_imgui_rs 

Source
Expand description

§Dear ImGui - Rust Bindings with Docking Support

High-level Rust bindings for Dear ImGui, the immediate mode GUI library. This crate provides safe, idiomatic Rust bindings with full support for docking and multi-viewport features.

§Features

  • Safe, idiomatic Rust API
  • Full docking and multi-viewport support
  • Builder pattern for widgets
  • Memory-safe string handling
  • Integration with modern Rust graphics ecosystems

§Quick Start

use dear_imgui_rs::*;

let mut ctx = Context::create();
let ui = ctx.frame();

ui.window("Hello World")
    .size([300.0, 100.0], Condition::FirstUseEver)
    .build(|| {
        ui.text("Hello, world!");
        ui.text("This is Dear ImGui with docking support!");
    });

§Math Interop (mint/glam)

Many drawing and coordinate-taking APIs accept impl Into<sys::ImVec2> so you can pass:

  • [f32; 2] or (f32, f32)
  • dear_imgui_sys::ImVec2
  • mint::Vector2<f32> (via dear-imgui-sys conversions)
  • With the optional glam feature, glam::Vec2 directly (via impl From<glam::Vec2> for ImVec2 in dear-imgui-sys)

Example:

let dl = ui.get_window_draw_list();
dl.add_line([0.0, 0.0], [100.0, 100.0], [1.0, 1.0, 1.0, 1.0]).build();
// Also works with mint::Vector2<f32>
let a = mint::Vector2 { x: 10.0, y: 20.0 };
let b = mint::Vector2 { x: 30.0, y: 40.0 };
dl.add_rect(a, b, [1.0, 0.0, 0.0, 1.0]).build();
// And with glam::Vec2 when the `glam` feature is enabled
#[cfg(feature = "glam")]
{
    let a = glam::Vec2::new(10.0, 20.0);
    let b = glam::Vec2::new(30.0, 40.0);
    dl.add_rect(a, b, [0.0, 1.0, 0.0, 1.0]).build();
}

§Textures (ImGui 1.92+)

You can pass either a legacy TextureId or a Context-owned managed texture handle:

// 1) Legacy handle
let tex_id = texture::TextureId::new(0x1234);
// 2) Transfer an owned texture into this Context.
let tex = texture::OwnedTextureData::from_pixels(
    texture::TextureFormat::RGBA32,
    256,
    256,
    &vec![255; 256 * 256 * 4],
)?;
let managed = context.register_texture(tex);
let ui = context.frame();
ui.image(tex_id, [64.0, 64.0]);
ui.image(managed, [256.0, 256.0]);

TextureRef<'tex> is pointer-free for user textures. It stores either a legacy value handle, a Context/slot/generation managed identity, or an internal font-atlas reference backed by an owner lease. The owning Ui resolves managed handles immediately before FFI and rejects foreign, stale, or retiring handles first.

§Texture Management Guide

  • Concepts:
    • TextureId: legacy plain handle (e.g., GL texture name, Vk descriptor).
    • OwnedTextureData: transferable CPU-side texture allocation prepared before registration.
    • ManagedTextureId: opaque Context/slot/generation identity used by widgets and draw lists.
    • ManagedTextureRef / ManagedTextureMut: non-escaping Context-scoped inspection and pixel updates which do not expose native pointers or renderer-owned fields.
    • TextureRef<'tex>: logical image source constructed from TextureId, ManagedTextureId, or an owner-backed font-atlas texture lease.
  • Basic flow:
    1. Create OwnedTextureData with from_pixels(format, w, h, pixels); the payload length is validated exactly before native allocation.
    2. Transfer ownership with Context::register_texture(tex) and retain its handle.
    3. Mutate before a frame with Context::try_with_texture_mut(handle, |tex| ...), using replace_pixels() for a full replacement or update_subresource() for a strided region.
    4. Use the handle in UI via ui.image(handle, size) or draw-list APIs.
    5. Call Context::remove_texture(handle) to begin generation-safe retirement.
    6. A renderer processes request-owned bytes from PendingFrame::texture_requests() or FrameSnapshot::texture_requests() and returns feedback created by each request.
  • Alternatives: when you already have a GPU handle, pass TextureId directly.

§Renderer Integration (Modern Textures)

When integrating a renderer backend (WGPU, OpenGL, etc.) with ImGui 1.92+:

  • Create one SynchronousRendererConsumer or DetachedRendererConsumer from the Context and keep it alive with that renderer path. This explicitly claims managed font-atlas ownership.
  • Set BackendFlags::RENDERER_HAS_TEXTURES before the first frame. Do not call LegacyFontAtlas::build; managed renderers build and upload the atlas from texture requests.
  • Synchronous renderer APIs consume a Context-borrowed PendingFrame, reconcile it, then draw the resulting ReconciledFrame; detached renderers consume a move-only FrameSnapshot.
  • Each frame, give every texture request one explicit uploaded, destroyed, superseded, or retry outcome.
  • Reconcile synchronous feedback before rendering draw commands that depend on new IDs; cargo run -j 1 -p dear-imgui-rs --example custom_renderer_headless is the executable reference for the complete synchronous request, draw, and reset sequence. detached snapshots commit feedback when their GPU work is complete.
  • Bind DrawCmdParams::texture_id. Command iteration resolves the effective ID for both legacy and managed texture references.
  • Before destroying the renderer’s complete GPU texture map, call Context::prepare_renderer_texture_reset. Destroy the map only after preparation succeeds, then commit the permit before dropping the consumer.

Pseudocode outline:

// 1) Configure context
let consumer = context.create_synchronous_renderer_consumer()?;
context.io_mut().set_backend_flags(
    context.io().backend_flags() | BackendFlags::RENDERER_HAS_TEXTURES,
);
let pending = context.render(&consumer);
let mut feedback = Vec::new();
for request in pending.texture_requests() {
    feedback.push(match request.operation() {
        TextureOp::Create { .. } | TextureOp::Update { .. } =>
            request.uploaded(upload_to_gpu(request))?,
        TextureOp::Destroy => {
            destroy_gpu_texture(request.texture());
            request.destroyed()?
        }
    });
}
let frame = pending.reconcile_texture_feedback(feedback)?;

// Rendering uses IDs resolved by the owning Context.
for draw_list in frame.draw_data().draw_lists() {
  for cmd in draw_list.commands() {
    match cmd {
        Elements { cmd_params, .. } => {
            bind_texture(cmd_params.texture_id);
            draw(cmd_params);
        }
        _ => { /* ... */ }
    }
  }
}
drop(frame);

// Shutdown only after every frame and its GPU work has completed.
let reset = context.prepare_renderer_texture_reset(&consumer)?;
destroy_all_gpu_textures();
reset.commit();
drop(consumer);

For thread-safe render work, register one renderer consumer and capture a Context-created, move-only render::FrameSnapshot.

§Safe API Migration Notes

The safe layer intentionally rejects old patterns that depended on hidden C current-context or aliasing state:

  • Use TextureId for legacy handles and ManagedTextureId for Context-owned textures.
  • Borrowed &mut TextureData is intentionally not an image source; transfer ownership with Context::register_texture and mutate it through a Context-scoped closure.
  • Synchronous renderer backends turn a Context-borrowed PendingFrame into a drawable ReconciledFrame; detached renderers consume a move-only FrameSnapshot and commit request-bound feedback.
  • FontId is a persistent, atlas-validated handle. It may be stored in style state, but Ui::push_font, DrawListMut::add_text_with_font, and Ui::push_font_with_size validate the active atlas before entering FFI. FontAtlas::clear, clear_fonts, and remove_font invalidate existing FontId values from that atlas.
  • Context::font_atlas() returns &FontAtlas; use font_atlas() for startup-time font loading and atlas mutation.
  • RAII tokens for windows, stacks, popups, tables, draw-list texture stacks, and extension scopes are UI/current-context scoped and !Send + !Sync. Drop them on the creating UI thread.
  • Use Ui::with_state_storage for a panic-safe, nested state-storage override. Both the replacement and its StateStorage view are confined to the closure.
  • Use Ui::with_multi_select for advanced multi-select flows. It returns an owned MultiSelectResult; no view into Dear ImGui’s temporary begin/end IO escapes the closure.

§Colors (ImU32 ABGR)

Dear ImGui uses a packed 32-bit color in ABGR order for low-level APIs (aka ImU32). When you need a packed color (e.g. TableSetBgColor), use colors::Color::to_imgui_u32():

// Pack RGBA floats to ImGui ABGR (ImU32)
let abgr = Color::rgb(1.0, 0.0, 0.0).to_imgui_u32();
ui.table_set_cell_bg_color_u32(abgr, TableColumnRef::Current);

For draw-list helpers you can continue to pass [f32;4] or use draw::ImColor32 which represents the same ABGR packed value in a convenient wrapper.

§Text Input (String vs ImString)

This crate offers two ways to edit text:

  • String-backed builders: ui.input_text(label, &mut String) and ui.input_text_multiline(label, &mut String, size).
    • Internally stage a growable UTF�? buffer for the call and copy the edited bytes back into your String afterwards.
    • For very large fields, use .capacity_hint(bytes) on the builder to reduce reallocations, e.g.:
      ui.input_text("Big", big)
          .capacity_hint(64 * 1024)
          .build();
  • ImString-backed builders: ui.input_text_imstr(label, &mut ImString) and ui.input_text_multiline_imstr(label, &mut ImString, size).
    • Zero‑copy: pass your ImString buffer directly to ImGui.
    • Uses ImGui’s CallbackResize under the hood to grow the same buffer the widget edits �?no copy before/after the call.

Choose String for convenience (especially for small/medium inputs). Prefer ImString when you want to avoid copies for large or frequently edited text.

§Low-level Draw APIs

Draw list wrappers expose both high-level primitives and some low-level building blocks:

  • Concave polygons (ImGui 1.92+):

    • DrawListMut::add_concave_poly_filled(&[P], color) fills an arbitrary concave polygon.
    • DrawListMut::path_fill_concave(color) fills the current path using the concave tessellator.
    • Note: requires Dear ImGui 1.92 or newer in dear-imgui-sys.
  • Channels splitting:

    • DrawListMut::channels_split(count, |channels| { ... }) splits draw into multiple channels and automatically merges on scope exit. Call channels.set_current(i) to select a channel.
  • Clipping helpers:

    • push_clip_rect, push_clip_rect_full_screen, with_clip_rect, clip_rect_min, clip_rect_max.
  • Unsafe prim API (for custom geometry):

    • prim_reserve, prim_unreserve, prim_rect, prim_rect_uv, prim_quad_uv, prim_write_vtx, prim_write_idx, prim_vtx.
    • Safety: these mirror ImGui’s low-level geometry functions. Callers must respect vertex/index counts, write exactly the reserved amounts, and ensure valid topology. Prefer high-level helpers unless you need exact control.
  • Callbacks during draw:

    • Raw: unsafe DrawListMut::add_callback allows passing a C callback and raw userdata; see method docs for safety requirements.

Re-exports§

pub extern crate dear_imgui_sys as sys;

Re-exports§

pub use self::fonts::*;
pub use self::input::*;
pub use self::platform_io::*;
pub use render::*;
pub use texture::*;

Modules§

button
Buttons
color
Color widgets
combo
Combo boxes
drag
Drag slider widgets for numeric input
fonts
Font system for Dear ImGui
image
Image widgets
input
Input types (mouse, keyboard, cursors)
internal
Internal low-level types
list_box
List boxes
menu
Menus and menu bars
misc
Miscellaneous widgets
multi_select
Multi-select helpers (BeginMultiSelect/EndMultiSelect)
platform_io
Platform IO functionality for Dear ImGui
plot
Basic plots
popup
Popups and modals
progress
Progress bars
render
Rendering system for Dear ImGui.
selectable
Selectable items
slider
Sliders
tab
Tabs
table
Tables
text
Text helpers
texture
Texture management for Dear ImGui
tooltip
Tooltips
tree
Trees and collapsing headers

Structs§

AngleSlider
Builder for an angle slider widget.
BackendFlags
Backend capabilities
BasicSelection
Selection container backed by Dear ImGui’s ImGuiSelectionBasicStorage.
BasicSelectionIter
Iterator over selected ids stored in BasicSelection.
Button
Builder for button widget
ButtonFlags
Independent flags for invisible buttons.
ChildFlags
Configuration flags for child windows
ChildWindow
Represents a child window that can be built
ClipRectToken
Tracks a pushed clip rect that will be popped on drop.
Color
RGBA color with 32-bit floating point components
ColorButton
Builder for a color button widget
ColorButtonFlags
Independently composable flags accepted by ColorButton().
ColorButtonOptions
Options accepted by ColorButton().
ColorEdit3
Builder for a 3-component color edit widget
ColorEdit4
Builder for a 4-component color edit widget
ColorEditFlags
Independently composable flags accepted by ColorEdit3(), ColorEdit4(), and Io::set_color_edit_options().
ColorEditOptions
Options accepted by ColorEdit3(), ColorEdit4(), and Io::set_color_edit_options().
ColorOverride
A single color override for a given StyleColor entry.
ColorPicker3
Builder for a 3-component color picker widget
ColorPicker4
Builder for a 4-component color picker widget
ColorPickerDisplayFlags
Display sub-editors visible inside ColorPicker*().
ColorPickerFlags
Independently composable flags accepted by ColorPicker3() and ColorPicker4().
ColorPickerOptions
Options accepted by ColorPicker3() and ColorPicker4().
ColorStackToken
Tracks a color pushed to the color stack that can be popped by calling .end() or by dropping.
ColumnBuilder
Chainable builder for a single column. Use .done() to return to the table builder.
ComboBox
Builder for a combo box widget
ComboBoxFlags
Independent flags for combo box widgets.
ComboBoxOptions
Complete combo box options assembled from independent flags and exclusive mode selections.
ComboBoxToken
Tracks a combo box that can be ended by calling .end() or by dropping.
ConfigFlags
Configuration flags
Context
An imgui context.
ContextActivationError
Failure to activate a suspended Context without losing its owner.
ContextAliveToken
A weak token that reports whether ordinary access to a Context is still valid.
ContextAttachmentHandle
Non-owning identity for one exact Context attachment generation.
ContextAttachmentLease
Lease that unregisters an attachment when explicitly detached or dropped.
ContextAttachmentTeardownError
Non-retryable failure reported by an attachment during Context::drop.
ContextBinding
Persistent, non-thread-safe capability for calling against one live Context.
ContextDestroyed
Pointer-free notification passed after native Context destruction.
ContextId
Process-unique identity for a Dear ImGui context.
ContextPlatformAttachmentRelease
Exclusive permit for an explicit platform attachment release transaction.
ContextPlatformWindowTeardown
Phase-limited capability passed around a normal platform-window teardown transaction.
ContextSuspensionError
Failure to suspend a Context without losing its owner.
ContextTeardown
Phase-limited access passed to pre-destroy attachment hooks.
DisabledToken
Tracks a disabled scope begun with Ui::begin_disabled and ended on drop.
DockNodeFlags
Flags accepted when submitting a dockspace.
DockspaceBuilder
Canonical builder for a dockspace submission.
Drag
Builder for a drag slider widget
DragDropPayload
Raw payload data
DragDropPayloadEmpty
Empty payload (no data, just notification)
DragDropPayloadPod
Typed payload with data
DragDropSource
Builder for creating drag drop sources
DragDropSourceFlags
Flags for drag and drop sources.
DragDropSourceTooltip
Token representing an active drag source tooltip
DragDropTarget
Drag drop target for accepting payloads
DragDropTargetFlags
Flags for drag and drop targets.
DragFlags
Flags for drag widgets.
DragRange
Builder for a drag range slider widget
DrawCornerFlags
Corner rounding flags accepted by rectangle and rounded-image drawing APIs.
DrawListFlags
Draw list flags
DrawListMut
Object implementing the custom draw API.
DrawListTextureToken
Tracks a texture pushed to a draw-list texture stack.
DrawNgonSegmentCount
Segment count for regular n-gon drawing. Dear ImGui requires at least three sides.
DrawSegmentCount
Segment count for draw-list APIs where Dear ImGui accepts 0 as “auto”.
DummyClipboardBackend
Non-functioning placeholder clipboard backend
FocusScopeToken
Tracks a pushed focus scope, popped on drop.
FocusedFlags
Flags for focus detection
FontStackToken
Tracks a font pushed to the font stack that can be popped by calling .end() or by dropping.
FrameLifecycleStamp
Comparable identity and native progress marker for a Context frame boundary.
FramePrepareOptions
Options used by Context::prepare_frame.
FrameResult
Result returned by Context::frame_with_result.
FrameToken
A frame opened by Context::begin_frame.
GroupToken
Tracks a layout group that can be ended with end or by dropping.
Id
Strongly-typed wrapper around ImGuiID.
IdStackToken
Tracks an ID pushed to the ID stack that can be popped by calling .pop() or by dropping. See crate::Ui::push_id for more details.
ImString
A UTF-8 encoded, growable, implicitly nul-terminated string.
Image
Builder for an image widget
ImageButton
Builder for an image button widget
IndentToken
Tracks an indentation scope started with Ui::begin_indent or Ui::begin_indent_by.
IniSessionDate
A Gregorian date that Dear ImGui can round-trip through ImGuiPackedDate.
InputDouble
Builder for double input widget
InputFloat
Builder for float input widget
InputFloat2
Builder for a 2-component float input widget.
InputFloat3
Builder for a 3-component float input widget.
InputFloat4
Builder for a 4-component float input widget.
InputInt
Builder for integer input widget
InputInt2
Builder for a 2-component int input widget.
InputInt3
Builder for a 3-component int input widget.
InputInt4
Builder for a 4-component int input widget.
InputScalar
Builder for an input scalar widget.
InputScalarN
Builder for an input scalar array widget.
InputText
Builder for a text input widget
InputTextCallback
Callback flags for InputText widgets
InputTextImStr
Builder for a text input backed by ImString (zero-copy)
InputTextMultiline
Builder for multiline text input widget
InputTextMultilineImStr
Builder for multiline text input backed by ImString (zero-copy)
InputTextMultilineWithCb
Multiline InputText with attached callback handler
InvisibleButtonMouseButtons
Mouse buttons accepted by invisible buttons.
InvisibleButtonOptions
Complete options accepted by InvisibleButton().
Io
Settings and inputs/outputs for imgui-rs This is a transparent wrapper around ImGuiIO
ItemFlagStackToken
Tracks item flags pushed with Ui::push_item_flag.
ItemFlags
Flags that can be applied to subsequently submitted items.
ItemHoveredFlags
Flags accepted by Ui::is_item_hovered_with_flags().
ItemStateFlags
Flags recorded for the last submitted item.
ItemWidthStackToken
Tracks a change made with Ui::push_item_width that can be popped by calling ItemWidthStackToken::end or dropping.
KeySetSelection
Index-based selection storage backed by a key slice + HashSet of selected keys.
ListBox
Builder for a list box widget
ListBoxToken
Tracks a list box that can be ended by calling .end() or by dropping.
ListClipper
Used to render only the visible items when displaying a long list of items in a scrollable area.
ListClipperIterator
ListClipperToken
List clipper is a mechanism to efficiently implement scrolling of large lists with random access.
LogAutoOpenDepth
Auto-open depth for Dear ImGui logging helpers.
MainMenuBarToken
Tracks a main menu bar that can be ended by calling .end() or by dropping.
MenuBarToken
Tracks a menu bar that can be ended by calling .end() or by dropping.
MenuToken
Tracks a menu that can be ended by calling .end() or by dropping.
ModalPopup
Builder for a modal popup
ModalPopupToken
Tracks a modal popup that can be ended by calling .end() or by dropping.
MultiSelectFlags
Independent flags controlling multi-selection behavior.
MultiSelectOptions
Complete multi-select options assembled from independent flags and an optional single-choice policies.
MultiSelectResult
An owned copy of the IO produced by BeginMultiSelect() or EndMultiSelect().
MultiSelectScope
Closure-scoped access to an active Dear ImGui multi-select block.
NumericFormat
A validated C-style format for one Dear ImGui numeric value.
OwnedStateStorage
Owns an ImGuiStorage and clears it on drop.
PassthroughCallback
This is a ZST which implements InputTextCallbackHandler as a passthrough.
PayloadIsWrongType
Error type for payload type mismatches
PlotHistogram
Builder for a plot histogram widget
PlotLines
Builder for a plot lines widget
PlotValueOffset
Builder for a plot lines widget
PolylineFlags
Flags accepted by AddPolyline() and PathStroke().
PopupContextFlags
Independent flags accepted by OpenPopupOnItemClick() and BeginPopupContext*() call sites.
PopupContextOptions
Complete popup options assembled from independent flags and optional single mouse button.
PopupOpenFlags
Independent flags accepted by OpenPopup*() call sites.
PopupQueryFlags
Independent flags accepted by IsPopupOpen() string-id queries.
PopupToken
Tracks a popup that can be ended by calling .end() or by dropping.
ProgressBar
Builder for a progress bar widget.
RendererTextureReset
One-use permission to reset Context-owned renderer texture bindings.
Selectable
Builder for a selectable widget.
SelectableFlags
Flags for selectables
Slider
Builder for slider widgets.
SliderFlags
Flags for slider widgets.
StateStorage
A non-owning reference to an ImGuiStorage belonging to the current context.
Style
User interface style/colors
StyleStackToken
Tracks a style pushed to the style stack that can be popped by calling .end() or by dropping.
StyleTweaks
High-level style tweaks that can be applied on top of a preset.
SuspendedContext
A suspended Dear ImGui context
TabBar
Builder for a tab bar
TabBarFlags
Independent flags for tab bar widgets.
TabBarOptions
Complete tab bar options assembled from independent flags and optional single fitting policy.
TabBarToken
Token representing an active tab bar.
TabItem
Builder for a tab item
TabItemFlags
Independent flags for tab item widgets.
TabItemOptions
Complete tab item options assembled from independent flags and optional single placement.
TabItemToken
Token representing an active tab item.
TableBuilder
Builder for ImGui tables with columns + headers + sizing/freeze options.
TableColumnFlags
Independent flags accepted by TableSetupColumn().
TableColumnIndex
Concrete zero-based table column index.
TableColumnSetup
Table column setup information
TableColumnSortSpec
One column sort spec.
TableColumnStateFlags
Flags returned by TableGetColumnFlags().
TableColumnUserData
Opaque application data associated with a table column.
TableFlags
Independent flags for table widgets.
TableHeaderData
Safe description of a single angled header cell.
TableOptions
Complete table options assembled from independent flags and an optional single sizing policy.
TableRowFlags
Flags for table rows
TableRowIndex
Concrete zero-based table row index.
TableSortSpecs
Owned snapshot of the current table sort specifications.
TableTheme
Table-related theme defaults (flags/behavior).
TableToken
Tracks a table that can be ended by calling .end() or by dropping
TextCallbackData
This struct provides methods to edit the underlying text buffer that Dear ImGui manipulates. Primarily, it gives remove_chars, insert_chars, and mutable access to what text is selected.
TextFilter
Helper to parse and apply text filters
TextWrapPosStackToken
Tracks a change made with Ui::push_text_wrap_pos that can be popped by calling TextWrapPosStackToken::end or dropping.
Theme
High-level theme configuration for Dear ImGui.
TooltipHoveredFlags
Flags stored in style tooltip hover defaults.
TooltipToken
Tracks a tooltip that can be ended by calling .end() or by dropping.
TreeLineMode
Tree hierarchy guide-line drawing mode stored in ImGuiStyle::TreeLinesFlags.
TreeNode
Builder for a tree node widget
TreeNodeFlags
Flags for tree node widgets
TreeNodeToken
Tracks a tree node that can be popped by calling .pop() or by dropping.
Ui
Represents the Dear ImGui user interface for one frame
UiBuffer
Internal buffer for UI string operations
UnknownCountListClipper
Builder for an unknown-count list clipper.
UnknownCountListClipperToken
Active unknown-count list clipper.
VerticalSlider
Builder for a vertical slider widget.
ViewportFlags
Viewport flags for multi-viewport support
Window
Represents a window that can be built
WindowClass
Window class for docking configuration.
WindowClassDockNodeFlags
Dock-node policies contributed by every window using a crate::WindowClass.
WindowClassViewportFlags
Viewport policy bits that an application may override through crate::WindowClass.
WindowFlags
Configuration flags for windows
WindowHoveredFlags
Flags accepted by Ui::is_window_hovered_with_flags().
WindowKey
Stable Dear ImGui identity for a top-level window.
WindowTheme
Window-related theme defaults (flags/behavior).

Enums§

ColorDataType
Single numeric representation for color edit widgets and defaults.
ColorDisplayMode
Single display mode for color edit widgets.
ColorInputMode
Single input/output color space for color edit and picker widgets.
ColorPickerMode
Single picker implementation for color picker widgets and defaults.
ComboBoxHeight
Height policy for combo box popups.
ComboBoxPreviewMode
Preview/arrow layout for a combo box.
Condition
Condition for setting window/widget properties
ContextActivationReason
Reason a suspended Context could not be activated.
ContextAttachmentDetachError
Failure to explicitly detach a live Context attachment lease.
ContextAttachmentError
Failure to register an attachment with a Context.
ContextAttachmentPhase
Ordered phase of Context teardown exposed to an attachment hook.
ContextAttachmentRole
Exclusive role claimed by a Context attachment.
ContextBindingError
Failure to enter a Context through a persistent binding capability.
ContextLifecycle
Lifecycle visible to persistent safe Context capabilities.
ContextPlatformAttachmentReleaseError
Failure to prepare an explicit platform attachment release.
ContextPlatformWindowTeardownError
Failure while entering or leaving an explicit platform-window teardown transaction.
ContextScopeError
Failure to enter or finish a temporary active-Context scope.
ContextSuspensionReason
Reason an active Context could not be suspended.
Direction
A cardinal direction
DockLayout
A complete declarative dock tree.
DockLayoutApply
Policy controlling whether an existing persisted dock tree is preserved.
DockSplit
Direction of the first child produced by a DockLayout::Split.
DockspaceError
Validation or submission failure for a dockspace.
DragDropPayloadCond
Condition for updating a drag and drop payload.
FrameLifecycleState
Runtime state for a Dear ImGui frame owned by an external engine schedule.
HistoryDirection
Direction for history navigation
ImGuiError
Errors that can occur in Dear ImGui operations
IniSessionDateError
Errors returned when constructing an IniSessionDate.
IniSettingsRetention
One coherent .ini retention configuration owned by a crate::Context.
IniSettingsRetentionError
Errors returned while reading or applying IniSettingsRetention.
MultiSelectBoxSelect
Box-selection geometry for multi-select scopes.
MultiSelectClickPolicy
Click-selection policy for multi-select scopes.
MultiSelectRangeDirection
Iteration order requested for a selected range.
MultiSelectRequest
An owned selection change requested by Dear ImGui.
MultiSelectScopeKind
Scope for box-select and clear-on-empty-click behavior.
NumericFormatError
Describes why a C-style numeric format was rejected.
PopupContextMouseButton
Single mouse button used by popup context helpers.
ScopedActivationError
Failure while temporarily activating a borrowed SuspendedContext.
SortDirection
Sorting direction for table columns.
StyleColor
Style color identifier
StyleVar
A temporary change in user interface style
StyleVarVec2
A two-component style variable whose X or Y component can be overridden.
TabBarFittingPolicy
Single fitting policy for a tab bar.
TabItemPlacement
Single placement option for a tab item or tab item button.
TableBgTarget
Target for table background colors.
TableColumnIndent
Single-choice indentation policy for a table column.
TableColumnRef
Table column selector for APIs that accept Dear ImGui’s current-column sentinel.
TableColumnWidth
Single-choice width mode for a table column.
TableContextMenuTarget
Target column for opening a table context menu.
TableHoveredColumn
Result of crate::Ui::table_get_hovered_column.
TableHoveredRow
Result of crate::Ui::table_get_hovered_row.
TableSizingPolicy
Single-choice table sizing policy.
ThemePreset
Which base preset to start from when applying a Theme.
TreeNodeId
Tree node ID that can be constructed from different types
WindowClassError
Validation failure for a WindowClass.
WindowClassParentViewport
Parent viewport policy for a docking window class.
WindowKeyError
Validation failure while creating a WindowKey.
WindowLabel
Window label accepted by Ui::window.

Constants§

HAS_DOCKING
Check if docking features are available
HAS_FREETYPE
Check if FreeType font rasterizer support is compiled in
HAS_WASM
Check if WASM support is compiled in (sys layer)
VERSION

Traits§

ClipboardBackend
Trait for clipboard backends
ContextAttachment
Type-erased lifecycle hooks owned by a Context.
InputTextCallbackHandler
This trait provides an interface which ImGui will call on InputText callbacks.
MultiSelectIndexStorage
Index-based selection storage for multi-select helpers.
SafeStringConversion
Helper trait for safe string conversion

Functions§

dear_imgui_version
Returns the underlying Dear ImGui library version
with_scratch_txt
Calls f with a temporary, NUL-terminated C string pointer backed by a thread-local scratch buffer.
with_scratch_txt_slice
Calls f with a list of temporary, NUL-terminated C string pointers backed by a thread-local scratch buffer.
with_scratch_txt_slice_with_opt
Calls f with a list of temporary, NUL-terminated C string pointers and one optional pointer backed by a thread-local scratch buffer.
with_scratch_txt_three
Calls f with three temporary, NUL-terminated C string pointers backed by a thread-local scratch buffer.
with_scratch_txt_two
Calls f with two temporary, NUL-terminated C string pointers backed by a thread-local scratch buffer.

Type Aliases§

ButtonRepeatToken
Tracks a button repeat item flag pushed with Ui::push_button_repeat.
ImGuiResult
Result type for Dear ImGui operations
MultiSelectUserData
Application-defined item data passed through Dear ImGui’s multi-select API.
RawDrawCallback
Non-null native callback accepted by DrawListMut::add_callback.