Use ImGui with import imgui;. This binding is generated with cimgui and regularly updated and tested with GitHub Actions.
This repository already contains the generated bindings for the latest ImGui version.
imgui.cppm: exports all symbols in imgui.h, can be used as import imgui;.imgui_internal.cppm: exports all symbols in imgui_internal.h, can be used as import imgui_internal;. It implicitly exports imgui module, therefore you don't have to import imgui separately.imgui_freetype.cppm: exports all symbols in imgui_freetype.h, can be used as import imgui_freetype;. It implicitly exports imgui module.And following backends are also available:
imgui_impl_glfw.cppm: can be used as import imgui_impl_glfw;.imgui_impl_opengl2.cppm: can be used as import imgui_impl_opengl2;.imgui_impl_opengl3.cppm: can be used as import imgui_impl_opengl3;.imgui_impl_sdl2.cppm: can be used as import imgui_impl_sdl2;.imgui_impl_sdl3.cppm: can be used as import imgui_impl_sdl3;.imgui_impl_vulkan.cppm: can be used as import imgui_impl_vulkan;.If you want to use ImGui with an older version, different feature configuration or a custom backend, you can generate the bindings yourself. The following steps will guide you through the process:
git clone --recurse-submodules https://github.com/stripe2933/imgui-module.git
cd imgui-module
cimgui/imgui submodule folder, checkout the desired version tag or commit.cimgui configuration, explained in cimgui - Using Generator. This will generate definitions.json, structs_and_enums.json and impl_definitions.json files in cimgui/generator/output folder.python3 generate.py
generated folder. You can use them as described in the previous section.main and docking BranchesStarting from ImGui 1.92.7, now the workflow provides modules that are capable of both main and docking branches. Symbols are guarded by IMGUI_HAS_DOCK preprocessor definitions. For this purpose, symbol_pickle.py and symbol_merge.py Python scripts are provided.
The brief workflow is as follows:
main branch, generates cimgui bindings, and run symbol_pickle.py --branch=main to generate symbol pickle file for main branch.docking branch, generates cimgui bindings, and run symbol_pickle.py --branch=docking to generate symbol pickle file for docking branch.symbol_merge.py to merge the two pickle files and generate the combined module. The script will calculate the difference of symbols between the two branches and guard the symbols with IMGUI_HAS_DOCK preprocessor definitions.
This repository contains several examples for how to integrate these generated module bindings with different backends. These examples are also used for build testing with GitHub Actions.
Currently, following examples are available:
Contributions for more examples are welcome!
To build these examples, you need:
Configure CMake with the following command:
cd examples
cmake --preset=default
then, by the library installation status on your system, the available targets will be configured. For example, if your system has GLFW installed and unless you're using macOS without Vulkan SDK, glfw_vulkan target will be available. You can build the example with:
cmake --build build --target glfw_vulkan
And the executable will be in examples/build folder.
If you want to build all examples regardless of the installed libraries, you can use vcpkg to install the used libraries. Configuring CMake with the following command:
cmake --preset=default -DCMAKE_TOOLCHAIN_FILE=<path-to-vcpkg>/scripts/buildsystems/vcpkg.cmake
will install all required libraries and enable the examples.
This project is licensed under the MIT License. See the LICENSE file for details.
45 commits
1 commits
Use ImGui with import imgui;. This binding is generated with cimgui and regularly updated and tested with GitHub Actions.
This repository already contains the generated bindings for the latest ImGui version.
imgui.cppm: exports all symbols in imgui.h, can be used as import imgui;.imgui_internal.cppm: exports all symbols in imgui_internal.h, can be used as import imgui_internal;. It implicitly exports imgui module, therefore you don't have to import imgui separately.imgui_freetype.cppm: exports all symbols in imgui_freetype.h, can be used as import imgui_freetype;. It implicitly exports imgui module.And following backends are also available:
imgui_impl_glfw.cppm: can be used as import imgui_impl_glfw;.imgui_impl_opengl2.cppm: can be used as import imgui_impl_opengl2;.imgui_impl_opengl3.cppm: can be used as import imgui_impl_opengl3;.imgui_impl_sdl2.cppm: can be used as import imgui_impl_sdl2;.imgui_impl_sdl3.cppm: can be used as import imgui_impl_sdl3;.imgui_impl_vulkan.cppm: can be used as import imgui_impl_vulkan;.If you want to use ImGui with an older version, different feature configuration or a custom backend, you can generate the bindings yourself. The following steps will guide you through the process:
git clone --recurse-submodules https://github.com/stripe2933/imgui-module.git
cd imgui-module
cimgui/imgui submodule folder, checkout the desired version tag or commit.cimgui configuration, explained in cimgui - Using Generator. This will generate definitions.json, structs_and_enums.json and impl_definitions.json files in cimgui/generator/output folder.python3 generate.py
generated folder. You can use them as described in the previous section.main and docking BranchesStarting from ImGui 1.92.7, now the workflow provides modules that are capable of both main and docking branches. Symbols are guarded by IMGUI_HAS_DOCK preprocessor definitions. For this purpose, symbol_pickle.py and symbol_merge.py Python scripts are provided.
The brief workflow is as follows:
main branch, generates cimgui bindings, and run symbol_pickle.py --branch=main to generate symbol pickle file for main branch.docking branch, generates cimgui bindings, and run symbol_pickle.py --branch=docking to generate symbol pickle file for docking branch.symbol_merge.py to merge the two pickle files and generate the combined module. The script will calculate the difference of symbols between the two branches and guard the symbols with IMGUI_HAS_DOCK preprocessor definitions.
This repository contains several examples for how to integrate these generated module bindings with different backends. These examples are also used for build testing with GitHub Actions.
Currently, following examples are available:
Contributions for more examples are welcome!
To build these examples, you need:
Configure CMake with the following command:
cd examples
cmake --preset=default
then, by the library installation status on your system, the available targets will be configured. For example, if your system has GLFW installed and unless you're using macOS without Vulkan SDK, glfw_vulkan target will be available. You can build the example with:
cmake --build build --target glfw_vulkan
And the executable will be in examples/build folder.
If you want to build all examples regardless of the installed libraries, you can use vcpkg to install the used libraries. Configuring CMake with the following command:
cmake --preset=default -DCMAKE_TOOLCHAIN_FILE=<path-to-vcpkg>/scripts/buildsystems/vcpkg.cmake
will install all required libraries and enable the examples.
This project is licensed under the MIT License. See the LICENSE file for details.
45 commits
1 commits
C++
77.0%
Python
23.0%