How ocornut/imgui works
Dear ImGui is a platform-agnostic immediate-mode C++ GUI library. An application feeds platform events, creates a frame, emits widgets and tool content, then receives optimized draw lists for a renderer backend to submit to a graphics API. The core also manages layout, interaction, tables, fonts, and reusable UI state. Platform and renderer integrations are modular; FreeType is an optional font-building path. Some relationships are inferred from documented architecture because most core implementations were not sampled.
Main entry points: imgui.cpp UI Context · imgui.h ImGui API · imgui_draw.cpp Draw Lists · backends Renderer Backends
Components 14
Core UI
- ImGui API
imgui.h - UI Context
imgui.cpp - Widgets & Layout
imgui_widgets.cpp - Tables
imgui_tables.cpp
Drawing
- Draw Lists
imgui_draw.cpp - Font Atlas
imgui_draw.cpp
Integrations
- Platform Backends
backends - Renderer Backends
backends
Extensions
- Demo Tools
imgui_demo.cpp - STL Input Wrappers
misc/cpp/imgui_stdlib.cpp - FreeType Loader
misc/freetype/imgui_freetype.cpp
Other components
- Application
- Platform Events
- Graphics API
Connections 15
- Platform Events → Platform Backends: sends events
- Platform Backends → UI Context: feeds input
- Application → ImGui API: calls widgets
- ImGui API → UI Context: updates frame
- UI Context → Widgets & Layout: dispatches UI
- Widgets & Layout → Tables: builds tables
- UI Context → Draw Lists: builds commands
- Font Atlas → Draw Lists: supplies glyphs
- Application → Renderer Backends: submits frame
- Draw Lists → Renderer Backends: provides draw data
- Renderer Backends → Graphics API: renders triangles
- Application → Demo Tools: shows demo
- Application → STL Input Wrappers: uses strings
- STL Input Wrappers → ImGui API: wraps input
- FreeType Loader → Font Atlas: builds fonts