GitHub - AllenDang/cimgui-go: Auto generated Go wrapper for Dear ImGui via cimgu...
source link: https://github.com/AllenDang/cimgui-go
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
cimgui-go
This project aims to generate go wrapper for Dear ImGui.
It comes with a default backend with GLFW 3.3 and OpenGL 3.2.
It works on macOS(arm64/x86) and windows(x64) now, idealy linux should works but I don't have a linux machine to test it. Check out examples
, cd in and go run .
.
Current solution is:
- Use cimgui's lua generator to generate function and struct definition as json.
- Generate proper go code from the definition (via manual crafted go program
/cmd/codegen
). - Use the backend implementation from imgui (currently glfw and opengl3).
- Use github workflow to compile cimgui and glfw to static lib and place them in /lib folder for further link.
Naming convention
For functions, 'Im/ImGui/ig' is trimmed. 'GetCursorPos' is renamed to 'GetDrawCursor', same with "SetCursor...".
Function coverage
Currently most of the functions are generated, except memory related stuff (eg. memory allocator, storage management, etc...). If you find any function is missing, report an issue.
Generate binding
- Drop source code of imgui to
cimgui/imgui
. - Run cimgui's generator script at
cimgui/generator/generator.sh
. - Run
make gencode
.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK