mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-10 20:08:31 +01:00
rename cimgui_auto to cimgui and cimgui to cimgui_nopreprocess
This commit is contained in:
@@ -6,7 +6,7 @@ include_directories(imgui)
|
|||||||
add_definitions("-DIMGUI_DISABLE_OBSOLETE_FUNCTIONS=1")
|
add_definitions("-DIMGUI_DISABLE_OBSOLETE_FUNCTIONS=1")
|
||||||
|
|
||||||
include_directories(.)
|
include_directories(.)
|
||||||
set(IMGUI_SOURCES ./cimgui_auto.cpp ./imgui/imgui.cpp ./imgui/imgui_draw.cpp ./imgui/imgui_demo.cpp ./imgui/imgui_widgets.cpp)
|
set(IMGUI_SOURCES ./cimgui.cpp ./imgui/imgui.cpp ./imgui/imgui_draw.cpp ./imgui/imgui_demo.cpp ./imgui/imgui_widgets.cpp)
|
||||||
|
|
||||||
set(IMGUI_LIBRARIES )
|
set(IMGUI_LIBRARIES )
|
||||||
|
|
||||||
|
2
Makefile
2
Makefile
@@ -2,7 +2,7 @@
|
|||||||
# Cross Platform Makefile
|
# Cross Platform Makefile
|
||||||
# Compatible with Ubuntu 14.04.1 and macOS
|
# Compatible with Ubuntu 14.04.1 and macOS
|
||||||
|
|
||||||
OBJS = cimgui_auto.o
|
OBJS = cimgui.o
|
||||||
OBJS += ./imgui/imgui.o
|
OBJS += ./imgui/imgui.o
|
||||||
OBJS += ./imgui/imgui_draw.o
|
OBJS += ./imgui/imgui_draw.o
|
||||||
OBJS += ./imgui/imgui_demo.o
|
OBJS += ./imgui/imgui_demo.o
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
This is a thin c-api wrapper programmatically generated for the excellent C++ immediate mode gui [Dear ImGui](https://github.com/ocornut/imgui).
|
This is a thin c-api wrapper programmatically generated for the excellent C++ immediate mode gui [Dear ImGui](https://github.com/ocornut/imgui).
|
||||||
All functions are programmatically wrapped except constructors, destructors and `ImVector`. (Unless someone find a use case for them)
|
All functions are programmatically wrapped except constructors, destructors and `ImVector`. (Unless someone find a use case for them)
|
||||||
Generated files are: `cimgui_auto.cpp`, `cimgui_auto.h` for C compilation. Also for helping in bindings creation, `definitions.lua` with function definition information and `structs_and_enums.lua`.
|
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](https://github.com/Extrawurst/DerelictImgui))
|
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](https://github.com/Extrawurst/DerelictImgui))
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
@@ -20,7 +20,7 @@ Notes:
|
|||||||
|
|
||||||
* update `imgui` folder to the version you desire.
|
* update `imgui` folder to the version you desire.
|
||||||
* run `generator/generator.bat` (or make a .sh version and please PR) with gcc and LuaJIT or Lua5.1 on your PATH.
|
* run `generator/generator.bat` (or make a .sh version and please PR) with gcc and LuaJIT or Lua5.1 on your PATH.
|
||||||
* as a result some files are generated: `cimgui_auto.cpp` and `cimgui_auto.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.
|
* 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.
|
||||||
* build as shown in https://github.com/sonoro1234/LuaJIT-ImGui/tree/master_auto_implementations/build
|
* build as shown in https://github.com/sonoro1234/LuaJIT-ImGui/tree/master_auto_implementations/build
|
||||||
* generate binding as done in https://github.com/sonoro1234/LuaJIT-ImGui/blob/master_auto_implementations/lua/build.bat
|
* generate binding as done in https://github.com/sonoro1234/LuaJIT-ImGui/blob/master_auto_implementations/lua/build.bat
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
#include "./imgui/imgui.h"
|
#include "./imgui/imgui.h"
|
||||||
#include "cimgui_auto.h"
|
#include "cimgui.h"
|
||||||
|
|
||||||
#include "./imgui/imgui_internal.h"
|
#include "./imgui/imgui_internal.h"
|
||||||
|
|
@@ -1977,6 +1977,226 @@ CIMGUI_API void ImFont_AddRemapChar(ImFont* self,ImWchar dst,ImWchar src,bool ov
|
|||||||
{
|
{
|
||||||
return self->AddRemapChar(dst,src,overwrite_dst);
|
return self->AddRemapChar(dst,src,overwrite_dst);
|
||||||
}
|
}
|
||||||
|
CIMGUI_API void igGetWindowPos_nonUDT(ImVec2 *pOut)
|
||||||
|
{
|
||||||
|
*pOut = ImGui::GetWindowPos();
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec2_Simple igGetWindowPos_nonUDT2()
|
||||||
|
{
|
||||||
|
ImVec2 ret = ImGui::GetWindowPos();
|
||||||
|
ImVec2_Simple ret2 = ImVec2ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void igGetWindowSize_nonUDT(ImVec2 *pOut)
|
||||||
|
{
|
||||||
|
*pOut = ImGui::GetWindowSize();
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec2_Simple igGetWindowSize_nonUDT2()
|
||||||
|
{
|
||||||
|
ImVec2 ret = ImGui::GetWindowSize();
|
||||||
|
ImVec2_Simple ret2 = ImVec2ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void igGetContentRegionMax_nonUDT(ImVec2 *pOut)
|
||||||
|
{
|
||||||
|
*pOut = ImGui::GetContentRegionMax();
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec2_Simple igGetContentRegionMax_nonUDT2()
|
||||||
|
{
|
||||||
|
ImVec2 ret = ImGui::GetContentRegionMax();
|
||||||
|
ImVec2_Simple ret2 = ImVec2ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void igGetContentRegionAvail_nonUDT(ImVec2 *pOut)
|
||||||
|
{
|
||||||
|
*pOut = ImGui::GetContentRegionAvail();
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec2_Simple igGetContentRegionAvail_nonUDT2()
|
||||||
|
{
|
||||||
|
ImVec2 ret = ImGui::GetContentRegionAvail();
|
||||||
|
ImVec2_Simple ret2 = ImVec2ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void igGetWindowContentRegionMin_nonUDT(ImVec2 *pOut)
|
||||||
|
{
|
||||||
|
*pOut = ImGui::GetWindowContentRegionMin();
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec2_Simple igGetWindowContentRegionMin_nonUDT2()
|
||||||
|
{
|
||||||
|
ImVec2 ret = ImGui::GetWindowContentRegionMin();
|
||||||
|
ImVec2_Simple ret2 = ImVec2ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void igGetWindowContentRegionMax_nonUDT(ImVec2 *pOut)
|
||||||
|
{
|
||||||
|
*pOut = ImGui::GetWindowContentRegionMax();
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec2_Simple igGetWindowContentRegionMax_nonUDT2()
|
||||||
|
{
|
||||||
|
ImVec2 ret = ImGui::GetWindowContentRegionMax();
|
||||||
|
ImVec2_Simple ret2 = ImVec2ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void igGetFontTexUvWhitePixel_nonUDT(ImVec2 *pOut)
|
||||||
|
{
|
||||||
|
*pOut = ImGui::GetFontTexUvWhitePixel();
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec2_Simple igGetFontTexUvWhitePixel_nonUDT2()
|
||||||
|
{
|
||||||
|
ImVec2 ret = ImGui::GetFontTexUvWhitePixel();
|
||||||
|
ImVec2_Simple ret2 = ImVec2ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void igGetCursorPos_nonUDT(ImVec2 *pOut)
|
||||||
|
{
|
||||||
|
*pOut = ImGui::GetCursorPos();
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec2_Simple igGetCursorPos_nonUDT2()
|
||||||
|
{
|
||||||
|
ImVec2 ret = ImGui::GetCursorPos();
|
||||||
|
ImVec2_Simple ret2 = ImVec2ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void igGetCursorStartPos_nonUDT(ImVec2 *pOut)
|
||||||
|
{
|
||||||
|
*pOut = ImGui::GetCursorStartPos();
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec2_Simple igGetCursorStartPos_nonUDT2()
|
||||||
|
{
|
||||||
|
ImVec2 ret = ImGui::GetCursorStartPos();
|
||||||
|
ImVec2_Simple ret2 = ImVec2ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void igGetCursorScreenPos_nonUDT(ImVec2 *pOut)
|
||||||
|
{
|
||||||
|
*pOut = ImGui::GetCursorScreenPos();
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec2_Simple igGetCursorScreenPos_nonUDT2()
|
||||||
|
{
|
||||||
|
ImVec2 ret = ImGui::GetCursorScreenPos();
|
||||||
|
ImVec2_Simple ret2 = ImVec2ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void igGetItemRectMin_nonUDT(ImVec2 *pOut)
|
||||||
|
{
|
||||||
|
*pOut = ImGui::GetItemRectMin();
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec2_Simple igGetItemRectMin_nonUDT2()
|
||||||
|
{
|
||||||
|
ImVec2 ret = ImGui::GetItemRectMin();
|
||||||
|
ImVec2_Simple ret2 = ImVec2ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void igGetItemRectMax_nonUDT(ImVec2 *pOut)
|
||||||
|
{
|
||||||
|
*pOut = ImGui::GetItemRectMax();
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec2_Simple igGetItemRectMax_nonUDT2()
|
||||||
|
{
|
||||||
|
ImVec2 ret = ImGui::GetItemRectMax();
|
||||||
|
ImVec2_Simple ret2 = ImVec2ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void igGetItemRectSize_nonUDT(ImVec2 *pOut)
|
||||||
|
{
|
||||||
|
*pOut = ImGui::GetItemRectSize();
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec2_Simple igGetItemRectSize_nonUDT2()
|
||||||
|
{
|
||||||
|
ImVec2 ret = ImGui::GetItemRectSize();
|
||||||
|
ImVec2_Simple ret2 = ImVec2ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void igCalcTextSize_nonUDT(ImVec2 *pOut,const char* text,const char* text_end,bool hide_text_after_double_hash,float wrap_width)
|
||||||
|
{
|
||||||
|
*pOut = ImGui::CalcTextSize(text,text_end,hide_text_after_double_hash,wrap_width);
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec2_Simple igCalcTextSize_nonUDT2(const char* text,const char* text_end,bool hide_text_after_double_hash,float wrap_width)
|
||||||
|
{
|
||||||
|
ImVec2 ret = ImGui::CalcTextSize(text,text_end,hide_text_after_double_hash,wrap_width);
|
||||||
|
ImVec2_Simple ret2 = ImVec2ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void igColorConvertU32ToFloat4_nonUDT(ImVec4 *pOut,ImU32 in)
|
||||||
|
{
|
||||||
|
*pOut = ImGui::ColorConvertU32ToFloat4(in);
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec4_Simple igColorConvertU32ToFloat4_nonUDT2(ImU32 in)
|
||||||
|
{
|
||||||
|
ImVec4 ret = ImGui::ColorConvertU32ToFloat4(in);
|
||||||
|
ImVec4_Simple ret2 = ImVec4ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void igGetMousePos_nonUDT(ImVec2 *pOut)
|
||||||
|
{
|
||||||
|
*pOut = ImGui::GetMousePos();
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec2_Simple igGetMousePos_nonUDT2()
|
||||||
|
{
|
||||||
|
ImVec2 ret = ImGui::GetMousePos();
|
||||||
|
ImVec2_Simple ret2 = ImVec2ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void igGetMousePosOnOpeningCurrentPopup_nonUDT(ImVec2 *pOut)
|
||||||
|
{
|
||||||
|
*pOut = ImGui::GetMousePosOnOpeningCurrentPopup();
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec2_Simple igGetMousePosOnOpeningCurrentPopup_nonUDT2()
|
||||||
|
{
|
||||||
|
ImVec2 ret = ImGui::GetMousePosOnOpeningCurrentPopup();
|
||||||
|
ImVec2_Simple ret2 = ImVec2ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void igGetMouseDragDelta_nonUDT(ImVec2 *pOut,int button,float lock_threshold)
|
||||||
|
{
|
||||||
|
*pOut = ImGui::GetMouseDragDelta(button,lock_threshold);
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec2_Simple igGetMouseDragDelta_nonUDT2(int button,float lock_threshold)
|
||||||
|
{
|
||||||
|
ImVec2 ret = ImGui::GetMouseDragDelta(button,lock_threshold);
|
||||||
|
ImVec2_Simple ret2 = ImVec2ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void ImColor_HSV_nonUDT(ImColor* self,ImColor *pOut,float h,float s,float v,float a)
|
||||||
|
{
|
||||||
|
*pOut = self->HSV(h,s,v,a);
|
||||||
|
}
|
||||||
|
CIMGUI_API ImColor_Simple ImColor_HSV_nonUDT2(ImColor* self,float h,float s,float v,float a)
|
||||||
|
{
|
||||||
|
ImColor ret = self->HSV(h,s,v,a);
|
||||||
|
ImColor_Simple ret2 = ImColorToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void ImDrawList_GetClipRectMin_nonUDT(ImDrawList* self,ImVec2 *pOut)
|
||||||
|
{
|
||||||
|
*pOut = self->GetClipRectMin();
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec2_Simple ImDrawList_GetClipRectMin_nonUDT2(ImDrawList* self)
|
||||||
|
{
|
||||||
|
ImVec2 ret = self->GetClipRectMin();
|
||||||
|
ImVec2_Simple ret2 = ImVec2ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void ImDrawList_GetClipRectMax_nonUDT(ImDrawList* self,ImVec2 *pOut)
|
||||||
|
{
|
||||||
|
*pOut = self->GetClipRectMax();
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec2_Simple ImDrawList_GetClipRectMax_nonUDT2(ImDrawList* self)
|
||||||
|
{
|
||||||
|
ImVec2 ret = self->GetClipRectMax();
|
||||||
|
ImVec2_Simple ret2 = ImVec2ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
CIMGUI_API void ImFont_CalcTextSizeA_nonUDT(ImFont* self,ImVec2 *pOut,float size,float max_width,float wrap_width,const char* text_begin,const char* text_end,const char** remaining)
|
||||||
|
{
|
||||||
|
*pOut = self->CalcTextSizeA(size,max_width,wrap_width,text_begin,text_end,remaining);
|
||||||
|
}
|
||||||
|
CIMGUI_API ImVec2_Simple ImFont_CalcTextSizeA_nonUDT2(ImFont* self,float size,float max_width,float wrap_width,const char* text_begin,const char* text_end,const char** remaining)
|
||||||
|
{
|
||||||
|
ImVec2 ret = self->CalcTextSizeA(size,max_width,wrap_width,text_begin,text_end,remaining);
|
||||||
|
ImVec2_Simple ret2 = ImVec2ToSimple(ret);
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,8 @@
|
|||||||
:: this script must be executed in this directory
|
:: this script must be executed in this directory
|
||||||
:: all the output goes to generated folder
|
:: all the output goes to generated folder
|
||||||
:: .cpp and .h files:
|
:: .cpp and .h files:
|
||||||
:: cimgui.h and cimgui.cpp generated without preprocess
|
:: cimgui_nopreprocess.h and cimgui_nopreprocess.cpp generated without preprocess
|
||||||
:: cimgui_auto.h and cimgui_auto.cpp with gcc preprocess
|
:: cimgui.h and cimgui.cpp with gcc preprocess
|
||||||
:: cimgui_impl.h with implementation function cdefs
|
:: cimgui_impl.h with implementation function cdefs
|
||||||
:: lua and json files:
|
:: lua and json files:
|
||||||
:: definitions.lua for function definitions
|
:: definitions.lua for function definitions
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
luajit.exe ./generator.lua glfw opengl3 opengl2 sdl
|
luajit.exe ./generator.lua glfw opengl3 opengl2 sdl
|
||||||
|
|
||||||
::copy cimgui.h and cimgui.cpp
|
::copy cimgui.h and cimgui.cpp
|
||||||
copy .\generated\cimgui_auto.h ..\cimgui_auto.h
|
copy .\generated\cimgui.h ..\cimgui.h
|
||||||
copy .\generated\cimgui_auto.cpp ..\cimgui_auto.cpp
|
copy .\generated\cimgui.cpp ..\cimgui.cpp
|
||||||
|
|
||||||
::leave console open
|
::leave console open
|
||||||
cmd /k
|
cmd /k
|
||||||
|
@@ -1190,7 +1190,7 @@ local function cimgui_generation(postfix,STP,FP)
|
|||||||
hfile:close()
|
hfile:close()
|
||||||
local cstructsstr,typedefs_dict = gen_structs_and_enums(STP.lines)
|
local cstructsstr,typedefs_dict = gen_structs_and_enums(STP.lines)
|
||||||
--for not gcc parsing
|
--for not gcc parsing
|
||||||
if postfix == "" then
|
if postfix == "_nopreprocess" then
|
||||||
cstructsstr = "typedef unsigned short ImDrawIdx;\ntypedef void* ImTextureID;\n"..cstructsstr
|
cstructsstr = "typedef unsigned short ImDrawIdx;\ntypedef void* ImTextureID;\n"..cstructsstr
|
||||||
end
|
end
|
||||||
hstrfile = hstrfile:gsub([[#include "imgui_structs%.h"]],cstructsstr)
|
hstrfile = hstrfile:gsub([[#include "imgui_structs%.h"]],cstructsstr)
|
||||||
@@ -1229,7 +1229,7 @@ for line in filelines(pipe) do
|
|||||||
end
|
end
|
||||||
pipe:close()
|
pipe:close()
|
||||||
FP:compute_overloads()
|
FP:compute_overloads()
|
||||||
cimgui_generation("",STP,FP)
|
cimgui_generation("_nopreprocess",STP,FP)
|
||||||
|
|
||||||
--then gcc
|
--then gcc
|
||||||
print"------------------generation with precompiler------------------------"
|
print"------------------generation with precompiler------------------------"
|
||||||
@@ -1254,7 +1254,7 @@ pipe:close()
|
|||||||
local ovstr = pFP:compute_overloads()
|
local ovstr = pFP:compute_overloads()
|
||||||
ADDnonUDT(pFP)
|
ADDnonUDT(pFP)
|
||||||
save_data("./generated/overloads.txt",ovstr)
|
save_data("./generated/overloads.txt",ovstr)
|
||||||
typedefs_dict2 = cimgui_generation("_auto",pSTP,pFP)
|
typedefs_dict2 = cimgui_generation("",pSTP,pFP)
|
||||||
--check arg detection failure if no name in function declaration
|
--check arg detection failure if no name in function declaration
|
||||||
check_arg_detection(pFP.defsT,typedefs_dict2)
|
check_arg_detection(pFP.defsT,typedefs_dict2)
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user