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).
This sample uses Dear ImGui with GLFW + OpenGL3
GLFW (Graphics Library Framework) is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan development on the desktop. It provides a simple API for creating windows, contexts and surfaces, receiving input and events.
OpenGL (Open Graphics Library) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardware-accelerated rendering.
Install dependencies using vcpkg - (VC++ Package Manager)
# Clone this repository with recursive option
> git clone --recursive https://github.com/sukesh-ak/ImGui-GLFW-OpenGL3
> cd ImGui-GLFW-OpenGL3
# Run the bootstrap script for vcpkg
> .\vcpkg\bootstrap-vcpkg.bat
# Install imgui dependencies using vcpkg manifest (vcpkg.json)
> .\vcpkg\vcpkg install
# Compile and Run (or run .\win-build.bat)
> cmake . -B build/
> cmake --build build
> build\Debug\ImGui-GLFW-OpenGL3.exe
We are ready to open the project in Visual Studio and Run too!
Use Open Folder
option in Visual Studio to use CMake
support.
Install dependencies using vcpkg - (VC++ Package Manager)
# Clone this repository with recursive option
$ git clone --recursive https://github.com/sukesh-ak/ImGui-GLFW-OpenGL3
$ cd ImGui-GLFW-OpenGL3
# ******** On Jetson Jetpack 5.x+ (Tested on Jetson Orin NX) ***
$ sudo apt install ninja-build
$ export VCPKG_FORCE_SYSTEM_BINARIES=1
# *************************************************
# Run the bootstrap script for vcpkg
$ ./vcpkg/bootstrap-vcpkg.sh
# Install dependencies required (will add to manifest later)
$ sudo apt install libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev pkg-config
# Install OpenGL for WSL (if it complains during compilation)
$ sudo apt install mesa-utils libglu1-mesa-dev freeglut3-dev mesa-common-dev
# Install imgui dependencies using vcpkg manifest (vcpkg.json)
$ ./vcpkg/vcpkg install
# Compile and Run (or run ./linux-build.sh)
$ cmake . -B build/
$ cmake --build build
$ ./build/ImGui-GLFW-OpenGL3
That's it!
- Live Documentation here
- Docs on Examples here
- Wiki with examples and usage here
- Useful Extensions here
- Dear ImGui - https://github.com/ocornut/imgui
- GLFW - https://www.glfw.org/
- OpenGL - https://www.opengl.org/
- ImPlot - https://github.com/epezent/implot
- ImGui Knobs - https://github.com/altschuler/imgui-knobs
- ImSpinner - https://github.com/dalerank/imspinner