Compare commits

..

28 Commits

Author SHA1 Message Date
sonoro1234
6d0a376516 pull imgui 1.92.1 and generate 2025-07-14 09:41:32 +02:00
sonoro1234
ce46a36843 Merge branch 'docking_inter' 2025-07-01 11:34:22 +02:00
sonoro1234
cf8523f31f Merge branch 'docking_inter' 1.92.0dock_b 2025-06-27 11:51:33 +02:00
sonoro1234
0b0a04de25 Merge branch 'docking_inter' 2025-03-22 10:23:01 +01:00
sonoro1234
e9a4157067 Merge remote-tracking branch 'remotes/origin/docking_inter' 2025-03-15 08:23:45 +01:00
sonoro1234
d6b4ecda71 Merge branch 'docking_inter' 2025-02-04 16:42:14 +01:00
sonoro1234
1427639147 Merge branch 'docking_inter' 2025-01-21 16:06:26 +01:00
sonoro1234
e3b48a15f0 Merge branch 'docking_inter' 2024-12-12 13:20:21 +01:00
sonoro1234
8ec6558ecc Merge branch 'docking_inter' 2024-11-18 18:26:51 +01:00
sonoro1234
43429513a8 Merge branch 'docking_inter' 2024-10-19 12:05:11 +02:00
sonoro1234
79e40b6657 Merge branch 'docking_inter' 2024-10-05 11:06:45 +02:00
sonoro1234
833e9366de Merge branch 'docking_inter' 2024-10-01 13:05:38 +02:00
sonoro1234
74902e7392 Merge branch 'docking_inter' 2024-09-08 11:57:14 +02:00
sonoro1234
143c37b7ac Merge branch 'docking_inter' 2024-07-31 11:27:49 +02:00
sonoro1234
7c79f59fa2 Merge branch 'docking_inter' 2024-07-03 11:14:11 +02:00
sonoro1234
35fdbf393f Merge branch 'docking_inter' 2024-06-07 13:26:08 +02:00
sonoro1234
bf02a1552e Merge branch 'docking_inter' 2024-05-28 10:18:05 +02:00
sonoro1234
481cd32543 Merge branch 'docking_inter' 2024-05-10 17:11:32 +02:00
sonoro1234
d222bc5a4e Merge branch 'docking_inter' 2024-04-19 10:54:29 +02:00
sonoro1234
f0fb387921 Merge branch 'docking_inter' 2024-02-24 13:15:42 +01:00
sonoro1234
c7133969db Merge branch 'docking_inter' 2024-02-16 11:36:05 +01:00
sonoro1234
0821a31dfe Merge branch 'docking_inter' 2024-02-14 11:17:50 +01:00
sonoro1234
9009dd72e9 Merge branch 'docking_inter' 1.90.1 2024-01-12 11:27:04 +01:00
sonoro1234
b6e02f4131 Merge branch 'docking_inter' 2023-11-17 11:08:06 +01:00
sonoro1234
b28023c3f6 Merge branch 'docking_inter' 2023-09-08 18:09:15 +02:00
sonoro1234
1bb9cd7347 Merge branch 'docking_inter' 2023-04-18 10:43:06 +02:00
sonoro1234
d24246adfd Merge branch 'docking_inter' 2023-02-15 10:18:15 +01:00
sonoro1234
6dba58d90f merge from docking_inter 2023-01-07 11:34:35 +01:00
21 changed files with 7471 additions and 19342 deletions

View File

@@ -11,16 +11,12 @@ 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:
* currently this wrapper is based on version [1.92.4 of Dear ImGui with internal api]
* currently this wrapper is based on version [1.92.0 of Dear ImGui with internal api]
* only functions, structs and enums from imgui.h (an optionally imgui_internal.h) are wrapped.
* if you are interested in imgui backends you should look [LuaJIT-ImGui](https://github.com/sonoro1234/LuaJIT-ImGui) project.
* All naming is algorithmic except for those names that were coded in cimgui_overloads table (https://github.com/cimgui/cimgui/blob/master/generator/generator.lua#L60). In the official version this table is empty.
* Current overloaded function names can be found in (https://github.com/cimgui/cimgui/blob/master/generator/output/overloads.txt)
# changes
* 10/11/2025: Functions returning and taking as argument no POD structs is now doing a conversion internally to allow ARM64 compilation. In structs_and_enums.json under key nonPOD_used we get a collection where keys are types non usable from C that appear as returns or args to funtions. value can be true or "inherited" when type comes from cimgui and appears in a cimgui extension (cimplot ...). The C names have suffix _c.
# compilation
* clone
@@ -64,8 +60,7 @@ Notes:
* retref : is set if original return type is a reference. (will be a pointer in cimgui)
* argsT : an array of collections (each one with type: argument type and name: the argument name, when the argument is a function pointer also ret: return type and signature: the function signature)
* args : a string of argsT concatenated and separated by commas
* call_args_old : a string with the argument names separated by commas for calling imgui function
* call_args : call_args_old with conversion added.
* call_args : a string with the argument names separated by commas for calling imgui function
* defaults : a collection in which key is argument name and value is the default value.
* manual : will be true if this function is hand-written (not generated)
* skipped : will be true if this function is not generated (and not hand-written)
@@ -75,7 +70,7 @@ Notes:
* realdestructor : is set if the function is a destructor for a class
* templated : is set if the function belongs to a templated class (ImVector)
* templatedgen: is set if the function belongs to a struct generated from template (ImVector_ImWchar)
* nonUDT : if present the original function was returning a user defined type.
* nonUDT : if present the original function was returning a user defined type so that signature has been changed to accept a pointer to the UDT as first argument.
* location : name of the header file and linenumber this function comes from. (imgui:000, internal:123, imgui_impl_xxx:123)
* is_static_function : is setted when it is an struct static function.
### structs_and_enums description
@@ -91,12 +86,12 @@ Notes:
* size : the number of array elements (when it is an array)
* bitfield : the bitfield width (in case it is a bitfield)
* under key locations we get the locations collection in which each key is the enum tagname or the struct name and the value is the name of the header file and line number this comes from.
* under key nonPOD_used we get a collection where keys are types non usable from C that appear as returns or args to funtions. value can be true or "inherited" when type comes from cimgui and appears in a cimgui extension (cimplot ...). The C names have suffix _c.
# usage
* use whatever method is in ImGui c++ namespace in the original [imgui.h](https://github.com/ocornut/imgui/blob/master/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 the function is generated accepting a pointer to the UDT type as the first argument (or second if belongs to a struct).
* constructors return pointer to struct and has been named Struct_name_Struct_name
# usage with backends

View File

@@ -264,7 +264,7 @@ static void SetupVulkanWindow(ImGui_ImplVulkanH_Window* wd, VkSurfaceKHR surface
// Create SwapChain, RenderPass, Framebuffer, etc.
IM_ASSERT(g_MinImageCount >= 2);
ImGui_ImplVulkanH_CreateOrResizeWindow(g_Instance, g_PhysicalDevice, g_Device, wd, g_QueueFamily, g_Allocator, width, height, g_MinImageCount, 0);
ImGui_ImplVulkanH_CreateOrResizeWindow(g_Instance, g_PhysicalDevice, g_Device, wd, g_QueueFamily, g_Allocator, width, height, g_MinImageCount);
}
static void CleanupVulkan()
@@ -394,18 +394,18 @@ int main(int argc, char* argv[])
// Create window with Vulkan graphics context
float main_scale = SDL_GetDisplayContentScale(SDL_GetPrimaryDisplay());
SDL_WindowFlags window_flags = SDL_WINDOW_VULKAN | SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIDDEN | SDL_WINDOW_HIGH_PIXEL_DENSITY;
SDL_Window* window = SDL_CreateWindow("Dear ImGui SDL3+Vulkan example", (int)(1280 * main_scale), (int)(800 * main_scale), window_flags);
SDL_Window* window = SDL_CreateWindow("Dear ImGui SDL3+Vulkan example", (int)(1280 * main_scale), (int)(720 * main_scale), window_flags);
if (window == NULL)
{
printf("Error: SDL_CreateWindow(): %s\n", SDL_GetError());
return 1;
return -1;
}
// Setup Vulkan
uint32_t extensions_count = 0;
const char *const *extensions_nude = SDL_Vulkan_GetInstanceExtensions(&extensions_count);
if (extensions_nude == NULL) {
printf("Error: SDL_Vulkan_GetInstanceExtensions(): %s\n", SDL_GetError());
return 1;
return -1;
}
const char** extensions = (const char**)malloc(extensions_count * sizeof(const char*));
if (extensions == NULL) {
@@ -472,12 +472,12 @@ int main(int argc, char* argv[])
init_info.Queue = g_Queue;
init_info.PipelineCache = g_PipelineCache;
init_info.DescriptorPool = g_DescriptorPool;
init_info.RenderPass = wd->RenderPass;
init_info.Subpass = 0;
init_info.MinImageCount = g_MinImageCount;
init_info.ImageCount = wd->ImageCount;
init_info.MSAASamples = VK_SAMPLE_COUNT_1_BIT;
init_info.Allocator = g_Allocator;
init_info.PipelineInfoMain.RenderPass = wd->RenderPass;
init_info.PipelineInfoMain.Subpass = 0;
init_info.PipelineInfoMain.MSAASamples = VK_SAMPLE_COUNT_1_BIT;
init_info.CheckVkResultFn = check_vk_result;
ImGui_ImplVulkan_Init(&init_info);
@@ -536,7 +536,7 @@ int main(int argc, char* argv[])
if (fb_width > 0 && fb_height > 0 && (g_SwapChainRebuild || g_MainWindowData.Width != fb_width || g_MainWindowData.Height != fb_height))
{
ImGui_ImplVulkan_SetMinImageCount(g_MinImageCount);
ImGui_ImplVulkanH_CreateOrResizeWindow(g_Instance, g_PhysicalDevice, g_Device, &g_MainWindowData, g_QueueFamily, g_Allocator, fb_width, fb_height, g_MinImageCount, 0);
ImGui_ImplVulkanH_CreateOrResizeWindow(g_Instance, g_PhysicalDevice, g_Device, &g_MainWindowData, g_QueueFamily, g_Allocator, fb_width, fb_height, g_MinImageCount);
g_MainWindowData.FrameIndex = 0;
g_SwapChainRebuild = false;
}

View File

@@ -268,7 +268,7 @@ static void SetupVulkanWindow(ImGui_ImplVulkanH_Window* wd, VkSurfaceKHR surface
// Create SwapChain, RenderPass, Framebuffer, etc.
IM_ASSERT(g_MinImageCount >= 2);
ImGui_ImplVulkanH_CreateOrResizeWindow(g_Instance, g_PhysicalDevice, g_Device, wd, g_QueueFamily, g_Allocator, width, height, g_MinImageCount, 0);
ImGui_ImplVulkanH_CreateOrResizeWindow(g_Instance, g_PhysicalDevice, g_Device, wd, g_QueueFamily, g_Allocator, width, height, g_MinImageCount);
}
static void CleanupVulkan()
@@ -390,7 +390,7 @@ int main(int argc, char* argv[])
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_GAMECONTROLLER) != 0)
{
printf("Error: %s\n", SDL_GetError());
return 1;
return -1;
}
// From 2.0.18: Enable native IME.
@@ -405,7 +405,7 @@ int main(int argc, char* argv[])
if (window == NULL)
{
printf("Error: SDL_CreateWindow(): %s\n", SDL_GetError());
return 1;
return -1;
}
// Setup Vulkan
uint32_t extensions_count = 0;
@@ -467,12 +467,12 @@ int main(int argc, char* argv[])
init_info.Queue = g_Queue;
init_info.PipelineCache = g_PipelineCache;
init_info.DescriptorPool = g_DescriptorPool;
init_info.RenderPass = wd->RenderPass;
init_info.Subpass = 0;
init_info.MinImageCount = g_MinImageCount;
init_info.ImageCount = wd->ImageCount;
init_info.MSAASamples = VK_SAMPLE_COUNT_1_BIT;
init_info.Allocator = g_Allocator;
init_info.PipelineInfoMain.RenderPass = wd->RenderPass;
init_info.PipelineInfoMain.Subpass = 0;
init_info.PipelineInfoMain.MSAASamples = VK_SAMPLE_COUNT_1_BIT;
init_info.CheckVkResultFn = check_vk_result;
ImGui_ImplVulkan_Init(&init_info);
@@ -531,7 +531,7 @@ int main(int argc, char* argv[])
if (fb_width > 0 && fb_height > 0 && (g_SwapChainRebuild || g_MainWindowData.Width != fb_width || g_MainWindowData.Height != fb_height))
{
ImGui_ImplVulkan_SetMinImageCount(g_MinImageCount);
ImGui_ImplVulkanH_CreateOrResizeWindow(g_Instance, g_PhysicalDevice, g_Device, &g_MainWindowData, g_QueueFamily, g_Allocator, fb_width, fb_height, g_MinImageCount, 0);
ImGui_ImplVulkanH_CreateOrResizeWindow(g_Instance, g_PhysicalDevice, g_Device, &g_MainWindowData, g_QueueFamily, g_Allocator, fb_width, fb_height, g_MinImageCount);
g_MainWindowData.FrameIndex = 0;
g_SwapChainRebuild = false;
}

1566
cimgui.cpp

File diff suppressed because it is too large Load Diff

1493
cimgui.h

File diff suppressed because it is too large Load Diff

View File

@@ -8,44 +8,44 @@ typedef struct GLFWmonitor GLFWmonitor;
struct GLFWwindow;
struct GLFWmonitor;
#endif //CIMGUI_DEFINE_ENUMS_AND_STRUCTS
CIMGUI_API void ImGui_ImplGlfw_CharCallback(GLFWwindow* window,unsigned int c);
CIMGUI_API bool ImGui_ImplGlfw_InitForOpenGL(GLFWwindow* window,bool install_callbacks);
CIMGUI_API bool ImGui_ImplGlfw_InitForVulkan(GLFWwindow* window,bool install_callbacks);
CIMGUI_API bool ImGui_ImplGlfw_InitForOther(GLFWwindow* window,bool install_callbacks);
CIMGUI_API void ImGui_ImplGlfw_Shutdown(void);
CIMGUI_API void ImGui_ImplGlfw_NewFrame(void);
CIMGUI_API void ImGui_ImplGlfw_InstallCallbacks(GLFWwindow* window);
CIMGUI_API void ImGui_ImplGlfw_RestoreCallbacks(GLFWwindow* window);
CIMGUI_API void ImGui_ImplGlfw_SetCallbacksChainForAllWindows(bool chain_for_all_windows);
CIMGUI_API void ImGui_ImplGlfw_WindowFocusCallback(GLFWwindow* window,int focused);
CIMGUI_API void ImGui_ImplGlfw_CursorEnterCallback(GLFWwindow* window,int entered);
CIMGUI_API void ImGui_ImplGlfw_CursorPosCallback(GLFWwindow* window,double x,double y);
CIMGUI_API float ImGui_ImplGlfw_GetContentScaleForMonitor(GLFWmonitor* monitor);
CIMGUI_API float ImGui_ImplGlfw_GetContentScaleForWindow(GLFWwindow* window);
CIMGUI_API bool ImGui_ImplGlfw_InitForOpenGL(GLFWwindow* window,bool install_callbacks);
CIMGUI_API bool ImGui_ImplGlfw_InitForOther(GLFWwindow* window,bool install_callbacks);
CIMGUI_API bool ImGui_ImplGlfw_InitForVulkan(GLFWwindow* window,bool install_callbacks);
CIMGUI_API void ImGui_ImplGlfw_InstallCallbacks(GLFWwindow* window);
CIMGUI_API void ImGui_ImplGlfw_KeyCallback(GLFWwindow* window,int key,int scancode,int action,int mods);
CIMGUI_API void ImGui_ImplGlfw_MonitorCallback(GLFWmonitor* monitor,int event);
CIMGUI_API void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow* window,int button,int action,int mods);
CIMGUI_API void ImGui_ImplGlfw_NewFrame(void);
CIMGUI_API void ImGui_ImplGlfw_RestoreCallbacks(GLFWwindow* window);
CIMGUI_API void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window,double xoffset,double yoffset);
CIMGUI_API void ImGui_ImplGlfw_SetCallbacksChainForAllWindows(bool chain_for_all_windows);
CIMGUI_API void ImGui_ImplGlfw_Shutdown(void);
CIMGUI_API void ImGui_ImplGlfw_KeyCallback(GLFWwindow* window,int key,int scancode,int action,int mods);
CIMGUI_API void ImGui_ImplGlfw_CharCallback(GLFWwindow* window,unsigned int c);
CIMGUI_API void ImGui_ImplGlfw_MonitorCallback(GLFWmonitor* monitor,int event);
CIMGUI_API void ImGui_ImplGlfw_Sleep(int milliseconds);
CIMGUI_API void ImGui_ImplGlfw_WindowFocusCallback(GLFWwindow* window,int focused);
CIMGUI_API float ImGui_ImplGlfw_GetContentScaleForWindow(GLFWwindow* window);
CIMGUI_API float ImGui_ImplGlfw_GetContentScaleForMonitor(GLFWmonitor* monitor);
#endif
#ifdef CIMGUI_USE_OPENGL3
CIMGUI_API bool ImGui_ImplOpenGL3_CreateDeviceObjects(void);
CIMGUI_API void ImGui_ImplOpenGL3_DestroyDeviceObjects(void);
CIMGUI_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version);
CIMGUI_API void ImGui_ImplOpenGL3_Shutdown(void);
CIMGUI_API void ImGui_ImplOpenGL3_NewFrame(void);
CIMGUI_API void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data);
CIMGUI_API void ImGui_ImplOpenGL3_Shutdown(void);
CIMGUI_API bool ImGui_ImplOpenGL3_CreateDeviceObjects(void);
CIMGUI_API void ImGui_ImplOpenGL3_DestroyDeviceObjects(void);
CIMGUI_API void ImGui_ImplOpenGL3_UpdateTexture(ImTextureData* tex);
#endif
#ifdef CIMGUI_USE_OPENGL2
CIMGUI_API bool ImGui_ImplOpenGL2_CreateDeviceObjects(void);
CIMGUI_API void ImGui_ImplOpenGL2_DestroyDeviceObjects(void);
CIMGUI_API bool ImGui_ImplOpenGL2_Init(void);
CIMGUI_API void ImGui_ImplOpenGL2_Shutdown(void);
CIMGUI_API void ImGui_ImplOpenGL2_NewFrame(void);
CIMGUI_API void ImGui_ImplOpenGL2_RenderDrawData(ImDrawData* draw_data);
CIMGUI_API void ImGui_ImplOpenGL2_Shutdown(void);
CIMGUI_API bool ImGui_ImplOpenGL2_CreateDeviceObjects(void);
CIMGUI_API void ImGui_ImplOpenGL2_DestroyDeviceObjects(void);
CIMGUI_API void ImGui_ImplOpenGL2_UpdateTexture(ImTextureData* tex);
#endif
@@ -61,18 +61,18 @@ struct _SDL_GameController;
typedef union SDL_Event SDL_Event;
typedef enum { ImGui_ImplSDL2_GamepadMode_AutoFirst, ImGui_ImplSDL2_GamepadMode_AutoAll, ImGui_ImplSDL2_GamepadMode_Manual }ImGui_ImplSDL2_GamepadMode;
#endif //CIMGUI_DEFINE_ENUMS_AND_STRUCTS
CIMGUI_API float ImGui_ImplSDL2_GetContentScaleForDisplay(int display_index);
CIMGUI_API float ImGui_ImplSDL2_GetContentScaleForWindow(SDL_Window* window);
CIMGUI_API bool ImGui_ImplSDL2_InitForOpenGL(SDL_Window* window,void* sdl_gl_context);
CIMGUI_API bool ImGui_ImplSDL2_InitForVulkan(SDL_Window* window);
CIMGUI_API bool ImGui_ImplSDL2_InitForD3D(SDL_Window* window);
CIMGUI_API bool ImGui_ImplSDL2_InitForMetal(SDL_Window* window);
CIMGUI_API bool ImGui_ImplSDL2_InitForOpenGL(SDL_Window* window,void* sdl_gl_context);
CIMGUI_API bool ImGui_ImplSDL2_InitForOther(SDL_Window* window);
CIMGUI_API bool ImGui_ImplSDL2_InitForSDLRenderer(SDL_Window* window,SDL_Renderer* renderer);
CIMGUI_API bool ImGui_ImplSDL2_InitForVulkan(SDL_Window* window);
CIMGUI_API bool ImGui_ImplSDL2_InitForOther(SDL_Window* window);
CIMGUI_API void ImGui_ImplSDL2_Shutdown(void);
CIMGUI_API void ImGui_ImplSDL2_NewFrame(void);
CIMGUI_API bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event);
CIMGUI_API float ImGui_ImplSDL2_GetContentScaleForWindow(SDL_Window* window);
CIMGUI_API float ImGui_ImplSDL2_GetContentScaleForDisplay(int display_index);
CIMGUI_API void ImGui_ImplSDL2_SetGamepadMode(ImGui_ImplSDL2_GamepadMode mode,struct _SDL_GameController** manual_gamepads_array,int manual_gamepads_count);
CIMGUI_API void ImGui_ImplSDL2_Shutdown(void);
#endif
#ifdef CIMGUI_USE_SDL3
@@ -87,17 +87,17 @@ struct SDL_Gamepad;
typedef union SDL_Event SDL_Event;
typedef enum { ImGui_ImplSDL3_GamepadMode_AutoFirst, ImGui_ImplSDL3_GamepadMode_AutoAll, ImGui_ImplSDL3_GamepadMode_Manual }ImGui_ImplSDL3_GamepadMode;
#endif //CIMGUI_DEFINE_ENUMS_AND_STRUCTS
CIMGUI_API bool ImGui_ImplSDL3_InitForOpenGL(SDL_Window* window,void* sdl_gl_context);
CIMGUI_API bool ImGui_ImplSDL3_InitForVulkan(SDL_Window* window);
CIMGUI_API bool ImGui_ImplSDL3_InitForD3D(SDL_Window* window);
CIMGUI_API bool ImGui_ImplSDL3_InitForMetal(SDL_Window* window);
CIMGUI_API bool ImGui_ImplSDL3_InitForOpenGL(SDL_Window* window,void* sdl_gl_context);
CIMGUI_API bool ImGui_ImplSDL3_InitForOther(SDL_Window* window);
CIMGUI_API bool ImGui_ImplSDL3_InitForSDLGPU(SDL_Window* window);
CIMGUI_API bool ImGui_ImplSDL3_InitForSDLRenderer(SDL_Window* window,SDL_Renderer* renderer);
CIMGUI_API bool ImGui_ImplSDL3_InitForVulkan(SDL_Window* window);
CIMGUI_API bool ImGui_ImplSDL3_InitForSDLGPU(SDL_Window* window);
CIMGUI_API bool ImGui_ImplSDL3_InitForOther(SDL_Window* window);
CIMGUI_API void ImGui_ImplSDL3_Shutdown(void);
CIMGUI_API void ImGui_ImplSDL3_NewFrame(void);
CIMGUI_API bool ImGui_ImplSDL3_ProcessEvent(const SDL_Event* event);
CIMGUI_API void ImGui_ImplSDL3_SetGamepadMode(ImGui_ImplSDL3_GamepadMode mode,SDL_Gamepad** manual_gamepads_array,int manual_gamepads_count);
CIMGUI_API void ImGui_ImplSDL3_Shutdown(void);
#endif
#ifdef CIMGUI_USE_VULKAN
@@ -105,15 +105,6 @@ CIMGUI_API void ImGui_ImplSDL3_Shutdown(void);
typedef struct ImGui_ImplVulkanH_Frame ImGui_ImplVulkanH_Frame;
typedef struct ImGui_ImplVulkanH_Window ImGui_ImplVulkanH_Window;
typedef struct ImGui_ImplVulkan_PipelineInfo ImGui_ImplVulkan_PipelineInfo;
struct ImGui_ImplVulkan_PipelineInfo
{
VkRenderPass RenderPass;
uint32_t Subpass;
VkSampleCountFlagBits MSAASamples;
VkPipelineRenderingCreateInfoKHR PipelineRenderingCreateInfo;
VkImageUsageFlags SwapChainImageUsage;
};
typedef struct ImGui_ImplVulkan_InitInfo ImGui_ImplVulkan_InitInfo;
struct ImGui_ImplVulkan_InitInfo
{
@@ -124,18 +115,18 @@ struct ImGui_ImplVulkan_InitInfo
uint32_t QueueFamily;
VkQueue Queue;
VkDescriptorPool DescriptorPool;
uint32_t DescriptorPoolSize;
VkRenderPass RenderPass;
uint32_t MinImageCount;
uint32_t ImageCount;
VkSampleCountFlagBits MSAASamples;
VkPipelineCache PipelineCache;
ImGui_ImplVulkan_PipelineInfo PipelineInfoMain;
ImGui_ImplVulkan_PipelineInfo PipelineInfoForViewports;
uint32_t Subpass;
uint32_t DescriptorPoolSize;
bool UseDynamicRendering;
VkPipelineRenderingCreateInfoKHR PipelineRenderingCreateInfo;
const VkAllocationCallbacks* Allocator;
void (*CheckVkResultFn)(VkResult err);
VkDeviceSize MinAllocationSize;
VkShaderModuleCreateInfo CustomShaderVertCreateInfo;
VkShaderModuleCreateInfo CustomShaderFragCreateInfo;
};
typedef struct ImGui_ImplVulkan_RenderState ImGui_ImplVulkan_RenderState;
struct ImGui_ImplVulkan_RenderState
@@ -174,6 +165,7 @@ struct ImGui_ImplVulkanH_Window
VkSurfaceFormatKHR SurfaceFormat;
VkPresentModeKHR PresentMode;
VkRenderPass RenderPass;
VkPipeline Pipeline;
bool UseDynamicRendering;
bool ClearEnable;
VkClearValue ClearValue;
@@ -189,25 +181,23 @@ struct ImGui_ImplVulkanH_Window
typedef ImVector<ImGui_ImplVulkanH_Frame> ImVector_ImGui_ImplVulkanH_Frame;
typedef ImVector<ImGui_ImplVulkanH_FrameSemaphores> ImVector_ImGui_ImplVulkanH_FrameSemaphores;
#endif //CIMGUI_DEFINE_ENUMS_AND_STRUCTS
CIMGUI_API void ImGui_ImplVulkanH_CreateOrResizeWindow(VkInstance instance,VkPhysicalDevice physical_device,VkDevice device,ImGui_ImplVulkanH_Window* wd,uint32_t queue_family,const VkAllocationCallbacks* allocator,int w,int h,uint32_t min_image_count,VkImageUsageFlags image_usage);
CIMGUI_API void ImGui_ImplVulkanH_DestroyWindow(VkInstance instance,VkDevice device,ImGui_ImplVulkanH_Window* wd,const VkAllocationCallbacks* allocator);
CIMGUI_API int ImGui_ImplVulkanH_GetMinImageCountFromPresentMode(VkPresentModeKHR present_mode);
CIMGUI_API ImGui_ImplVulkanH_Window* ImGui_ImplVulkanH_GetWindowDataFromViewport(ImGuiViewport* viewport);
CIMGUI_API VkPhysicalDevice ImGui_ImplVulkanH_SelectPhysicalDevice(VkInstance instance);
CIMGUI_API VkPresentModeKHR ImGui_ImplVulkanH_SelectPresentMode(VkPhysicalDevice physical_device,VkSurfaceKHR surface,const VkPresentModeKHR* request_modes,int request_modes_count);
CIMGUI_API uint32_t ImGui_ImplVulkanH_SelectQueueFamilyIndex(VkPhysicalDevice physical_device);
CIMGUI_API VkSurfaceFormatKHR ImGui_ImplVulkanH_SelectSurfaceFormat(VkPhysicalDevice physical_device,VkSurfaceKHR surface,const VkFormat* request_formats,int request_formats_count,VkColorSpaceKHR request_color_space);
CIMGUI_API ImGui_ImplVulkanH_Window* ImGui_ImplVulkanH_Window_ImGui_ImplVulkanH_Window(void);
CIMGUI_API VkDescriptorSet ImGui_ImplVulkan_AddTexture(VkSampler sampler,VkImageView image_view,VkImageLayout image_layout);
CIMGUI_API void ImGui_ImplVulkan_CreateMainPipeline(const ImGui_ImplVulkan_PipelineInfo* info);
CIMGUI_API bool ImGui_ImplVulkan_Init(ImGui_ImplVulkan_InitInfo* info);
CIMGUI_API bool ImGui_ImplVulkan_LoadFunctions(uint32_t api_version,PFN_vkVoidFunction(*loader_func)(const char* function_name,void* user_data),void* user_data);
CIMGUI_API void ImGui_ImplVulkan_Shutdown(void);
CIMGUI_API void ImGui_ImplVulkan_NewFrame(void);
CIMGUI_API void ImGui_ImplVulkan_RemoveTexture(VkDescriptorSet descriptor_set);
CIMGUI_API void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data,VkCommandBuffer command_buffer,VkPipeline pipeline);
CIMGUI_API void ImGui_ImplVulkan_SetMinImageCount(uint32_t min_image_count);
CIMGUI_API void ImGui_ImplVulkan_Shutdown(void);
CIMGUI_API void ImGui_ImplVulkan_UpdateTexture(ImTextureData* tex);
CIMGUI_API VkDescriptorSet ImGui_ImplVulkan_AddTexture(VkSampler sampler,VkImageView image_view,VkImageLayout image_layout);
CIMGUI_API void ImGui_ImplVulkan_RemoveTexture(VkDescriptorSet descriptor_set);
CIMGUI_API bool ImGui_ImplVulkan_LoadFunctions(uint32_t api_version,PFN_vkVoidFunction(*loader_func)(const char* function_name,void* user_data),void* user_data);
CIMGUI_API void ImGui_ImplVulkanH_CreateOrResizeWindow(VkInstance instance,VkPhysicalDevice physical_device,VkDevice device,ImGui_ImplVulkanH_Window* wnd,uint32_t queue_family,const VkAllocationCallbacks* allocator,int w,int h,uint32_t min_image_count);
CIMGUI_API void ImGui_ImplVulkanH_DestroyWindow(VkInstance instance,VkDevice device,ImGui_ImplVulkanH_Window* wnd,const VkAllocationCallbacks* allocator);
CIMGUI_API VkSurfaceFormatKHR ImGui_ImplVulkanH_SelectSurfaceFormat(VkPhysicalDevice physical_device,VkSurfaceKHR surface,const VkFormat* request_formats,int request_formats_count,VkColorSpaceKHR request_color_space);
CIMGUI_API VkPresentModeKHR ImGui_ImplVulkanH_SelectPresentMode(VkPhysicalDevice physical_device,VkSurfaceKHR surface,const VkPresentModeKHR* request_modes,int request_modes_count);
CIMGUI_API VkPhysicalDevice ImGui_ImplVulkanH_SelectPhysicalDevice(VkInstance instance);
CIMGUI_API uint32_t ImGui_ImplVulkanH_SelectQueueFamilyIndex(VkPhysicalDevice physical_device);
CIMGUI_API int ImGui_ImplVulkanH_GetMinImageCountFromPresentMode(VkPresentModeKHR present_mode);
CIMGUI_API ImGui_ImplVulkanH_Window* ImGui_ImplVulkanH_Window_ImGui_ImplVulkanH_Window(void);
#endif
#endif //CIMGUI_IMPL_DEFINED

