# Dear ImGui

Dear ImGui is a bloat-free graphical user interface library for C++. It outputs optimized vertex buffers that you can render anytime in your 3D-pipeline enabled application. It is fast, portable, renderer agnostic and self-contained (no external dependencies). - github / demo / 2

caption

Give someone state and they’ll have a bug one day, but teach them how to represent state in two separate locations that have to be kept in sync and they’ll have bugs for a lifetime. - ryg

Features

About the IMGUI paradigm

Dear ImGui is one possible implementation of an idea generally described as the IMGUI (Immediate Mode GUI) paradigm. The Immediate Mode GUI paradigm may at first appear unusual to some users. This is mainly because Retained Mode GUIs have been so widespread and predominant. The following links can give you a better understanding about how Immediate Mode GUIs works.

Immediate Mode

  • the client calls directly cause rendering of graphics objects to the display, or in which
  • the data to describe rendering primitives is inserted frame by frame directly from the client into a command list (in the case of immediate mode primitive rendering),without the use of extensive indirection - thus immediate - to retained resources.

Retained Mode

  • the graphics library, instead of the client, retains the scene (complete object model of the rendering primitives) to be rendered and
  • the client calls into the graphics library do not directly cause actual rendering, but make use of extensive indirection to resources, managed – thus retained – by the graphics library.

What are the performance implications of using an immediate-mode GUI compared to a retained-mode GUI?

C++ Starter

With Meson use the Wrap to simplify your life (and generaly is prefered to the system packaging).

$ meson wrap install imgui
$ meson build .

see How to force subproject vs system in Meson.

And the following main.cpp SDL2 (Win32, Mac, Linux, etc.) + SDL_Renderer for SDL2

see also

Bindings

Crystal

Installation

Trying the example

cd lib/imgui-sfml/
crystal build examples/simple.cr

export LD_LIBRARY_PATH="$(pwd)"
./simple

Ruby

  • tested only on windows

Alternative

Written on November 4, 2020, Last update on October 12, 2024
gui lib-c++ image-lib quote