- ImGuin examples project
- Usage: Sample program and run
- Prerequisites
- Build examples
- Available libraries
- Screenshot (examples)
- glfw_opengl3
- glfw_opengl3_imknobs
- glfw_opengl3_filedialog
- glfw_opengl3_imgui_toggle
- glfw_opengl3_imguiTextSelect
- glfw_opengl3_imspinner
- rlimgui_basic (Naylib / Raylib / rlImgui)
- glfw_opengl3_iconfont_viewer
- glfw_opengl3_image_load / sdl2_opengl3
- sdl2_renderer / sdl3_renderer / sdl3_opengl3 / sdl3_sdlgpu3
- glfw_opengl3_image_save
- glfw_opengl3_jp
- glfw_opengl3_implot
- glfw_opengl3_implot3d
- glfw_opengl3_imnodes
- glfw_opengl3_imguizmo
- glfw_opengl3_imColorTextEdit
- glfw_opengl3_imgui_markdown
- My test app movie using imguin
- Cross compilation: Generating Windows application binary(*.exe) on Linux OS
- Selection backend compiler
- TODO
- Compressing binary file
- My tools version
- Other link
- Usage: Sample program and run
Confirmed ImGuin verion: v1.92.4.0 (Dear ImGui/CImGui version: 1.92.4) (2025/11)
This is example project to use Dear ImGui, ImPlot and so on in Nim language.
Wrapper libraies used are here ImGuin 1
-
Nim-2.2.6 or later
-
Windows11 MSys2/MinGW installed: Command line tools: make, cp, rm, git, ...etc
pacman -S mingw-w64-x86_64-{gcc,glfw,SDL2,sdl3} make -
Linux: Debian13 / Ubuntu families
$ sudo apt install gcc g++ make $ sudo apt install lib{opengl-dev,gl1-mesa-dev,glfw3,glfw3-dev,xcursor-dev,xinerama-dev,xi-dev,sdl2-dev} git-
If you have Debian13 Trixie
$ sudo apt install libsdl3-dev
-
-
First clone this project,
git clone https://github.com/dinau/imguin_examples
-
Install dependencies libraries,
cd imguin_examples nimble refresh nimble dep -
For instance glfw_opengl3_base.nim,
pwd imguin_examples/glfw_opengl3_base make # or make run
After build, run
./glfw_opengl3_base(.exe)
Compilation options depend on./config.nimsand./Makefile. -
Selecting static link or dynamic link.
If you'd like to build executables with static link (not using*.dll),
edit./linkControl.nimin respective example folder.
To not depend on any other*.dllfiles,
change to 2const STATIC_LINK_GLFW = true # if true, it doesn't need glfw3.dll const STATIC_LINK_CC = true # if true, it doesn't need libstd++-6.dll
Library name / C lang wrapper
- ImGui / CImGui
- ImPlot / CImPlot
- ImNodes / CImNodes
- ImGuizmo / CImGuizmo
- ImGui-Knobs / CImGui-Knobs
- ImGuiFileDialog / CImGuiFileDialog
- ImGui_Toggle / CimGui_Toggle
- ImPlot3d / CImPlot3d
- ImSpinner / CImSpinner
- ImGuiColorTextEdit / cimCTE (2025/03)
- ImGuiTextSelect / CImGuiTextSelect (2025/09)
- ImGui_Markdown / CImGui_Markdown WIP
Additional examples
These screenshots are on Windows10.
Basic example with icon fonts
-
Build
pwd glfw_opengl3 make # or nim c glfw_opengl3.nim
https://github.com/altschuler/imgui-knobs
cimgui-knobs sources have been contributed from system64MC / PR (2024/12). Thank you.
pwd
glfw_opengl3_imknobs
make # or nim c -d:ImKnobs glfw_opengl3_imknobs.nim ImGuiFileDialog / CImGuiFileDialog
pwd
glfw_opengl3_filedialog
make # or nim c -d:ImGuiFileDialog glfw_opengl3_filedialog.nim pwd
glfw_opengl3_imgui_toggle
make # or nim c -d:ImGuiToggle glfw_opengl3_imgui_toggle.nim pwd
glfw_opengl3_imguiTextSelect
make # or nim c -d:ImGuiTextSelect glfw_opengl3_imguiTextSelect.nim pwd
glfw_opengl3_imspinner
make # or nim c -d:ImSpinner glfw_opengl3_imspinner.nim pwd
rlimgui_basic
make # or nim c rlimgui_basic.nim Icon font viewer.
- Magnifying glass
- Incremantal search
pwd
iconFontViewer
make # or nim c iconFontViewer.nim - Image loading
- Magnifying glass
pwd
glfw_opengl3_image_load
make # or nim c glfw_opengl3_image_load.nim -
sdl2 version
pwd sdl2_opengl3 make # or nim c -d:SDL sdl2_opengl3.nim
SDL renderer backend.
-
Build sdl2 renderer backend
pwd sdl2_renderer make # or nim c -d:SDL sdl2_renderer.nim
-
Build sdl3 backend
See SDL3 installation on Linux OSpwd sdl3_opengl3 make # or nim c -d:SDL sdl3_opengl3.nim
-
Build sdl3 renderer backend
pwd sdl3_renderer make # or nim c -d:SDL sdl3_renderer.nim
-
Build sdl3 GPU backend
pwd sdl3_sdlgpu3 make # or nim c -d:SDL sdl3_sdlgpu3.nim
- Image loading / saving
It can save a screenshot as [ jpg, bmp, png or tga ] file. - Magnifying glass
pwd
glfw_opengl3_image_save
make # or nim c glfw_opengl3_image_save.nimShowing UTF-8 text and input text with a local country language.

