dummy

package module
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2024 License: MIT Imports: 0 Imported by: 42

README

Go Report Card Build Status Linter Status GoDoc Mentioned in Awesome Go

cimgui-go

This project aims to generate go wrapper for Dear ImGui.

It comes with several default backends implemented.

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: cd in and go run ..

Setup

There are several dependencies you might need to install on your linux machine. Take a look here

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).
  3. Use the backend implementation 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. 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.

We support the following backends:

  • GLFW. (GLFW 3.3 + OpenGL)
  • SDL2. (SDL 2 + OpenGL)
  • Ebitengine (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.

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.

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 and run make to re-generate bunding.

Update

To update to the latest version of dependencies, run make update. After doing this, commit changes and navigate to GitHub. In Actions tab, manually trigger Compile cimgui workflows.

How does it work?

  • cwrappers/ directory holds C binding for C++ Dear ImGui libraries
  • generator bases on cwrappers/{package_name}_templates and generates all necessary GO/C code placing it in {pkgname}/ directories in the root of cimgui-go
  • libs/ contains pre-built shared libraries. cflags.go includes and uses to decrease building time.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
ebiten-backend
Package ebitenbackend contains a renderer of ImGui for Ebitengine along with cimgui.Backend implementation.
Package ebitenbackend contains a renderer of ImGui for Ebitengine along with cimgui.Backend implementation.
cmd
codegen Module
examples
common
Package common contains code commonly used in the examples section of cimgui-go.
Package common contains code commonly used in the examples section of cimgui-go.
sdl

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL