Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ocornut/imgui/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This guide will help you create your first Dear ImGui application. We’ll build a simple “Hello World” program that displays a window with some basic widgets.This quickstart uses GLFW for windowing and OpenGL 3 for rendering, which work on Windows, macOS, and Linux. For other platforms or graphics APIs, see the Integration Guide.
Prerequisites
Before you begin, ensure you have:- A C++ compiler (C++11 or later)
- GLFW library
- OpenGL 3.0+ support
Installation
Download Dear ImGui
Clone or download Dear ImGui from GitHub:The core library files are:
imgui.cpp,imgui.himgui_demo.cppimgui_draw.cppimgui_tables.cppimgui_widgets.cppimconfig.h(configuration)
Get the backends
For this quickstart, you’ll need:
backends/imgui_impl_glfw.cpp+imgui_impl_glfw.h(platform backend)backends/imgui_impl_opengl3.cpp+imgui_impl_opengl3.h(renderer backend)
Your First Dear ImGui Program
Create a file calledmain.cpp with the following code:
main.cpp
Building Your Application
- g++ / Clang
- CMake
- Visual Studio
Run Your Application
Execute your compiled program:- A demo window showcasing Dear ImGui features
- A “Hello, World!” window with a slider, color picker, and button
- Smooth 60 FPS rendering
Understanding the Code
Let’s break down the key parts:Initialization
IMGUI_CHECKVERSION()ensures your headers match the compiled libraryCreateContext()initializes Dear ImGui’s internal stateGetIO()provides access to input/output configuration
Frame Loop
- Start a new Dear ImGui frame
- Create your UI with ImGui calls
- Render the draw data
Creating UI
Button()returnstruewhen clickedCheckbox()modifies the bool and returnstruewhen changedBegin()/End()define a window scope
Next Steps
Integration Guide
Learn how to integrate Dear ImGui into your existing project
Core Concepts
Understand the immediate mode paradigm
Widgets Overview
Explore all available widgets
Examples
Browse 30+ complete example applications
Common Issues
Blank window / Nothing renders
Blank window / Nothing renders
Make sure you’re calling:
ImGui::NewFrame()at the start of each frameImGui::Render()after your UI codeImGui_ImplXXX_RenderDrawData(ImGui::GetDrawData())to draw
Assertion failed: IMGUI_CHECKVERSION()
Assertion failed: IMGUI_CHECKVERSION()
Your headers don’t match the compiled version. Make sure all Dear ImGui files are from the same version.
Missing fonts / Square boxes instead of text
Missing fonts / Square boxes instead of text
The font texture wasn’t uploaded. Most backends handle this automatically, but you may need to call
ImGui_ImplXXX_CreateFontsTexture().ImGui::Begin() not returning false when collapsed
ImGui::Begin() not returning false when collapsed
Always call
ImGui::End() regardless of the return value from Begin(). This is a common beginner mistake.Explore the full Demo Window (
ImGui::ShowDemoWindow()) to see all features in action with interactive examples and code snippets!