AI NuGet: ImGui SDK
AI-first map for the optional EyeAuras ImGui SDK package.
ImGui SDK Discovery Map
Reference map for optional EyeAuras.ImGuiSdk: ImGui render loop, managed
ImGui windows, reusable content, images, fonts, and RE-style tool windows.
User Intents
- Add ImGui UI to a script project.
- Render per-frame ImGui content.
- Open managed ImGui tool windows.
- Host reusable content object.
- Use ImGui images/fonts.
- Host
ReProcessUI. - Build the root control surface for a large script app or bot.
Concept Model
EyeAuras.ImGuiSdkis an optional NuGet package.- Scripts must opt in with a package reference plus
ImGuiContainerExtensions. - The package reference makes ImGui SDK types compile; the container extension makes ImGui SDK services available from the script container.
IImGuiExperimentalApiowns the overlay/render-loop entry point.AddRenderer(...)subscribes per-frame renderer.RunOnce(...)schedules one frame callback.ImGuiWindowManagerowns managed tool windows.ICanBeDisplayedInImGuiis reusable content contract.IImGuiWindowContentreceivesImGuiWindowCtx.- ImGui font/image/markdown helpers can use embedded resources through
IScriptFileProvider. - ImGui is process-global in practice: the native ImGui/ImGui.NET runtime is a singleton-style integration inside the host process and does not support multiple independent ImGui contexts or multiple library versions in one app.
Required Setup
For script mini-apps, EyeAuras.ImGuiSdk has two required setup steps:
- Reference the package:
EyeAuras.ImGuiSdk. - Add the container extension before resolving ImGui services:
AddNewExtension<ImGuiContainerExtensions>();
var imgui = GetService<IImGuiExperimentalApi>();
Do not assume IImGuiExperimentalApi, ImGuiWindowManager, or other ImGui SDK
services are available just because the package compiles. Without
ImGuiContainerExtensions, service resolution can fail or return an incomplete
host setup.
Process-Global Runtime
Treat ImGui as a shared host capability, not as an isolated per-script library.
- There is one ImGui integration inside the process.
- Do not reference or load multiple versions of ImGui.NET or the ImGui SDK in the same EyeAuras process.
- Do not create independent ImGui contexts from script code.
- Do not assume a script mini-app can upgrade/downgrade ImGui separately from the running host.
- Rendering failures are high impact: a bad native call, invalid texture/font usage, or unhandled exception in a render callback can destabilize or crash the whole app.
- Keep render callbacks defensive: validate input, avoid blocking work, catch and log exceptions around risky sections, and dispose renderer/window subscriptions with the owning script lifetime.
API Details
IImGuiExperimentalApi- render loop, settings, fonts, images.ImGuiContainerExtensions- registers ImGui SDK services in script DI.WhenRender,AddRenderer,RunOnce- frame integration.NoActivate,ShowInTaskbar,VSync,MaxFramesPerSecond- overlay/window behavior and frame pacing.ImGuiWindowManager.OpenNew(...)- managed windows.ImGuiNewWindowArgs- window creation options.ImGuiWindowHost- hosted window lifetime.ICanBeDisplayedInImGui-ToImGui().IImGuiWindowContent- window-aware content.IImGuiWindowContentPreBegin- pre-Beginhook.ImGuiWindowCtx- title, focus, close request.ImGuiEx- helper controls and utilities.IImGuiExperimentalApi.AddFont(...)- add font bytes and get anImGuiFontSpec.IImGuiExperimentalApi.ReplaceFont(...)- make a font the default font.IImGuiExperimentalApi.RemoveFont(...)- remove a registered font.IImGuiExperimentalApi.GetOrAddImage(...)/RemoveImage(...)- explicit texture/image registration.
Package / Extension Shape
- Package reference:
EyeAuras.ImGuiSdk. - Main namespaces:
EyeAuras.ImGuiSdk,ImGuiNET, and oftenSystem.Numerics. - In script mini-apps, always add
ImGuiContainerExtensionsbefore resolving ImGui SDK services from the script container. - In ordinary app/plugin code, use the host's DI/composition pattern rather than assuming script-only helpers are present.
- Add the created API/window/render subscription to the owner lifetime.
- The render callback runs every frame; it must be fast and non-blocking.
Built-In Helpers / Controls
ImGuiEx is the first place to check before writing custom widgets.
- Selection controls:
EnumCombo<TEnum>for enum selection.ComboBoxEx<T>for single or multi selection with filtering, preview text, and checked-state callbacks.DropdownButton<T>for button-triggered filtered pickers.
- Boolean and confirmation controls:
Checkbox(label, getter, setter)for property-backed checkboxes.ToggleButton(...)for on/off buttons with active styling.ConfirmButton(...)for destructive or high-risk commands that need an explicit second click, Enter confirmation, Escape cancel, or auto-revert.
- Text and hotkey inputs:
TextField(...)for label + stretched text input rows.TextFieldWithConfirmButtons(...)for edit/save/cancel flows.HotkeyEditor(...)for recording anImGuiKey; overloads exist for WPFKeyand WinFormsKeys.
- Layout helpers:
FlexHorizontal(...)for table-based horizontal rows.Stretched(...)for value + fixed-width action layouts.ImGuiListClipper()for large repeated lists.
- Filterable tables:
TableTabState<T>inEyeAuras.AI.Desktopis a reusable base for ImGui tables with refresh, text/regex filtering, sorting, row selection, and row context menus.- Use
SelectedItem,HasSelectedItem, andSelectedRowKeywhen external controls such as anAttach,Open, orInspectbutton need the current row selection. - Use it when a mini-app needs a searchable process/window/entity/module/ artifact list instead of hand-rolling table state.
- It is an
EyeAuras.AI.Desktophelper, not a core ImGui.NET primitive.
- Display helpers:
DisplayPropertyGrid(...)for object or dictionary inspection.DisplayErrors(...)forIHasErrorProvider.RenderToImGui(...)for common values,ICanBeDisplayedInImGui, paths, matrices, and copy-on-click fallback values.MarkdownBox(...)for markdown text with optional custom link rendering.
- Images and fonts:
ImageRgba32(...)forImage<Rgba32>textures.ImageFromUrl(...)for URL/data image rendering.AddFont,ReplaceFont,PushFont,PopFont,GetAwesomeFont, andAwesomeIcon(...)for custom fonts and built-in Font Awesome icons.
- Drawing helpers:
TextUnformattedOutlined(...)andTextOutline(...)for readable overlay labels.ColorExtensionsconvertSystem.Drawing.Color,System.Windows.Media.Color, andVector4into ImGui color formats.ImGuiExtensionsadd draw-list helpers such as rectangles, dashed lines, dashed circles, and filled circles.ImDrawListWorldExtensionscontains W2S/world-space helpers for ESP-style drawing: lines, 2D/3D boxes, spheres, cylinders, and world text.
Assets, Fonts, And Resources
- Fonts can be loaded from embedded resource bytes, generated static byte arrays, files, or other byte sources.
- Use
IImGuiExperimentalApi.AddFont(...)to register a font andReplaceFont(...)to make it default. - Older examples may mention
AddFontFromMemoryTTF; current SDK surface isAddFont(...)plus optionalReplaceFont(...). - Use
ImGuiEx.PushFont(fontSpec)/PopFont(fontSpec)for scoped font use. - Use
ImGuiFontRangeTypewhen the font must include non-default glyph ranges such as Cyrillic, Greek, Japanese, Korean, Thai, Vietnamese, or Chinese. - Use
IScriptFileProviderto read embedded font/image/markdown bytes from a script project. - Use
ImageRgba32(...)when the mini-app already has anImage<Rgba32>. - Use
ImageFromUrl(...)for URL or data-image sources; embedded/local assets are usually better read throughIScriptFileProvider. - Use stable image labels because
ImGuiEximage helpers cache loading, texture, and preview state by ImGui ID.
Control State And IDs
ImGui is immediate-mode, but controls still keep short-lived UI state. The key is the ImGui ID.
- An ID is derived from the current ImGui ID stack plus the control label.
ImGuiExusesImGui.GetID(label)and an internal state dictionary for many controls.- If the ID stays stable across frames, state is preserved.
- If the ID changes, state is reset.
- If two controls share the same ID, their state collides.
- If two different
ImGuiExcontrol types share the same ID, one can overwrite the other's cached state.
Stateful ImGuiEx examples:
ComboBoxExkeeps filter text, open/closed tracking, pinned popup width, and filtered item indices.DropdownButtonkeeps filter text, pending multi-select edits, popup width, and item snapshots.ConfirmButtonkeeps whether the button is armed and when it should auto-revert.TextFieldWithConfirmButtonskeeps edit mode, buffer text, and focus request.HotkeyEditorkeeps recording state, pending key, original key, and focus request.ImageRgba32/ImageFromUrlkeep texture/loading/preview state.MarkdownBoxkeeps parsed/rendering state and image/copy tooltip state.
ID rules for generated UI:
- Use stable labels for stable controls:
ImGuiEx.ComboBoxEx("Reader", ...). - Use hidden suffixes when visible labels repeat:
Reader##local,Reader##kernel. - Use
##idwhen the visible label is drawn separately and the widget itself should have no text label. - Use
###idwhen the visible text changes but the same control state must be preserved. - Wrap repeated rows with
ImGui.PushID(stableItemId)/ImGui.PopID(). - Prefer domain IDs over list indexes when the list can be sorted, filtered, or reordered.
- Do not generate IDs from
Guid.NewGuid(), timestamps, random values, or changing display text. - Do not create unbounded new IDs every frame;
ImGuiExstate is cached by ID.
Custom Controls
- For script projects and mini-apps, build reusable controls as ordinary static
helper methods or small classes that call
ImGuiandImGuiEx. - Do not try to extend
ImGuiExwith apartialclass from a script project;ImGuiExpartial files belong to the ImGui SDK assembly itself. - A control should usually take a stable
label, current value, and setter orrefvalue, then returntruewhen the user changed something. - For multi-frame state, prefer fields on a content object that implements
ICanBeDisplayedInImGuiorIImGuiWindowContent. - For reusable static controls, use the caller-provided label as the root ID and
isolate child widgets with
PushIDplus hidden labels. - If the custom control must keep its own static state, key that state by
ImGui.GetID(label)in the current ID stack. - Use
IImGuiWindowContentwhen a control/panel needs access toImGuiWindowCtxto change title, request focus, or request close. - Use
IImGuiWindowContentPreBeginonly when the content must callImGui.SetNextWindow*before the managed window callsImGui.Begin.
Example shape:
static bool ReaderPicker(
string label,
IReadOnlyList<ReaderOption> readers,
ref ReaderOption selected)
{
return ImGuiEx.ComboBoxEx(label, readers, ref selected,
new ImGuiEx.ComboBoxExOptions<ReaderOption>
{
ItemTextGetter = x => x.Name,
ShowFilter = true,
FilterHint = "Filter readers..."
});
}
For a larger panel, put the state into a class and implement
ICanBeDisplayedInImGui.ToImGui(). The panel can call the helper above every
frame and react only when it returns true.
Stateful custom control shape:
private sealed class SearchBoxState
{
public bool FocusNext;
}
private static readonly Dictionary<uint, SearchBoxState> SearchBoxStates = new();
static SearchBoxState GetSearchBoxState(string label)
{
var id = ImGui.GetID(label);
if (!SearchBoxStates.TryGetValue(id, out var state))
{
state = new SearchBoxState();
SearchBoxStates[id] = state;
}
return state;
}
static bool SearchBox(string label, ref string filter)
{
var state = GetSearchBoxState(label);
ImGui.PushID(label);
try
{
if (state.FocusNext)
{
ImGui.SetKeyboardFocusHere();
state.FocusNext = false;
}
ImGui.SetNextItemWidth(-1);
return ImGui.InputTextWithHint("##input", "Filter...", ref filter, 256);
}
finally
{
ImGui.PopID();
}
}
Prefer
- Prefer this package map for ImGui APIs.
- Prefer
AddNewExtension<ImGuiContainerExtensions>()as the first ImGui setup step in scripts. - Prefer
AddRendererfor root overlay rendering. - Prefer
ImGuiWindowManager.OpenNewfor tool windows. - Prefer
ICanBeDisplayedInImGuifor reusable panels. - Prefer
recipes/bot-memory-imgui-interface.mdfor root-window, bot-loop, and ImGui-plus-Blazor architecture. - Prefer
windows-subsystems/blazor-windows.mdfor Razor UI. - Prefer
osd/screen-overlay.mdfor screen annotations. - Prefer stable ImGui IDs for every stateful or repeated control.
- Prefer
scripting/references-and-resources.mdfor package/resource and embedded file rules.
Avoid
- Avoid assuming ImGui APIs are in base SDK.
- Avoid assuming the package reference alone registers ImGui services in script DI.
- Avoid resolving
IImGuiExperimentalApibefore addingImGuiContainerExtensions. - Avoid render subscriptions without owner lifetime.
- Avoid managing many ad hoc
ImGui.Beginwindows when manager exists. - Avoid duplicating widgets already provided by
ImGuiEx. - Avoid unstable labels for stateful/repeated controls; unstable ids cause lost focus, mixed state, and wrong selection.
- Avoid blocking or sleeping inside render callbacks.
- Avoid bringing another ImGui.NET or ImGui SDK version into the same process.
- Avoid unhandled exceptions escaping render callbacks; log and degrade the UI instead.
Research Anchors
EyeAuras.ImGuiSdk,IImGuiExperimentalApi,ImGuiWindowManager,ImGuiWindowHost,ImGuiNewWindowArgs,ImGuiWindowCtx,ICanBeDisplayedInImGui,IImGuiWindowContent,IImGuiWindowContentPreBegin,ImGuiEx,ImGuiModule,ImGuiContainerExtensions,ImGuiExperimentalApi,ImGuiFontSpec,ImGuiFontRangeType,AddFont,ReplaceFont,RemoveFont,AddFontFromMemoryTTF,IScriptFileProvider,ImGui.GetID,ImGui.PushID,ImGui.PopID,GetOrAddState,ComboBoxEx,DropdownButton,ConfirmButton,TextField,TextFieldWithConfirmButtons,HotkeyEditor,ToggleButton,TableTabState<T>,SelectedItem,HasSelectedItem,SelectedRowKey,DisplayPropertyGrid,MarkdownBox,ImageRgba32,ImageFromUrl,AwesomeIcon,TextUnformattedOutlined,ImGuiExtensions,ImDrawListWorldExtensions,ColorExtensions,ImGui context,ImGui.NET,render callback exception,process-global singleton.
Search Synonyms
- ImGui
- ImGui SDK
- immediate mode UI
- ImGui window
- render loop
- tool window
- ImGui overlay
- ImGui image
- ImGui font
- ImGuiContainerExtensions
- ImGui font range
- AddFontFromMemoryTTF
- embedded font
- embedded image
- ImGuiEx
- ImGui ID
- PushID
- hidden label
- stable label
- stateful control
- control state
- custom ImGui control
- filterable table
- sortable table
- row context menu
- TableTabState
- property grid
- hotkey editor
- markdown
- Font Awesome
- world to screen
- ESP drawing
- ImGui singleton
- ImGui context
- multiple ImGui versions
- render callback exception
Related Maps
auras/overlays.mdrecipes/bot-memory-imgui-interface.mdwindows-subsystems/blazor-windows.mdosd/screen-overlay.mdreverse-engineering/reprocess.mdscripting/async.mdscripting/container-extensions.mdscripting/references-and-resources.md