更新到最新的IMGUI/CIMGUI版本:: V1.91.6dock (2024/12)
这个项目是我使用NIM语言,IMGUI,Inflot,Futhark和Etk的实验项目。
NIM-2.0.14或更高版本
Windows10或更高版本
MSYS2/MINGW命令行工具(UNIX工具),Make,CP,RM,Git,...等
Linux Mint 22(或Ubuntu / Debian家庭)
$ sudo apt install gcc g++ make git $ sudo apt install xorg-dev libopengl-dev libgl1-mesa-dev
$ sudo apt install libglfw3 libglfw3-dev libsdl2-devnimble uninstall imguin # Remove old versions if exists.
nimble install https://github.com/dinau/imguin第一个克隆这个项目,
git clone https://github.com/dinau/imguin示例程序在这里,示例。例如glfw_opengl3_base.nim,
cd imguin/examples/glfw_opengl3_base
make # or make run构建后,运行./glfw_opengl3_base(.exe)
编译选项取决于./config.nims和./Makefile 。
要选择静态链接或动态链接,请阅读此示例/readme.md。
| 库名称 | ||
|---|---|---|
| v | imgui / cimgui | 基础库 |
| v | 内置 / CIMPLOT | |
| v | imnodes / cimnodes | |
| v | imguizmo / cimguizmo | |
| v | imgui-knobs/ cimgui-knobs | |
| v | Imguifiledialog / cimguifiledialog | |
| ... | ... | ... |
| x | imguicolortextedit / cimcte | 2025? |
| Glfw | SDL2 | SDL3 | ||
|---|---|---|---|---|
| OpenGL3 后端 | v | v | v | |
| SDL2 后端 | - | ? | - | 2025? |
| SDL3 后端 | - | - | ? | 2025? |
这些屏幕截图在Windows10上。
图标字体的基本示例

建造
pwd
examples/glfw_opengl3
make # or make run或者
nim c glfw_opengl3.nim # or nim c -r glfw_opengl3.nim or nim r glfw_opengl3.nim https://github.com/altschuler/imgui-knobs
CIMGUI-KNOBS来源已由System64MC / PR(2024/12)造成了贡献。谢谢。

建造
pwd
examples/glfw_opengl3_imknobs
make 或者
nim c -d:ImKnobsEnable --warning:HoleEnumConv:off glfw_opengl3_imknobs.nim Imguifiledialog / cimguifiledialog

建造
pwd
examples/glfw_opengl3_filedialog
make 或者
nim c -d:ImGuiFileDialogEnable glfw_opengl3_filedialog.nim 图标字体查看器和放大镜

建造
pwd
examples/iconFontViewer
make 或者
nim c iconFontViewer.nim 图像负载和放大镜

建造
pwd
examples/glfw_opengl3_image_load
make 或者
nim c glfw_opengl3_image_load.nim 构建SDL2版本
pwd
examples/sdl2_opengl3
make 或者
nim c -d:SDL sdl2_opengl3.nim 构建SDL3版本
此刻只有Windows操作系统。
pwd
examples/sdl3_opengl3
make 或者
nim c -d:SDL sdl3_opengl3.nim 图像负载 /保存和放大镜
它可以将屏幕截图保存为[JPG,BMP,PNG或TGA]文件。

建造
pwd
examples/glfw_opengl3_image_save
make # or make run或者
nim c glfw_opengl3_image_save.nim用本地语言显示UTF-8文本和输入文本。 
建造
pwd
examples/glfw_opengl3_jp
make # or make run或者
nim c glfw_opengl3_jp.nim通过插件展示IMGUI演示。 
建造
pwd
examples/glfw_opengl3_implot
make # or make run或者
nim c -d:ImPlotEnable glfw_opengl3_implot.nim
建造
pwd
examples/glfw_opengl3_imnodes
make # or make run或者
nim c -d:ImNodesEnable glfw_opengl3_imnodes.nim
建造
pwd
examples/glfw_opengl3_imguizmo
make # or make run或者
nim c -d:ImGuizmoEnable glfw_opengl3_imguizmo.nim
看:
交叉编译到Windows,链接器错误(未识别的选项'-z'
https://nim-lang.org/docs/nimc.html#crossminuscompilation-for-windows
例如,在Linux Mint 22上,依此类推,
pwd
examples
cd glfw_opengl3make win 或者
nim c -d:mingw glfw_opengl3或者
nim c --os:windows glfw_opengl3 glfw_opengl3.exe将在当前文件夹中生成。
安装了git。
已安装MSYS2/MINGW命令行工具(UNIX工具),Make,CP,RM,...等
Windows10或更高版本的Clang/LLVM参考Futhark安装。
nimble install futhark它必须存在库路径中的libclang.a文件(例如c:llvmlib )。
Linux Debian 12 Bookworm
sudo apt install clang-16
nimble install --passL: " -L/usr/lib/llvm-16/lib " futhark重要通知:确认Futhark版本为V0.13.6 。 (2024/09)
nimble dump futhark
name: " futhark "
version: " 0.13.6 "
author: " PMunch "
desc: " A package which uses libclang to parse C headers into Nim files for easy interop "
license: " MIT "
...组成开发文件夹
首先搬到您喜欢的工作文件夹,然后
mkdir imguin_dev
cd imguin_dev
git clone https://github.com/dinau/imguin
cd imguin克隆imgui/cimgui等立即来源
pwd
imguin
make clonelibs克隆的库在下面../libs/文件夹
递归地使用每个库文件夹中的git Pull或fetch命令更新源,
../libs/cimgui
../libs/cimguizmo
../libs/cimnodes
../libs/cimplot
在相应文件夹中使用git命令结帐任意版本
指定您的Clang包括在imguin/src/imguin/cimgui.nim中通往ClangIncludePath的路径。
生成定义文件uisng futhark,
pwd
imguin
make gen安装更新的文件
在imguin.nimble文件中正确编辑版本信息等,然后
pwd
imguin
nimble uninstall imguin # Remove old versions if it exists.
nimble install 就这样。
重复3.如果您想更新或降级到其他版本。
确认版本
| imgui/cimgui ver。 | imguin ver。 | 日期 | Windowsos | Linux Mint 22 | Debian 书虫(1) |
|---|---|---|---|---|---|
| 1.91.6dock | 1.91.6.6 | 2024/12 | 好的 | 好的 | - |
| 1.91.5托克 | - | - | - | - | - |
| 1.91.4dock | 1.91.4.2 | 2024/12 | 好的 | 好的 | - |
| 1.91.3dock | 1.91.3.1 | 2024/10 | 好的 | (7) | - |
| 1.91.2DOCK | 1.91.2.0 | 2024/10 | 好的 | (7) | - |
| 1.91.1dock | 1.91.1.2 | 2024/09 | 好的 | (6) | - |
| 1.91.0dock | 1.91.0.0 | 2024/08 | 好的 | - | (7) |
| 1.90.4dock | 1.90.4.2 | 2024/02 | 好的 | - | 好(4) |
| 1.90.1dock | 1.90.1.0 | 2024/01 | 好的 | - | ng/ok(1)(3)(4) |
| 1.89.9DOCK | 1.89.9.8 | 2023/12 | 好的 | - | ng/ok(1)(3)(4) |
(1):除了imnodes和SDL2示例。
(2):工作不好。
(3):只有在编译调试模式时,效果很好。
(4):使用NIM-2.0.2
(5):我不知道为什么不能在Linux上编译。
(6):确定:除了imnodes示例除外
(7):此刻未检查。
您可能可以使用另一个C/C ++编译器,
Clang, vcc(Visual Studio C/C++) , zig cc
通过更改示例中的变量TC /config.nims.common。
cimgui.dll ? (现在只能是静态链接)nimble install imguin ?在Windows上使用MSYS控制台安装UPX ,
pacman -S mingw-w64-x86_64-upx对于压缩EXE文件,
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 解压缩,
make dupx结果,
| 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(主要)
NIM编译器版本2.2.0
GCC(Rev1,由MSYS2项目构建)14.2.0
pacman -S mingw-w64-ucrt-x86_64-gcc叮当版19.1.6
pacman -S mingw-w64-ucrt-x86_64-clangVisual Studio C ++/C 2022
GIT版本2.46.0.Windows.1
SDL2.DLL:2.30.7
制作:GNU制造4.4.1
msys2/mingw工具
Linux Mint 22
文件对话框
其他
GUI
图形
| 语言 | 项目 | |
|---|---|---|
| 尼姆 | 编译器 | imguin,nimgl_test,nim_implot |
| 卢阿 | 脚本 | Luajitimgui |
| Zig ,c lang。 | 编译器 | dar_bindings_build |
| ZIG | 编译器 | Imguinz |
| 内鲁亚 | 编译器 | Neluaimgui |
| Python | 脚本 | dearppygui用于32位Windowsos二进制 |

| 语言 | 项目 | |
|---|---|---|
| 尼姆 | 编译器 | NIM-PLATFORMER/ SDL3_NIM |
| 卢阿吉特 | 脚本 | luajit-platformer |
| 内鲁亚 | 编译器 | nelua-platformer |
| ZIG | 编译器 | ZIG-PLATFORMER |
error: assignment to ' char ** ' from incompatible pointer type ' const char * const* ' [-Wincompatible-pointer-types] type ConstCstring {. importc : const char *. } = cstring