Compare commits

...

4 Commits

Author SHA1 Message Date
sonoro1234
c32d1c0c9b dont name igGetIO overload as the generic name of function (C++ name) solves issue #289 2025-03-15 17:51:30 +01:00
sonoro1234
3530b937f1 generation 2025-03-15 17:03:47 +01:00
Victor Bombi
bb6f212993 Merge pull request #288 from spencercw/vulkan
generator.lua: fix missing void in Vulkan function generation
2025-03-15 16:57:30 +01:00
Chris Spencer
e3af31fb9c generator.lua: fix missing void in Vulkan function generation 2025-03-15 11:57:14 +00:00
12 changed files with 26 additions and 16 deletions

View File

@@ -24,6 +24,8 @@
#define igButton igButton_Str #define igButton igButton_Str
#endif #endif
#define igGetIO igGetIO_Nil
GLFWwindow *window; GLFWwindow *window;
// Data // Data

View File

@@ -17,6 +17,8 @@
#define igButton igButton_Str #define igButton igButton_Str
#endif #endif
#define igGetIO igGetIO_Nil
GLFWwindow *window; GLFWwindow *window;
int main(int argc, char *argv[]) int main(int argc, char *argv[])

View File

@@ -18,6 +18,8 @@
#define igButton igButton_Str #define igButton igButton_Str
#endif #endif
#define igGetIO igGetIO_Nil
SDL_Window *window = NULL; SDL_Window *window = NULL;
int main(int argc, char* argv[]) int main(int argc, char* argv[])

View File

@@ -26,6 +26,8 @@
#define igButton igButton_Str #define igButton igButton_Str
#endif #endif
#define igGetIO igGetIO_Nil
#define IM_UNUSED(_VAR) ((void)(_VAR)) #define IM_UNUSED(_VAR) ((void)(_VAR))
#define IM_ASSERT(_EXPR) assert(_EXPR) #define IM_ASSERT(_EXPR) assert(_EXPR)
#define IM_ARRAYSIZE(_ARR) ((int)(sizeof(_ARR) / sizeof(*(_ARR)))) #define IM_ARRAYSIZE(_ARR) ((int)(sizeof(_ARR) / sizeof(*(_ARR))))

View File

