repositorypackage
0.0.0-20230304044533-0d4c88787b02
Repository: https://github.com/kitsunekodes/renderer.git
Documentation: pkg.go.dev
# README
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), windows(x64), Arch Linux/KDE and Fedora Workstation 36, idealy other linux GUI 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
Install GNU make
Update imgui
- Drop source code of imgui to
cimgui/imgui
. - Run
cd cimgui/generator; ./generator.sh
. - Run
make cimgui
.
Update implot
- Drop source code of implot to
cimplot/implot
. - Run
cd cimplot/generator; ./generator.sh
. - Run
make cimplot
.