What is Dear ImGui?
Dear ImGui, or ImGui for short, is a graphical user interface library for C++, using the pipelines of modern 3D APIs to render texts and elements in framebuffers. In addition, ImGui is self-contained, which means we do not need additional dependencies besides GLFW, OpenGL, and Vulkan. It is also platform-independent, so the application code still runs on both Windows and Linux.
To get a first impression, here is a screenshot of some of the elements of ImGui:
Figure 5.1: Some widgets of the Dear ImGui demo code
The ImGui code consists of three parts:
- The widget rendering
- The input backend
- The output backend
ImGui aims to create an identical look and feel across all supported operating systems, helper libraries, and rendering backends. To draw the widgets independently of the underlying system, the widget rendering functions are separated from the backends.
The function calls we use are only at the widget...