From 07563a1411449b7d5dcc5dbec01ac4270ac1433d Mon Sep 17 00:00:00 2001 From: gucio321 Date: Sat, 19 Oct 2024 14:32:40 +0200 Subject: [PATCH] update everything else in readme --- README.md | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index e582a257..9e8ca97a 100644 --- a/README.md +++ b/README.md @@ -7,25 +7,30 @@ 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 comes with [several default backends](supported-backends) implemented. -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 .`. +It works on macOS(arm64/x86), windows(x64), Arch Linux (Gnome/KDE) and Fedora Workstation 36+, idealy other linux GUI should works as well. Check out [`examples`](./examples): cd in and `go run .`. + +## Setup + +There are several dependencies you might need to install on your linux machine. +Take a look [here](https://github.com/allendang/giu#install) ## Current solution is: -1. Use cimgui's lua generator to generate function and struct definition as json. -2. Generate proper go code from the definition (via manual crafted go program `/cmd/codegen`). -3. Use the backend implementation from imgui. -4. Use github workflow to compile cimgui and glfw to static lib and place them in /lib folder for further link. +1. Use [cimgui](https://github.com/cimgui/cimgui)'s lua generator to generate function and struct definition as json. +2. Generate proper go code from the definition ([via manual crafted go program](./cmd/codegen)). +3. Use [the backend implementation](#supported-backends) from imgui. +4. Use github workflow to compile cimgui, glfw and other C dependencies to static lib and place them in ./lib folder for further link. ## Supported Backends -In order to make it easy in use, cimgui-go implemented a few imgui backends. -To see more details about using a specific backend, take a look at the [examples](./examples). +In order to make it easy in use, cimgui-go implemented a few imgui backends. All of them are placed in `backend/` sub-packages. +To see more details about usage of a specific backend, take a look at the [examples](./examples). We support the following backends: -- [GLFW](./examples/glfw). **Note:**: It is disabled by default, use `enable_cimgui_glfw` go build tag to enable it. -- [SDL2](./examples/sdl). **Note:**: It is disabled by default, use `enable_cimgui_sdl2` go build tag to enable it. -- [Ebitengine](./examples/ebiten) (`import "github.com/AllenDang/cimgui-go/ebitenbackend"`). +- [GLFW](./examples/glfw). (GLFW 3.3 + OpenGL) +- [SDL2](./examples/sdl). (SDL 2 + OpenGL) +- [Ebitengine](./examples/ebiten) (`import "github.com/AllenDang/cimgui-go/backend/ebitenbackend"`). **Important**: Remember that various solution use different C libraries that can conflict with each other. It is recommended to not enable e.g. GLFW and SDL backends at the same time as it may result in linker crash. @@ -33,8 +38,8 @@ It is recommended to not enable e.g. GLFW and SDL backends at the same time as i ## Naming convention - For functions, 'Im/ImGui/ig' is trimmed. +- `Get` prefix is also removed. - If function comes from `imgui_internal.h`, `Internal` prefix is added. -- Struct fields (if any exported) are prefixed with word `Field` ## Function coverage Currently most of the functions are generated, except memory related stuff (eg. memory allocator, storage management, etc...).