2018-10-09 00:48:03 -07:00
2018-09-10 13:23:49 +02:00
2015-04-07 19:12:56 +02:00
2018-09-12 12:22:46 +02:00
2015-04-07 16:06:21 +02:00
2018-10-08 12:53:56 +02:00
2018-10-08 13:54:58 +02:00
2017-05-30 07:14:57 +02:00

cimgui Build Status

sample

This is a thin c-api wrapper programmatically generated for the excellent C++ immediate mode gui Dear ImGui. All functions are programmatically wrapped except constructors, destructors and ImVector. (Unless someone find a use case for them) Generated files are: cimgui.cpp, cimgui.h for C compilation. Also for helping in bindings creation, definitions.lua with function definition information and structs_and_enums.lua. This library is intended as a intermediate layer to be able to use Dear ImGui from other languages that can interface with C (like D - see D-binding)

History:

Initially cimgui was developed by Stephan Dilly as hand-written code but lately turned into an auto-generated version by sonoro1234 in order to keep up with imgui more easily (letting the user select the desired branch and commit)

Notes:

compilation

using generator

  • you will need LuaJIT (https://github.com/LuaJIT/LuaJIT.git better 2.1 branch) or precompiled for linux/macOS/windows in https://luapower.com/luajit/download
  • need also gcc compiler for doing preprocessing (In windows MinGW-W64-builds for example)
  • update imgui folder to the version you desire.
  • run generator/generator.bat (or make a .sh version and please PR) with gcc and LuaJIT on your PATH.
  • as a result some files are generated: cimgui.cpp and cimgui.h for compiling and some lua/json files with information about the binding: definitions.json with function info, structs_and_enums.json with struct and enum info, impl_definitions.json with functions from the implementations info.

generate binding

usage

  • use whatever method is in ImGui c++ namespace in the original imgui.h by prepending ig
  • methods have the same parameter list and return values (where possible)
  • functions that belong to a struct have an extra first argument with a pointer to the struct.
  • where a function returns UDT (user defined type) by value some compilers complain so another function with the name function_name_nonUDT is generated accepting a pointer to the UDT type as the first argument. (or second argument if it is a struct function)
  • also is generated function_name_nonUDT2 which instead of returning the UDT type returns a simple version (without functions) called UDTType_Simple (ImVec2_Simple for ImVec2)

example bindings based on cimgui

Description
Languages
Lua 73.2%
C 16.1%
C++ 9.6%
CMake 0.9%
Shell 0.1%