{"id":18831008,"url":"https://github.com/allendang/cimgui-go","last_synced_at":"2026-05-14T12:02:16.015Z","repository":{"id":55054149,"uuid":"522798019","full_name":"AllenDang/cimgui-go","owner":"AllenDang","description":"Auto generated Go wrapper for Dear ImGui via cimgui","archived":false,"fork":false,"pushed_at":"2025-05-05T01:53:26.000Z","size":135594,"stargazers_count":407,"open_issues_count":14,"forks_count":54,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-15T13:08:59.149Z","etag":null,"topics":["cimgui","golang","imgui"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AllenDang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-08-09T04:12:12.000Z","updated_at":"2025-05-15T07:15:12.000Z","dependencies_parsed_at":"2023-02-16T04:01:34.726Z","dependency_job_id":"ff9a5f0e-347a-4b08-a01c-d341eff3689a","html_url":"https://github.com/AllenDang/cimgui-go","commit_stats":{"total_commits":1282,"total_committers":18,"mean_commits":71.22222222222223,"dds":"0.21762870514820598","last_synced_commit":"3244b092a9e256e538ccc87dd45f9e7c20479768"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenDang%2Fcimgui-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenDang%2Fcimgui-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenDang%2Fcimgui-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenDang%2Fcimgui-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AllenDang","download_url":"https://codeload.github.com/AllenDang/cimgui-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346623,"owners_count":22055808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cimgui","golang","imgui"],"created_at":"2024-11-08T01:51:33.033Z","updated_at":"2026-05-14T12:02:15.936Z","avatar_url":"https://github.com/AllenDang.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/AllenDang/cimgui-go)](https://goreportcard.com/report/github.com/AllenDang/cimgui-go)\n![Build Status](https://github.com/AllenDang/cimgui-go/actions/workflows/test.yaml/badge.svg)\n![Linter Status](https://github.com/AllenDang/cimgui-go/actions/workflows/golangci-lint.yaml/badge.svg)\n[![GoDoc](https://pkg.go.dev/badge/github.com/AllenDang/cimgui-go?utm_source=godoc)](https://pkg.go.dev/mod/github.com/AllenDang/cimgui-go)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go#gui)\n\n# cimgui-go \n\nThis project aims to generate go wrapper for Dear ImGui.\n\nIt comes with [several default backends](supported-backends) implemented.\n\nIt 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 .`.\n\n## Setup\n\nThere are several dependencies you might need to install on your linux machine.\nTake a look [here](https://github.com/allendang/giu#install)\n\n## Current solution is:\n1. Use [cimgui](https://github.com/cimgui/cimgui)'s lua generator to generate function and struct definition as json.\n2. Generate proper go code from the definition ([via manual crafted go program](./cmd/codegen)).\n3. Use [the backend implementation](#supported-backends) from imgui.\n4. Use github workflow to compile cimgui, glfw and other C dependencies to static lib and place them in ./lib folder for further link. \n\n## Supported Backends\n\nIn order to make it easy in use, cimgui-go implemented a few imgui backends. All of them are placed in `backend/` sub-packages.\nTo see more details about usage of a specific backend, take a look at the [examples](./examples).\n\nWe support the following backends:\n- [GLFW](./examples/glfw). (GLFW 3.3 + OpenGL)\n- [SDL2](./examples/sdl). (SDL 2 + OpenGL)\n- [Ebitengine](./examples/ebiten) (`import \"github.com/AllenDang/cimgui-go/backend/ebitenbackend\"`).\n\n**Important**: Remember that various solution use different C libraries that can conflict with each other.\nIt is recommended to not enable e.g. GLFW and SDL backends at the same time as it may result in linker crash.\n\n## Naming convention\n\n- For functions, 'Im/ImGui/ig' is trimmed.\n- `Get` prefix is also removed.\n- If function comes from `imgui_internal.h`, `Internal` prefix is added.\n\n## Pointers and Slices\n\nUnfortunately, in C there is no way to ditinguish between a pointer and a slice.\nWe had to bring this unpleasantness to Go as well.\nOur code defaults to pointers, but you can easily convert your slice to a pointer by simply `\u0026(slice[0])`.\nYou can also use `imgui.SliceToPtr`.\n\n## Callbacks\n\nPlease note that at the moment (November 2024) go (1.23) does not support passing annonymous functions to C via CGO.\nWe have it workarounded by pre-generating large amount of global functions and a pool.\nFor details see https://github.com/AllenDang/cimgui-go/issues/224 .\nJust be aware of the limitation that you may run out of pre-generated pool and experience a crash.\n\n## Function coverage\nCurrently most of the functions are generated, except memory related stuff (eg. memory allocator, storage management, etc...).\nIf you find any function is missing, report an issue.\n\n# Generate binding\nInstall [GNU make](https://www.gnu.org/software/make/manual/make.html) and run `make` to re-generate bunding.\n\n# Update\n\nTo update to the latest version of dependencies, run `make update`.\nAfter doing this, commit changes and navigate to GitHub.\nIn Actions tab, manually trigger `Compile cimgui` workflows.\n\n# How does it work?\n\n- `cwrappers/` directory holds C binding for C++ Dear ImGui libraries\n- 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\n- `libs/` contains pre-built shared libraries. `cflags.go` includes and uses to decrease building time.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallendang%2Fcimgui-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallendang%2Fcimgui-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallendang%2Fcimgui-go/lists"}