@@ -53,7 +53,7 @@ CIMGUI_API void igSetCurrentContext(ImGuiContext* ctx)
{ {
return ImGui::SetCurrentContext(ctx); return ImGui::SetCurrentContext(ctx);
} }
CIMGUI_API ImGuiIO* igGetIO() CIMGUI_API ImGuiIO* igGetIO_Nil()
{ {
return &ImGui::GetIO(); return &ImGui::GetIO();
} }
@@ -3999,7 +3999,7 @@ CIMGUI_API ImGuiTableColumnSettings* ImGuiTableSettings_GetColumnSettings(ImGuiT
{ {
return self->GetColumnSettings(); return self->GetColumnSettings();
} }
CIMGUI_API ImGuiIO* igGetIOEx(ImGuiContext* ctx) CIMGUI_API ImGuiIO* igGetIO_ContextPtr(ImGuiContext* ctx)
{ {
return &ImGui::GetIO(ctx); return &ImGui::GetIO(ctx);
} }

View File

@@ -3633,7 +3633,7 @@ CIMGUI_API ImGuiContext* igCreateContext(ImFontAtlas* shared_font_atlas);
CIMGUI_API void igDestroyContext(ImGuiContext* ctx); CIMGUI_API void igDestroyContext(ImGuiContext* ctx);
CIMGUI_API ImGuiContext* igGetCurrentContext(void); CIMGUI_API ImGuiContext* igGetCurrentContext(void);
CIMGUI_API void igSetCurrentContext(ImGuiContext* ctx); CIMGUI_API void igSetCurrentContext(ImGuiContext* ctx);
CIMGUI_API ImGuiIO* igGetIO(void); CIMGUI_API ImGuiIO* igGetIO_Nil(void);
CIMGUI_API ImGuiPlatformIO* igGetPlatformIO_Nil(void); CIMGUI_API ImGuiPlatformIO* igGetPlatformIO_Nil(void);
CIMGUI_API ImGuiStyle* igGetStyle(void); CIMGUI_API ImGuiStyle* igGetStyle(void);
CIMGUI_API void igNewFrame(void); CIMGUI_API void igNewFrame(void);
@@ -4607,7 +4607,7 @@ CIMGUI_API void ImGuiTableColumnSettings_destroy(ImGuiTableColumnSettings* self)
CIMGUI_API ImGuiTableSettings* ImGuiTableSettings_ImGuiTableSettings(void); CIMGUI_API ImGuiTableSettings* ImGuiTableSettings_ImGuiTableSettings(void);
CIMGUI_API void ImGuiTableSettings_destroy(ImGuiTableSettings* self); CIMGUI_API void ImGuiTableSettings_destroy(ImGuiTableSettings* self);
CIMGUI_API ImGuiTableColumnSettings* ImGuiTableSettings_GetColumnSettings(ImGuiTableSettings* self); CIMGUI_API ImGuiTableColumnSettings* ImGuiTableSettings_GetColumnSettings(ImGuiTableSettings* self);
CIMGUI_API ImGuiIO* igGetIOEx(ImGuiContext* ctx); CIMGUI_API ImGuiIO* igGetIO_ContextPtr(ImGuiContext* ctx);
CIMGUI_API ImGuiPlatformIO* igGetPlatformIO_ContextPtr(ImGuiContext* ctx); CIMGUI_API ImGuiPlatformIO* igGetPlatformIO_ContextPtr(ImGuiContext* ctx);
CIMGUI_API ImGuiWindow* igGetCurrentWindowRead(void); CIMGUI_API ImGuiWindow* igGetCurrentWindowRead(void);
CIMGUI_API ImGuiWindow* igGetCurrentWindow(void); CIMGUI_API ImGuiWindow* igGetCurrentWindow(void);

View File

@@ -193,6 +193,6 @@ CIMGUI_API VkPresentModeKHR ImGui_ImplVulkanH_SelectPresentMode(VkPhysicalDevice
CIMGUI_API VkPhysicalDevice ImGui_ImplVulkanH_SelectPhysicalDevice(VkInstance instance); CIMGUI_API VkPhysicalDevice ImGui_ImplVulkanH_SelectPhysicalDevice(VkInstance instance);
CIMGUI_API uint32_t ImGui_ImplVulkanH_SelectQueueFamilyIndex(VkPhysicalDevice physical_device); CIMGUI_API uint32_t ImGui_ImplVulkanH_SelectQueueFamilyIndex(VkPhysicalDevice physical_device);
CIMGUI_API int ImGui_ImplVulkanH_GetMinImageCountFromPresentMode(VkPresentModeKHR present_mode); CIMGUI_API int ImGui_ImplVulkanH_GetMinImageCountFromPresentMode(VkPresentModeKHR present_mode);
CIMGUI_API ImGui_ImplVulkanH_Window* ImGui_ImplVulkanH_Window_ImGui_ImplVulkanH_Window(); CIMGUI_API ImGui_ImplVulkanH_Window* ImGui_ImplVulkanH_Window_ImGui_ImplVulkanH_Window(void);
#endif #endif

View File

@@ -91,10 +91,10 @@ local cimgui_skipped = {
--desired name --desired name
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
local cimgui_overloads = { local cimgui_overloads = {
igGetIO = { -- igGetIO = {
["()"] = "igGetIO", -- ["()"] = "igGetIO",
["(ImGuiContext*)"] = "igGetIOEx", -- ["(ImGuiContext*)"] = "igGetIOEx",
}, -- },
--igPushID = { --igPushID = {
--["(const char*)"] = "igPushIDStr", --["(const char*)"] = "igPushIDStr",
--["(const char*,const char*)"] = "igPushIDRange", --["(const char*,const char*)"] = "igPushIDRange",
@@ -128,6 +128,7 @@ local function func_header_impl_generate(FP)
local cimf = FP.defsT[t.cimguiname] local cimf = FP.defsT[t.cimguiname]
local def = cimf[t.signature] local def = cimf[t.signature]
local addcoment = def.comment or "" local addcoment = def.comment or ""
local empty = def.args:match("^%(%)") --no args
if def.constructor then if def.constructor then
-- only vulkan is manually created -- only vulkan is manually created
assert(def.ov_cimguiname=="ImGui_ImplVulkanH_Window_ImGui_ImplVulkanH_Window" or assert(def.ov_cimguiname=="ImGui_ImplVulkanH_Window_ImGui_ImplVulkanH_Window" or
@@ -139,7 +140,6 @@ local function func_header_impl_generate(FP)
else else
if def.stname == "" then --ImGui namespace or top level if def.stname == "" then --ImGui namespace or top level
local empty = def.args:match("^%(%)") --no args
table.insert(outtab,"CIMGUI_API".." "..def.ret.." "..def.ov_cimguiname..(empty and "(void)" or def.args)..";"..addcoment.."\n") table.insert(outtab,"CIMGUI_API".." "..def.ret.." "..def.ov_cimguiname..(empty and "(void)" or def.args)..";"..addcoment.."\n")
else else
cpp2ffi.prtable(def) cpp2ffi.prtable(def)

View File

@@ -21987,7 +21987,7 @@
"funcname": "GetIO", "funcname": "GetIO",
"location": "imgui:340", "location": "imgui:340",
"namespace": "ImGui", "namespace": "ImGui",
"ov_cimguiname": "igGetIO", "ov_cimguiname": "igGetIO_Nil",
"ret": "ImGuiIO*", "ret": "ImGuiIO*",
"retref": "&", "retref": "&",
"signature": "()", "signature": "()",
@@ -22008,7 +22008,7 @@
"funcname": "GetIO", "funcname": "GetIO",
"location": "imgui_internal:3238", "location": "imgui_internal:3238",
"namespace": "ImGui", "namespace": "ImGui",
"ov_cimguiname": "igGetIOEx", "ov_cimguiname": "igGetIO_ContextPtr",
"ret": "ImGuiIO*", "ret": "ImGuiIO*",
"retref": "&", "retref": "&",
"signature": "(ImGuiContext*)", "signature": "(ImGuiContext*)",

View File

@@ -18663,7 +18663,7 @@ local t={
funcname="GetIO", funcname="GetIO",
location="imgui:340", location="imgui:340",
namespace="ImGui", namespace="ImGui",
ov_cimguiname="igGetIO", ov_cimguiname="igGetIO_Nil",
ret="ImGuiIO*", ret="ImGuiIO*",
retref="&", retref="&",
signature="()", signature="()",
@@ -18681,7 +18681,7 @@ local t={
funcname="GetIO", funcname="GetIO",
location="imgui_internal:3238", location="imgui_internal:3238",
namespace="ImGui", namespace="ImGui",
ov_cimguiname="igGetIOEx", ov_cimguiname="igGetIO_ContextPtr",
ret="ImGuiIO*", ret="ImGuiIO*",
retref="&", retref="&",
signature="(ImGuiContext*)", signature="(ImGuiContext*)",

View File

@@ -124,8 +124,8 @@ igGetIDWithSeed 2
1 ImGuiID igGetIDWithSeed_Str (const char*,const char*,ImGuiID) 1 ImGuiID igGetIDWithSeed_Str (const char*,const char*,ImGuiID)
2 ImGuiID igGetIDWithSeed_Int (int,ImGuiID) 2 ImGuiID igGetIDWithSeed_Int (int,ImGuiID)
igGetIO 2 igGetIO 2
1 ImGuiIO* igGetIO () 1 ImGuiIO* igGetIO_Nil ()
2 ImGuiIO* igGetIOEx (ImGuiContext*) 2 ImGuiIO* igGetIO_ContextPtr (ImGuiContext*)
igGetKeyData 2 igGetKeyData 2
1 ImGuiKeyData* igGetKeyData_ContextPtr (ImGuiContext*,ImGuiKey) 1 ImGuiKeyData* igGetKeyData_ContextPtr (ImGuiContext*,ImGuiKey)
2 ImGuiKeyData* igGetKeyData_Key (ImGuiKey) 2 ImGuiKeyData* igGetKeyData_Key (ImGuiKey)

View File

@@ -11,6 +11,8 @@
#define igDebugCheckVersionAndDataLayout igDebugCheckVersionAndDataLayout_Str #define igDebugCheckVersionAndDataLayout igDebugCheckVersionAndDataLayout_Str
#endif #endif
#define igGetIO igGetIO_Nil
int main(void) int main(void)
{ {
assert(igDebugCheckVersionAndDataLayout(igGetVersion(), sizeof(ImGuiIO), sizeof(ImGuiStyle), assert(igDebugCheckVersionAndDataLayout(igGetVersion(), sizeof(ImGuiIO), sizeof(ImGuiStyle),