pwd
glfw_opengl3_jp
make # or nim c glfw_opengl3_jp.nimIf you are on Debian13 in WSL2 on Windows OS,
sudo apt install fonts-ipafontShowing ImGui demo with ImPlot demo.

pwd
glfw_opengl3_implot
make # or nim c -d:ImPlot glfw_opengl3_implot.nimShowing ImPlot3D demo. WIP
pwd
glfw_opengl3_implot3d
make # or nim c -d:ImPlot3D glfw_opengl3_implot3d.nimpwd
glfw_opengl3_imnodes
make # or nim c -d:ImNodes glfw_opengl3_imnodes.nimpwd
glfw_opengl3_imguizmo
make # or nim c -d:ImGuizmo glfw_opengl3_imguizmo.nimpwd
glfw_opengl3_imColorTextEdit
make # or nim c -d:ImColorTextEdit glfw_opengl3_imColorTextEdit.nimWIP at this moment.
pwd
glfw_opengl3_imgui_markdown
make # or nim c -d:ImGuiMarkdown glfw_opengl3_imgui_markdown.nim-
See:
Cross compilation to Windows, linker error (unrecognized option '-z'
https://nim-lang.org/docs/nimc.html#crossminuscompilation-for-windows -
Download GLFW3 Windows pre-compiled binaries form here.
-
Extracts
glfw-3.4.bin.WIN64.zip -
cp glfw-3.4.bin.WIN64/lib-mingw-w64/{glfw3.dll,libglfw3dll.a} imguin_examples/glfw_opengl3/ -
Rename lib name
pwd imguin_examples/glfw_opengl3 mv libglfw3dll.a libglfw3.dll.a -
Edit
Makefile
Add the following line toimguin_examples/glfw_opengl3/MakefileOPT += -d:release OPT += --passL:"-L ." # <----- added line include ../makefile.common.mk -
Run make to build example
make win
or
nim c -d:mingw glfw_opengl3 or nim c --os:windows glfw_opengl3
glfw_opengl3.exewill be generated in the current folder.
- Can it compile with
zig cc? Done. But Zig lang. is very unstable at this time. - Whether can it use
cimgui.dll? (Now it can only be static link) Closed. Only be static link. - Easier compilation for SDL2 app. (2024/09) Done.
- Added: ImNodes/CImNodes (2023/10) Done
- Unfortunately Dear ImGui - 1.89.7 dosn't work well at this moment.(2023/07) Done. (2023/08)
- Whether can it do
nimble install imguin? Done (2023/09) (#Issue 13) - Add Font Awesome (Icon Font) demo. Done (2023/04).
- Can it compile with MSVC (--cc:vcc) ? Done. Except SDL2 demo. (2023/03), TODO (2024/09)
- Can it compile with Clang (--cc:clang) ? Done. (2023/03)
- Add SDL2 example. Done. sdl2_opengl3 (2023/03)
- First step has been done. (2023/03)
Install UPX with MSys console on WindowsOS,
pacman -S mingw-w64-x86_64-upxFor compression exe file,
pwd
examples
cd glfw_opengl3_implot
make upx Ultimate Packer for eXecutables
Copyright (C) 1996 - 2024
UPX 4.2.4 Markus Oberhumer, Laszlo Molnar & John Reiser May 9th 2024
File size Ratio Format Name
-------------------- ------ ----------- -----------
7117824 -> 1217024 17.10% win64/pe glfw_opengl3_implot.exe Decompressing,
make dupxResult in,
| GCC + UPX : GCC | Clang + UPX : Clang | MSVC(vcc) + UPX : MSVC | |
|---|---|---|---|
| glfw_opengl3.exe | 804 KB : 2360 KB | 720 KB : 2200 KB | 742 KB : 2070 KB |
| glfw_opengl3_implot.exe | 1220 KB : 7120 KB | 940KB : 4200 KB | 945 KB : 3810 KB |
GCC: v14.2.0, Clang: v18.1.8, MSVC: 2022
Windows11 (main)
- Nim Compiler Version 2.2.4
- GCC (Rev1, Built by MSYS2 project) 15.2.0
- Clang version 21.1.4
- Visual Studio C++/C 2022
- git version 2.46.0.windows.1
- Make: GNU Make 4.4.1
- MSys2/MinGW tools
Linux OS: Debain 13
- Nim Compiler Version 2.2.4
- gcc 14.2.0
- make: GNU Make 4.4.1
- git version 2.47.3
-
File Dialog
-
Other
-
GUI
-
Graphical
| Language | Project | |
|---|---|---|
| Lua | Script | LuaJITImGui |
| NeLua | Compiler | NeLuaImGui / NeLuaImGui2 |
| Nim | Compiler | ImGuin, Nimgl_test, Nim_implot |
| Python | Script | DearPyGui for 32bit WindowsOS Binary |
| Ruby | Script | igRuby_Examples |
| Zig, C lang. | Compiler | Dear_Bindings_Build |
| Zig | Compiler | ImGuinZ |
| Language | SDL | Project | |
|---|---|---|---|
| LuaJIT | Script | SDL2 | LuaJIT-Platformer |
| Nelua | Compiler | SDL2 | NeLua-Platformer |
| Nim | Compiler | SDL3 / SDL2 | Nim-Platformer-sdl2/ Nim-Platformer-sdl3 |
| Ruby | Script | SDL3 | Ruby-Platformer |
| Zig | Compiler | SDL3 / SDL2 | Zig-Platformer |
- https://github.com/SpartanJ/SOIL2
SOIL2 is a tiny C library used primarily for uploading textures into OpenGL.
error: assignment to 'char **' from incompatible pointer type 'const char * const*' [-Wincompatible-pointer-types]type ConstCstring {.importc: const char *.} = cstringNotes:
- Using ImPlot3D / ImPlot with Nim
- Nim + ImGui + ImPlot3D / ImPlot demo
- Build with ImPlot3D / ImPlot
- ImPlot3D integration example
- This project builds and runs Dear ImGui + ImPlot3D / ImPlotusing Nim.
- ImPlot3D is compiled from source (implot3d.h / implot3d.cpp)
- ImPlot is compiled from source (implot.h / implot.cpp)
Footnotes
-
It may be better to use the mainstream project nimgl/imgui (ImGui v1.85)
,updated project nimgl-imgui (ImGui v1.89.9) ,sub project nim_implot and test project nimgl_test,
or https://github.com/daniel-j/nimgl-imgui(ImGui v1.91.1) ↩ -
STATIC_LINK_GLFW = falsecan only be set at Dear ImGui 1.92.0 or later ↩




