View File

@@ -49,8 +49,6 @@ struct SDL_Window;
typedef union SDL_Event SDL_Event;
#endif // CIMGUI_DEFINE_ENUMS_AND_STRUCTS
PLACE_STRUCTS_C
#include "auto_funcs.h"
/////////////////////////hand written functions

View File

@@ -1,5 +1,5 @@
local M = {}
local insert = table.insert
local function ToStr(t,dometatables)
local function basicToStr (o)
if type(o) == "number" or type(o)=="boolean" then
@@ -936,7 +936,7 @@ local function itemsCount(items)
print(v,its and #its or 0)
end
end
--adding self argument for struct functions
local function AdjustArguments(FP)
for fun,defs in pairs(FP.defsT) do
--struct function but no constructors or static functions or manuals
@@ -1083,7 +1083,6 @@ local function DefsByStruct(FP)
end
return structs
end
M.DefsByStruct = DefsByStruct
local function get_nonPOD(FP)
local defbystruct = DefsByStruct(FP)
--M.prtable(defbystruct)
@@ -1103,260 +1102,8 @@ local function get_nonPOD(FP)
FP.structs_and_enums_table.nonPOD = nonPOD
return nonPOD
end
local function recur_calc_depth(FP, structs, k,n)
--print("recur_calc_depth",k,n)
local struct = structs[k] or FP.cimgui_inherited.structs[k]
local n1 = n
for i,field in ipairs(struct) do
local typ = field.type:gsub("const ","")
typ = typ:gsub("*","")
if k~=typ and FP.nP_used[typ] then
n1 = math.max(n1,recur_calc_depth(FP, structs, typ,n+1))
end
end
return n1
end
local function gen_structs_c(FP)
local structs = FP.structs_and_enums_table.structs
local nonPOD = FP.structs_and_enums_table.nonPOD
--sort nP_used by dependencies and name
nP_used_sorted = {}
for k,v in pairs(FP.nP_used) do
nP_used_sorted[k] = recur_calc_depth(FP, structs, k, 1)
end
--M.prtable(nP_used_sorted)
local npsorted ={}
for k,n in pairs(nP_used_sorted) do insert(npsorted,k) end
table.sort(npsorted, function(a,b) return (nP_used_sorted[a] < nP_used_sorted[b]) or ((nP_used_sorted[a] == nP_used_sorted[b]) and (a<b)) end)
--M.prtable(npsorted)
--error"DEUG"
----------
local tabs = {}
local tabs_c = {}
--for k,v in pairs(FP.nP_used) do
--M.table_do_sorted(FP.nP_used, function(k,v)
for _,k in ipairs(npsorted) do
if nonPOD[k]~="inherited" then
insert(tabs,"typedef struct "..k.."_c "..k.."_c;")
insert(tabs_c,"typedef struct "..k.."_c "..k..";")
insert(tabs,"struct "..k.."_c {")
local struct = structs[k] or FP.cimgui_inherited.structs[k]
for i,field in ipairs(struct) do
local typ = field.type:gsub("const ","")
typ = typ:gsub("*","")
if FP.nP_used[typ] then
local ftype = field.type:gsub(typ,typ.."_c")
insert(tabs," "..ftype.." "..field.name..";")
else
insert(tabs," "..field.type.." "..field.name..";")
end
end
insert(tabs,"};")
end
end --)
if #tabs > 0 then
insert(tabs,1,"#ifndef CIMGUI_DEFINE_ENUMS_AND_STRUCTS")
insert(tabs,"#endif")
end
if #tabs_c > 0 then
insert(tabs_c,1,"#ifdef CIMGUI_DEFINE_ENUMS_AND_STRUCTS")
insert(tabs_c,"#endif")
end
--print(table.concat(tabs_c,"\n"))
--print(table.concat(tabs,"\n"))
return table.concat(tabs_c,"\n").."\n"..table.concat(tabs,"\n")
--return table.concat(tabs,"\n")
end
local function gen_field_conversion(tab, struct,structs, FP, to,prefix)
--M.prtable("gen_field_conversion",struct)
prefix = prefix or ""
--local structs = FP.structs_and_enums_table.structs
for i,field in ipairs(struct) do
local ftype = field.type:gsub("*","")
if FP.nP_used[field.type] then
gen_field_conversion(tab, structs[field.type],structs,FP, to,prefix..field.name..".")
elseif FP.nP_used[ftype] then
local ftypec = field.type:gsub(ftype,not to and (ftype.."_c") or ftype)
insert(tab, " dest."..prefix..field.name.." = reinterpret_cast<"..ftypec..">(src."..prefix..field.name..");")
else
insert(tab," dest."..prefix..field.name.." = src."..prefix..field.name..";")
end
end
end
local function genConversions(FP)
local structs = FP.structs_and_enums_table.structs
if FP.cimgui_inherited then
structs = {}
for k,v in pairs(FP.cimgui_inherited.structs) do
assert(not structs[k])
structs[k] = v
end
for k,v in pairs(FP.structs_and_enums_table.structs) do
structs[k] = v
end
end
local convers = {}
--for k,v in pairs(FP.nP_used) do
M.table_do_sorted(FP.nP_used, function(k,v)
--print("genConversions",k)
insert(convers,"static inline "..k.." ConvertToCPP_"..k.."(const "..k.."_c& src)")
insert(convers,"{")
insert(convers," "..k.." dest;")
local struct = structs[k]
gen_field_conversion(convers,struct,structs,FP, true)
insert(convers," return dest;")
insert(convers,"}")
insert(convers,"static inline "..k.."_c ConvertFromCPP_"..k.."(const "..k.."& src)")
insert(convers,"{")
insert(convers," "..k.."_c dest;")
local struct = structs[k]
gen_field_conversion(convers,struct,structs,FP, false)
insert(convers," return dest;")
insert(convers,"}")
end)
--print(table.concat(convers,"\n"))
return table.concat(convers,"\n")
end
local function get_nonPODused(FP)
--print("get_nonPODused-----------------------------")
local nonPOD = FP.structs_and_enums_table.nonPOD
if FP.cimgui_inherited then
for k,v in pairs(FP.cimgui_inherited.nonPOD) do
nonPOD[k] = "inherited"
end
end
--M.prtable(nonPOD)
local typeargs = {}
local typeargs_ret = {}
for k,defs in pairs(FP.defsT) do
--print(k)
for i, w in ipairs(defs) do
if not w.templated then --and not w.location:match"internal" then
for ii,arg in ipairs(w.argsT) do
local typ = (arg.type):gsub("&","")
--typ = (typ):gsub("*","")
typ = (typ):gsub("const ","")
if nonPOD[typ] then
--print(arg.type,w.ov_cimguiname,w.location)
typeargs[arg.type] = (arg.type):gsub(typ,typ.."_c")
end
end
local typret = (w.ret or ""):gsub("&","")
--typret = (typret):gsub("*","")
typret = (typret):gsub("const ","")
--print(typret)
if nonPOD[typret] then
--print(w.ret,w.ov_cimguiname,w.location)
typeargs_ret[w.ret] = (w.ret):gsub(typret,typret.."_c")
end
end
end
end
--M.prtable(nonPOD)
local all_type_nP = {}
for k,v in pairs(typeargs) do
local k2 = k:gsub("const ","")
all_type_nP[k2] = nonPOD[k2]--true
end
for k,v in pairs(typeargs_ret) do
local k2 = k:gsub("const ","")
all_type_nP[k2] = nonPOD[k2]--true
end
FP.nP_used = all_type_nP
--M.prtable("FP.nP_used",FP.nP_used)
FP.structs_and_enums_table.nonPOD_used = FP.nP_used
FP.nP_args = typeargs
FP.nP_ret = typeargs_ret
--genConversions(FP)
--M.prtable(typeargs,typeargs_ret,all_type_nP)
-- local typeargs2 = {}
-- for k,v in pairs(typeargs) do table.insert(typeargs2,k) end
-- table.sort(typeargs2)
-- print"------------typeargs2----------------"
-- M.prtable(typeargs2)
-- local typeargs2_ret = {}
-- for k,v in pairs(typeargs_ret) do table.insert(typeargs2_ret,k) end
-- table.sort(typeargs2_ret)
-- print"------------typeargs2_ret----------------"
-- M.prtable(typeargs2_ret)
end
local function header_subs_nonPOD(FP,txt)
--print("----------header_subs_nonPOD")
--M.prtable(FP.nP_used)
for k,v in pairs(FP.nP_used) do
--txt = txt:gsub("([%s;])"..k,"%1"..k.."_c")
for i=1,2 do
txt = txt:gsub("([%s;])"..k.."([%s;%*])", "%1"..k.."_c%2")
end
--txt = txt:gsub("%s"..k..";", " "..k.."_c;")
--txt = txt:gsub("%s"..k.."%*", " "..k.."_c*")
end
return txt
end
M.header_subs_nonPOD = header_subs_nonPOD
local function ADDnonUDT(FP)
local nonPOD = get_nonPOD(FP)
get_nonPODused(FP)
for k,defs in pairs(FP.defsT) do
for i, def in ipairs(defs) do
--ret
local rets = (def.ret or ""):gsub("const ","")
rets = rets:gsub("*","")
if FP.nP_ret[def.ret] then
def.conv = (def.ret):gsub("const ","")
def.ret = FP.nP_ret[def.ret]
def.nonUDT = 1
elseif FP.nP_ret[rets] then
def.ret = def.ret:gsub(rets, FP.nP_ret[rets])
def.nonUDT = 2
end
--args
local caar,asp
if #def.argsT > 0 then
caar = "("
asp = "("
for i,v in ipairs(def.argsT) do
local name = v.name
if v.ret then --function pointer
local f_ = v.has_cdecl and "(__cdecl*" or "(*"
asp = asp .. v.ret .. f_ .. v.name .. ")" .. v.signature .. ","
caar = caar .. name .. ","
else
local typ = v.type:gsub("const ","")
local typ2 = typ:gsub("*","")
if FP.nP_args[v.type] then
caar = caar .. "ConvertToCPP_"..typ.."("..name.."),"
asp = asp .. v.type:gsub(typ,typ.."_c").." "..v.name..","
elseif FP.nP_args[typ2] then
local typ3 = v.type:gsub(typ2,typ2.."_c")
caar = caar .. "reinterpret_cast<"..v.type..">("..name.."),"
asp = asp .. typ3 .." "..v.name..","
else
local siz = v.type:match("(%[%d*%])") or ""
local typ = v.type:gsub("(%[%d*%])","")
asp = asp .. typ .. (v.name~="..." and " "..v.name or "") .. siz .. ","
local callname = v.reftoptr and "*"..name or name
caar = caar .. callname .. ","
end
end
end
caar = caar:sub(1,-2)..")"
asp = asp:sub(1,-2)..")"
else
caar = "()"
asp = "()"
end
def.call_args_old = def.call_args
def.call_args = caar
def.args = asp
end
end
end
local function ADDnonUDT_OLD(FP)
local nonPOD = get_nonPOD(FP)
get_nonPODused(FP)
--print"nonPOD"
--M.prtable(nonPOD)
local defsT = FP.defsT
@@ -1378,7 +1125,6 @@ local function ADDnonUDT_OLD(FP)
if (not isUDT) and FP.cimgui_inherited and FP.cimgui_inherited.nonPOD[defT.ret] then
isUDT = true
end
--given in generator.lua , could be skipped
for _,udt_ret in ipairs(FP.UDTs) do
if udt_ret == defT.ret then isUDT=true; break end
end
@@ -1543,8 +1289,6 @@ function M.Parser()
par.skipped = {}
par.UDTs = {}
par.genConversors = genConversions
par.gen_structs_c = gen_structs_c
function par:insert(line,loca)
--table.insert(cdefs,{line,loca})
--table.insert(cdefs,{line:gsub("^%s*(.-)%s*$", "%1"),loca})
@@ -1599,9 +1343,8 @@ function M.Parser()
function par:do_parse()
self:parseItems()
self:gen_structs_and_enums_table()
self:compute_overloads()
self:gen_structs_and_enums()
--self:compute_overloads()
self:compute_overloads()
--self:compute_templated()
ADDdestructors(self)
end
@@ -1971,30 +1714,6 @@ function M.Parser()
function par:header_text_insert(tab,txt,it)
table.insert(tab, txt)
end
local function function_parse(self,it)
local stname = ""
local namespace
if it.parent then
if it.parent.re_name == "struct_re" or it.parent.re_name == "typedef_st_re" or it.parent.re_name == "class_re" then
stname = it.parent.name
elseif it.parent.re_name == "namespace_re" then
namespace = get_parents_nameC(it) --it.parent.name
end
end
if it.item:match"^%s*template%s+<" then
local ttype,fun = it.item:match"^%s*template%s+<%s*typename%s+([^>]+)%s*>%s*(.+)$"
if self.ftemplate_list and self.ftemplate_list[ttype] then
for iT,vT in ipairs(self.ftemplate_list[ttype]) do
local funT = fun:gsub("([< %(])"..ttype,"%1"..vT)
--funT = funT:gsub("sizeof%("..ttype.."%)","sizeof("..vT..")")
--local funT = fun:gsub(ttype,vT)
self:parseFunction(stname,{item=funT},namespace,it.locat)
end
end
else
self:parseFunction(stname,it,namespace,it.locat)
end
end
function par:gen_structs_and_enums()
print"--------------gen_structs_and_enums"
--M.prtable(self.typenames)
@@ -2101,11 +1820,9 @@ function M.Parser()
if not structname then print("NO NAME",cleanst,it.item) end
--if not void stname or templated
if structname and not self.typenames[structname] then
--dont add typedef to non POD
local tst = ""
--if not self.nP_used[structname] then
tst = "\ntypedef struct "..structname.." "..structname..";"
--end
--table.insert(typedefs_table,"typedef struct "..structname.." "..structname..";\n")
local tst = "\ntypedef struct "..structname.." "..structname..";"
if check_unique_typedefs(tst,uniques) then
--table.insert(outtab,tst)
self:header_text_insert(outtab, tst, it)
@@ -2134,7 +1851,28 @@ function M.Parser()
elseif it.re_name == "namespace_re" or it.re_name == "union_re" or it.re_name == "functype_re" then
--nop
elseif it.re_name == "functionD_re" or it.re_name == "function_re" then
--function_parse(self,it)
local stname = ""
local namespace
if it.parent then
if it.parent.re_name == "struct_re" or it.parent.re_name == "typedef_st_re" or it.parent.re_name == "class_re" then
stname = it.parent.name
elseif it.parent.re_name == "namespace_re" then
namespace = get_parents_nameC(it) --it.parent.name
end
end
if it.item:match"^%s*template%s+<" then
local ttype,fun = it.item:match"^%s*template%s+<%s*typename%s+([^>]+)%s*>%s*(.+)$"
if self.ftemplate_list and self.ftemplate_list[ttype] then
for iT,vT in ipairs(self.ftemplate_list[ttype]) do
local funT = fun:gsub("([< %(])"..ttype,"%1"..vT)
--funT = funT:gsub("sizeof%("..ttype.."%)","sizeof("..vT..")")
--local funT = fun:gsub(ttype,vT)
self:parseFunction(stname,{item=funT},namespace,it.locat)
end
end
else
self:parseFunction(stname,it,namespace,it.locat)
end
else
if it.re_name~="operator_re" then
print("not processed gen",it.re_name,it.item:sub(1,20))
@@ -2154,10 +1892,7 @@ function M.Parser()
--check arg detection failure if no name in function declaration
check_arg_detection(self.defsT,self.typedefs_dict)
local outtabprest, outtabst = table.concat(outtabpre,""),table.concat(outtab,"")
outtabprest = M.header_subs_nonPOD(self,outtabprest)
outtabst = M.header_subs_nonPOD(self,outtabst)
self.structs_and_enums = {outtabprest, outtabst or ""}
return outtabprest, outtabst
end
-----------
@@ -2351,9 +2086,7 @@ function M.Parser()
end
elseif it.re_name == "namespace_re" or it.re_name == "union_re" or it.re_name == "functype_re" then
--nop
elseif it.re_name ~= "functionD_re" or it.re_name ~= "function_re" then
function_parse(self,it)
elseif it.re_name ~= "operator_re" then
elseif it.re_name ~= "functionD_re" and it.re_name ~= "function_re" and it.re_name ~= "operator_re" then
print("not processed gen table",it.re_name)
end
end
@@ -2482,9 +2215,9 @@ function M.Parser()
end)
--print(numoverloaded, "overloaded")
table.insert(strt,string.format("%d overloaded",numoverloaded))
ADDnonUDT(self)
--ADDIMSTR_S(self)
AdjustArguments(self)
--ADDnonUDT(self)
ADDnonUDT(self)
--ADDdestructors(self)
self.overloadstxt = table.concat(strt,"\n")
@@ -2945,15 +2678,12 @@ local function ImGui_f_implementation(def)
table.insert(outtab, "#ifdef CIMGUI_VARGS0\n")
table.insert(outtab, "CIMGUI_API".." "..def.ret.." "..def.ov_cimguiname.."0"..paramListWithoutDots(def.args).."\n")
table.insert(outtab, "{\n")
table.insert(outtab, " return "..def.ov_cimguiname..paramListWithoutDots(def.call_args_old)..";\n")
table.insert(outtab, " return "..def.ov_cimguiname..paramListWithoutDots(def.call_args)..";\n")
table.insert(outtab, "}\n")
table.insert(outtab, "#endif\n")
elseif def.nonUDT then
if def.nonUDT == 1 then
--table.insert(outtab," *pOut = "..namespace..def.funcname..def.call_args..";\n")
insert(outtab," return ConvertFromCPP_"..def.conv.."("..namespace..def.funcname..def.call_args..");\n")
elseif def.nonUDT == 2 then
insert(outtab," return reinterpret_cast<"..def.ret..">("..ptret..namespace..def.funcname..def.call_args..");\n")
table.insert(outtab," *pOut = "..namespace..def.funcname..def.call_args..";\n")
end
table.insert(outtab,"}\n")
else --standard ImGui
@@ -2987,11 +2717,7 @@ local function struct_f_implementation(def)
end
elseif def.nonUDT then
if def.nonUDT == 1 then
--table.insert(outtab," *pOut = self->"..def.funcname..def.call_args..";\n")
--local typret = (def.ret):gsub("const ","")
insert(outtab," return ConvertFromCPP_"..def.conv.."(self->"..def.funcname..def.call_args..");\n")
elseif def.nonUDT == 2 then
insert(outtab," return reinterpret_cast<"..def.ret..">("..ptret.."self->"..def.funcname..def.call_args..");\n")
table.insert(outtab," *pOut = self->"..def.funcname..def.call_args..";\n")
end
else --standard struct
table.insert(outtab," return "..ptret.."self->"..def.funcname..def.call_args..";\n")
@@ -3049,9 +2775,7 @@ local function func_implementation(FP)
end
until true
end
local conversors = FP:genConversors()
local cimplem = conversors .. table.concat(outtab)
return cimplem
return table.concat(outtab)
end
M.func_implementation = func_implementation
@@ -3069,7 +2793,7 @@ M.table_do_sorted = table_do_sorted
local function func_header_generate_structs(FP)
local outtab = {}--"\n/////func_header_generate_structs\n"}
local outtab = {}
table_do_sorted(FP.embeded_structs,function(k,v)
table.insert(outtab,"typedef "..v.." "..k..";\n")
@@ -3087,7 +2811,6 @@ local function func_header_generate_structs(FP)
end
M.func_header_generate_structs = func_header_generate_structs
local function func_header_generate_funcs(FP)
local outtab = {}
@@ -3116,18 +2839,17 @@ local function func_header_generate_funcs(FP)
elseif def.destructor then
table.insert(outtab,"CIMGUI_API void "..def.ov_cimguiname..def.args..";"..addcoment.."\n")
else --not constructor
--local ret = FP.nP_ret[def.ret] or def.ret
local ret = def.ret
if def.stname == "" or def.is_static_function then --ImGui namespace or top level
table.insert(outtab,"CIMGUI_API "..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")
if def.isvararg then
-- For variadic functions we add a function implementation with zero argumets, for compatibility with languages such as C#.
table.insert(outtab, "#ifdef CIMGUI_VARGS0\n")
table.insert(outtab, "CIMGUI_API".." "..ret.." "..def.ov_cimguiname.."0"..paramListWithoutDots(def.args)..";\n")
table.insert(outtab, "CIMGUI_API".." "..def.ret.." "..def.ov_cimguiname.."0"..paramListWithoutDots(def.args)..";\n")
table.insert(outtab, "#endif\n")
end
else
table.insert(outtab,"CIMGUI_API "..ret.." "..def.ov_cimguiname..def.args..";"..addcoment.."\n")
table.insert(outtab,"CIMGUI_API "..def.ret.." "..def.ov_cimguiname..def.args..";"..addcoment.."\n")
end
end
end
@@ -3147,16 +2869,13 @@ M.func_header_generate_funcs = func_header_generate_funcs
local function func_header_generate(FP)
local outtab = func_header_generate_structs(FP)
table.insert(outtab, 1, "\n#ifndef CIMGUI_DEFINE_ENUMS_AND_STRUCTS\n")
table.insert(outtab, 1, "#ifndef CIMGUI_DEFINE_ENUMS_AND_STRUCTS\n")
table.insert(outtab,"#endif //CIMGUI_DEFINE_ENUMS_AND_STRUCTS\n")
local outtabf = func_header_generate_funcs(FP)
outtabf = table.concat(outtabf)
assert(type(outtabf)=="string")
--outtabf = M.header_subs_nonPOD(FP,outtabf)
local cfuncsstr = table.concat(outtab)..outtabf
cfuncsstr = cfuncsstr:gsub("\n+","\n") --several empty lines to one empty line
local cfuncsstr = table.concat(outtab)..table.concat(outtabf)
cfuncsstr = cfuncsstr:gsub("\n+","\n") --several empty lines to one empty line
return cfuncsstr
end

View File

@@ -124,14 +124,10 @@ local function func_header_impl_generate(FP)
local outtab = {}
-- for _,t in ipairs(FP.funcdefs) do
-- if t.cimguiname then
-- local cimf = FP.defsT[t.cimguiname]
-- local def = cimf[t.signature]
--for k,defs in pairs(FP.defsT) do
cpp2ffi.table_do_sorted(FP.defsT, function(i,defs)
if true then
for i, def in ipairs(defs) do
for _,t in ipairs(FP.funcdefs) do
if t.cimguiname then
local cimf = FP.defsT[t.cimguiname]
local def = cimf[t.signature]
local addcoment = def.comment or ""
local empty = def.args:match("^%(%)") --no args
if def.constructor then
@@ -151,11 +147,10 @@ local function func_header_impl_generate(FP)
error("class function in implementations")
end
end
end
else --not cimguiname
table.insert(outtab,t.comment:gsub("%%","%%%%").."\n")-- %% substitution for gsub
end
end)
end
local cfuncsstr = table.concat(outtab)
cfuncsstr = cfuncsstr:gsub("\n+","\n") --several empty lines to one empty line
return cfuncsstr
@@ -186,7 +181,7 @@ local function get_defines(t)
end
pipe:close()
--require"anima.utils"
--cpp2ffi.prtable(defines)
--prtable(defines)
assert(next(defines), table.concat(compiler_output, "\n"))
local ret = {}
for i,v in ipairs(t) do
@@ -277,9 +272,6 @@ local function cimgui_generation(parser)
--------------------------------------------------
local hstrfile = read_data"./cimgui_template.h"
--hstrfile = hstrfile:gsub([[PLACE_STRUCTS_C]],parser:gen_structs_c())
local outpre,outpost = parser.structs_and_enums[1],parser.structs_and_enums[2]
cpp2ffi.prtable(parser.templates)
cpp2ffi.prtable(parser.typenames)
@@ -294,9 +286,6 @@ local function cimgui_generation(parser)
if gdefines.ImDrawCallback_ResetRenderState then
cstructsstr = cstructsstr.."\n#define ImDrawCallback_ResetRenderState "..gdefines.ImDrawCallback_ResetRenderState.."\n"
end
if gdefines.ImTextureID_Invalid then
cstructsstr = cstructsstr.."\n#define ImTextureID_Invalid "..gdefines.ImTextureID_Invalid.."\n"
end
if gdefines.IMGUI_HAS_IMSTR then
if not (NOCHAR or NOIMSTRV) then
cstructsstr = cstructsstr.."\n#define IMGUI_HAS_IMSTR 1\n"
@@ -306,7 +295,6 @@ local function cimgui_generation(parser)
cstructsstr = colapse_defines(cstructsstr, "IMGUI_ENABLE_FREETYPE")
hstrfile = hstrfile:gsub([[#include "imgui_structs%.h"]],cstructsstr)
hstrfile = hstrfile:gsub([[PLACE_STRUCTS_C]],parser:gen_structs_c())
local cfuncsstr = func_header_generate(parser)
cfuncsstr = colapse_defines(cfuncsstr, "IMGUI_ENABLE_FREETYPE")
hstrfile = hstrfile:gsub([[#include "auto_funcs%.h"]],cfuncsstr)
@@ -333,7 +321,7 @@ end
--------------------------------------------------------
--get imgui.h version and IMGUI_HAS_DOCK--------------------------
--defines for the cl compiler must be present in the print_defines.cpp file
gdefines = get_defines{"IMGUI_VERSION","IMGUI_VERSION_NUM","FLT_MAX","FLT_MIN","IMGUI_HAS_DOCK","IMGUI_HAS_IMSTR","ImDrawCallback_ResetRenderState","IMGUI_HAS_TEXTURES","ImTextureID_Invalid"}
gdefines = get_defines{"IMGUI_VERSION","IMGUI_VERSION_NUM","FLT_MAX","FLT_MIN","IMGUI_HAS_DOCK","IMGUI_HAS_IMSTR","ImDrawCallback_ResetRenderState","IMGUI_HAS_TEXTURES"}
cpp2ffi.prtable(gdefines)
if gdefines.IMGUI_HAS_DOCK then gdefines.IMGUI_HAS_DOCK = true end
if gdefines.IMGUI_HAS_IMSTR then gdefines.IMGUI_HAS_IMSTR = true end
@@ -437,7 +425,6 @@ local structs_and_enums_table = parser1.structs_and_enums_table
structs_and_enums_table.templated_structs = parser1.templated_structs
structs_and_enums_table.typenames = parser1.typenames
structs_and_enums_table.templates_done = parser1.templates_done
--structs_and_enums_table.nonPOD_used = parser1.nP_used
save_data("./output/structs_and_enums.lua",serializeTableF(structs_and_enums_table))
save_data("./output/typedefs_dict.lua",serializeTableF(parser1.typedefs_dict))

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

File diff suppressed because it is too large Load Diff

View File

@@ -114,13 +114,17 @@ igCombo 3
1 bool igCombo_Str_arr (const char*,int*,const char* const[],int,int)
2 bool igCombo_Str (const char*,int*,const char*,int)
3 bool igCombo_FnStrPtr (const char*,int*,const char*(*)(void*,int),void*,int,int)
igGetBackgroundDrawList 2
1 ImDrawList* igGetBackgroundDrawList_Nil ()
2 ImDrawList* igGetBackgroundDrawList_ViewportPtr (ImGuiViewport*)
igGetColorU32 3
1 ImU32 igGetColorU32_Col (ImGuiCol,float)
2 ImU32 igGetColorU32_Vec4 (const ImVec4)
3 ImU32 igGetColorU32_U32 (ImU32,float)
igGetForegroundDrawList 2
1 ImDrawList* igGetForegroundDrawList_ViewportPtr (ImGuiViewport*)
igGetForegroundDrawList 3
1 ImDrawList* igGetForegroundDrawList_Nil ()
2 ImDrawList* igGetForegroundDrawList_WindowPtr (ImGuiWindow*)
3 ImDrawList* igGetForegroundDrawList_ViewportPtr (ImGuiViewport*)
igGetID 4
1 ImGuiID igGetID_Str (const char*)
2 ImGuiID igGetID_StrStr (const char*,const char*)
@@ -305,4 +309,4 @@ igValue 4
2 void igValue_Int (const char*,int)
3 void igValue_Uint (const char*,unsigned int)
4 void igValue_Float (const char*,float,const char*)
213 overloaded
216 overloaded

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -15,7 +15,6 @@
"ImDrawListFlags": "int",
"ImDrawListSharedData": "struct ImDrawListSharedData",
"ImDrawListSplitter": "struct ImDrawListSplitter",
"ImDrawTextFlags": "int",
"ImDrawVert": "struct ImDrawVert",
"ImFileHandle": "FILE*",
"ImFont": "struct ImFont",
@@ -48,20 +47,13 @@
"ImGuiContext": "struct ImGuiContext",
"ImGuiContextHook": "struct ImGuiContextHook",
"ImGuiContextHookCallback": "void (*)(ImGuiContext* ctx, ImGuiContextHook* hook);",
"ImGuiDataAuthority": "int",
"ImGuiDataType": "int",
"ImGuiDataTypeInfo": "struct ImGuiDataTypeInfo",
"ImGuiDataTypeStorage": "struct ImGuiDataTypeStorage",
"ImGuiDeactivatedItemData": "struct ImGuiDeactivatedItemData",
"ImGuiDebugAllocEntry": "struct ImGuiDebugAllocEntry",
"ImGuiDebugAllocInfo": "struct ImGuiDebugAllocInfo",
"ImGuiDebugItemPathQuery": "struct ImGuiDebugItemPathQuery",
"ImGuiDebugLogFlags": "int",
"ImGuiDockContext": "struct ImGuiDockContext",
"ImGuiDockNode": "struct ImGuiDockNode",
"ImGuiDockNodeFlags": "int",
"ImGuiDockNodeSettings": "struct ImGuiDockNodeSettings",
"ImGuiDockRequest": "struct ImGuiDockRequest",
"ImGuiDragDropFlags": "int",
"ImGuiErrorCallback": "void (*)(ImGuiContext* ctx, void* user_data, const char* msg);",
"ImGuiErrorRecoveryState": "struct ImGuiErrorRecoveryState",
@@ -79,7 +71,6 @@
"ImGuiInputEventKey": "struct ImGuiInputEventKey",
"ImGuiInputEventMouseButton": "struct ImGuiInputEventMouseButton",
"ImGuiInputEventMousePos": "struct ImGuiInputEventMousePos",
"ImGuiInputEventMouseViewport": "struct ImGuiInputEventMouseViewport",
"ImGuiInputEventMouseWheel": "struct ImGuiInputEventMouseWheel",
"ImGuiInputEventText": "struct ImGuiInputEventText",
"ImGuiInputFlags": "int",
@@ -101,7 +92,6 @@
"ImGuiLayoutType": "int",
"ImGuiListClipper": "struct ImGuiListClipper",
"ImGuiListClipperData": "struct ImGuiListClipperData",
"ImGuiListClipperFlags": "int",
"ImGuiListClipperRange": "struct ImGuiListClipperRange",
"ImGuiLocEntry": "struct ImGuiLocEntry",
"ImGuiLogFlags": "int",
@@ -129,7 +119,6 @@
"ImGuiPayload": "struct ImGuiPayload",
"ImGuiPlatformIO": "struct ImGuiPlatformIO",
"ImGuiPlatformImeData": "struct ImGuiPlatformImeData",
"ImGuiPlatformMonitor": "struct ImGuiPlatformMonitor",
"ImGuiPopupData": "struct ImGuiPopupData",
"ImGuiPopupFlags": "int",
"ImGuiPtrOrIndex": "struct ImGuiPtrOrIndex",
@@ -188,9 +177,6 @@
"ImGuiViewportFlags": "int",
"ImGuiViewportP": "struct ImGuiViewportP",
"ImGuiWindow": "struct ImGuiWindow",
"ImGuiWindowBgClickFlags": "int",
"ImGuiWindowClass": "struct ImGuiWindowClass",
"ImGuiWindowDockStyle": "struct ImGuiWindowDockStyle",
"ImGuiWindowFlags": "int",
"ImGuiWindowRefreshFlags": "int",
"ImGuiWindowSettings": "struct ImGuiWindowSettings",

View File

@@ -15,7 +15,6 @@ local t={
ImDrawListFlags="int",
ImDrawListSharedData="struct ImDrawListSharedData",
ImDrawListSplitter="struct ImDrawListSplitter",
ImDrawTextFlags="int",
ImDrawVert="struct ImDrawVert",
ImFileHandle="FILE*",
ImFont="struct ImFont",
@@ -48,20 +47,13 @@ local t={
ImGuiContext="struct ImGuiContext",
ImGuiContextHook="struct ImGuiContextHook",
ImGuiContextHookCallback="void (*)(ImGuiContext* ctx, ImGuiContextHook* hook);",
ImGuiDataAuthority="int",
ImGuiDataType="int",
ImGuiDataTypeInfo="struct ImGuiDataTypeInfo",
ImGuiDataTypeStorage="struct ImGuiDataTypeStorage",
ImGuiDeactivatedItemData="struct ImGuiDeactivatedItemData",
ImGuiDebugAllocEntry="struct ImGuiDebugAllocEntry",
ImGuiDebugAllocInfo="struct ImGuiDebugAllocInfo",
ImGuiDebugItemPathQuery="struct ImGuiDebugItemPathQuery",
ImGuiDebugLogFlags="int",
ImGuiDockContext="struct ImGuiDockContext",
ImGuiDockNode="struct ImGuiDockNode",
ImGuiDockNodeFlags="int",
ImGuiDockNodeSettings="struct ImGuiDockNodeSettings",
ImGuiDockRequest="struct ImGuiDockRequest",
ImGuiDragDropFlags="int",
ImGuiErrorCallback="void (*)(ImGuiContext* ctx, void* user_data, const char* msg);",
ImGuiErrorRecoveryState="struct ImGuiErrorRecoveryState",
@@ -79,7 +71,6 @@ local t={
ImGuiInputEventKey="struct ImGuiInputEventKey",
ImGuiInputEventMouseButton="struct ImGuiInputEventMouseButton",
ImGuiInputEventMousePos="struct ImGuiInputEventMousePos",
ImGuiInputEventMouseViewport="struct ImGuiInputEventMouseViewport",
ImGuiInputEventMouseWheel="struct ImGuiInputEventMouseWheel",
ImGuiInputEventText="struct ImGuiInputEventText",
ImGuiInputFlags="int",
@@ -101,7 +92,6 @@ local t={
ImGuiLayoutType="int",
ImGuiListClipper="struct ImGuiListClipper",
ImGuiListClipperData="struct ImGuiListClipperData",
ImGuiListClipperFlags="int",
ImGuiListClipperRange="struct ImGuiListClipperRange",
ImGuiLocEntry="struct ImGuiLocEntry",
ImGuiLogFlags="int",
@@ -129,7 +119,6 @@ local t={
ImGuiPayload="struct ImGuiPayload",
ImGuiPlatformIO="struct ImGuiPlatformIO",
ImGuiPlatformImeData="struct ImGuiPlatformImeData",
ImGuiPlatformMonitor="struct ImGuiPlatformMonitor",
ImGuiPopupData="struct ImGuiPopupData",
ImGuiPopupFlags="int",
ImGuiPtrOrIndex="struct ImGuiPtrOrIndex",
@@ -188,9 +177,6 @@ local t={
ImGuiViewportFlags="int",
ImGuiViewportP="struct ImGuiViewportP",
ImGuiWindow="struct ImGuiWindow",
ImGuiWindowBgClickFlags="int",
ImGuiWindowClass="struct ImGuiWindowClass",
ImGuiWindowDockStyle="struct ImGuiWindowDockStyle",
ImGuiWindowFlags="int",
ImGuiWindowRefreshFlags="int",
ImGuiWindowSettings="struct ImGuiWindowSettings",

View File

@@ -35,7 +35,3 @@
#ifdef IMGUI_HAS_TEXTURES
#pragma message(CIMGUI_DEFSTRING(IMGUI_HAS_TEXTURES))
#endif
#ifdef ImTextureID_Invalid
#pragma message(CIMGUI_DEFSTRING(ImTextureID_Invalid))
#endif

2
imgui

Submodule imgui updated: 3912b3d9a9...5d4126876b

View File

@@ -34,7 +34,6 @@ int main(void)
display_size.x = 1920;
display_size.y = 1080;
io->DisplaySize = display_size;
printf("DisplaySice %f, %f\n", io->DisplaySize.x, io->DisplaySize.y);
io->DeltaTime = 1.0f / 60.0f;
igNewFrame();