Compare commits

..

4 Commits

16 changed files with 4561 additions and 4227 deletions

View File

@@ -11,7 +11,7 @@ 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) 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: Notes:
* currently this wrapper is based on version [1.91.7 of Dear ImGui with internal api] * currently this wrapper is based on version [1.91.8 of Dear ImGui with internal api]
* only functions, structs and enums from imgui.h (an optionally imgui_internal.h) are wrapped. * 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. * 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. * 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.

View File

@@ -22,8 +22,6 @@ else()
endif() endif()
include_directories(../../imgui) include_directories(../../imgui)
add_definitions("-DIMGUI_USER_CONFIG=\"../cimconfig.h\"")
add_definitions("-DIMGUI_DISABLE_OBSOLETE_FUNCTIONS=1")
include_directories(../../) include_directories(../../)
set(IMGUI_SOURCES set(IMGUI_SOURCES
@@ -38,11 +36,7 @@ ${TABLES_SOURCE}
set(IMGUI_SOURCES_sdl) set(IMGUI_SOURCES_sdl)
set(IMGUI_LIBRARIES ) set(IMGUI_LIBRARIES )
if (WIN32)
add_definitions("-DIMGUI_IMPL_API=extern \"C\" __declspec\(dllexport\)")
else(WIN32)
add_definitions("-DIMGUI_IMPL_API=extern \"C\" ")
endif(WIN32)
add_compile_definitions("IMGUI_IMPL_OPENGL_LOADER_GL3W") add_compile_definitions("IMGUI_IMPL_OPENGL_LOADER_GL3W")
@@ -66,40 +60,41 @@ else(WIN32)#Unix
endif(WIN32) endif(WIN32)
#sdl2
list(APPEND IMGUI_SOURCES ${BAKENDS_FOLDER}imgui_impl_sdl2.cpp) list(APPEND IMGUI_SOURCES ${BAKENDS_FOLDER}imgui_impl_sdl2.cpp)
if(DEFINED SDL_PATH) include(FetchContent)
message(STATUS "SDL_PATH defined as " ${SDL_PATH}) Set(FETCHCONTENT_QUIET FALSE)
FIND_PACKAGE(SDL2 PATHS ${SDL_PATH})
else(DEFINED SDL_PATH)
# If SDL_PATH is not set, fallback and attempt to find SDL cmake script at a default location
find_package(SDL2)
endif(DEFINED SDL_PATH)
if(SDL2_FOUND) FetchContent_Declare(
get_target_property(SDL_INCLUDE SDL2::SDL2 INTERFACE_INCLUDE_DIRECTORIES) SDL2
message(STATUS "sdlinclude is " ${SDL_INCLUDE}) GIT_REPOSITORY https://github.com/libsdl-org/SDL.git
if ("${SDL_INCLUDE}" STREQUAL "" OR "${SDL_INCLUDE}" STREQUAL "SDL_INCLUDE-NOTFOUND") #if not found latest SDL2 cmake config use older GIT_TAG release-2.30.12
message(STATUS "sdlinclude2 is " ${SDL2_INCLUDE_DIRS}) #GIT_SHALLOW TRUE
include_directories(${SDL2_INCLUDE_DIRS}) GIT_PROGRESS TRUE
set(IMGUI_SDL_LIBRARY ${SDL2_LIBRARIES}) )
message(STATUS IMGUI_SDL_LIBRARY ${SDL2_LIBRARIES}) #FetchContent_MakeAvailable(SDL2)
else()#use new one SDL2 config FetchContent_GetProperties(SDL2)
include_directories(${SDL_INCLUDE}) if (NOT sdl2_POPULATED)
set(IMGUI_SDL_LIBRARY SDL2::SDL2) set(FETCHCONTENT_QUIET NO)
set(SDL_MAIN SDL2::SDL2main) FetchContent_Populate(SDL2)
message(STATUS ${SDL_MAIN} ${IMGUI_SDL_LIBRARY}) set(SDL_TEST OFF CACHE BOOL "" FORCE)
endif() set(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE)
else(SDL2_FOUND) add_subdirectory(${sdl2_SOURCE_DIR} ${sdl2_BINARY_DIR})
if(DEFINED SDL_PATH) endif()
message(FATAL_ERROR "Cannot find SDL at SDL_PATH") include_directories(${SDL2_SOURCE_DIR}/include})
else(DEFINED SDL_PATH)
message(FATAL_ERROR "Cannot find SDL. Maybe try specifying SDL_PATH?") #if dynamic SDL2 then install
endif(DEFINED SDL_PATH) install(TARGETS SDL2 RUNTIME DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
endif(SDL2_FOUND) LIBRARY DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
)
add_library(cimgui_sdl SHARED ${IMGUI_SOURCES}) add_library(cimgui_sdl SHARED ${IMGUI_SOURCES})
target_link_libraries(cimgui_sdl ${IMGUI_LIBRARIES} ${IMGUI_SDL_LIBRARY}) target_compile_definitions(cimgui_sdl PUBLIC "-DIMGUI_DISABLE_OBSOLETE_FUNCTIONS=1")
if (WIN32)
target_compile_definitions(cimgui_sdl PUBLIC "-DIMGUI_IMPL_API=extern \"C\" __declspec\(dllexport\)")
else(WIN32)
target_compile_definitions(cimgui_sdl PUBLIC "-DIMGUI_IMPL_API=extern \"C\" ")
endif(WIN32)
target_link_libraries(cimgui_sdl ${IMGUI_LIBRARIES} SDL2)
#using library #using library
include_directories(../../generator/output/) include_directories(../../generator/output/)
@@ -108,5 +103,4 @@ target_compile_definitions(test_sdl PUBLIC -DCIMGUI_USE_OPENGL3 -DCIMGUI_USE_SDL
if (MINGW) if (MINGW)
target_link_options(test_sdl PRIVATE "-mconsole") target_link_options(test_sdl PRIVATE "-mconsole")
endif() endif()
target_link_libraries(test_sdl ${IMGUI_SDL_LIBRARY} cimgui_sdl) target_link_libraries(test_sdl SDL2 cimgui_sdl)

View File

@@ -0,0 +1,2 @@
To build use `cmake path_to_example_sdl_opengl3` and then `make install`

View File

@@ -19,8 +19,7 @@ else()
endif() endif()
include_directories(../../imgui) include_directories(../../imgui)
add_definitions("-DIMGUI_USER_CONFIG=\"../cimconfig.h\"")
add_definitions("-DIMGUI_DISABLE_OBSOLETE_FUNCTIONS=1")
include_directories(../../) include_directories(../../)
set(IMGUI_SOURCES ../../cimgui.cpp set(IMGUI_SOURCES ../../cimgui.cpp
@@ -34,11 +33,6 @@ ${TABLES_SOURCE}
set(IMGUI_SOURCES_sdl) set(IMGUI_SOURCES_sdl)
set(IMGUI_LIBRARIES ) set(IMGUI_LIBRARIES )
if (WIN32)
add_definitions("-DIMGUI_IMPL_API=extern \"C\" __declspec\(dllexport\)")
else(WIN32)
add_definitions("-DIMGUI_IMPL_API=extern \"C\" ")
endif(WIN32)
#optional adding freetype #optional adding freetype
option(IMGUI_FREETYPE "add Freetype2" OFF) option(IMGUI_FREETYPE "add Freetype2" OFF)
@@ -54,41 +48,45 @@ endif(IMGUI_FREETYPE)
find_package(Vulkan REQUIRED FATAL_ERROR) find_package(Vulkan REQUIRED FATAL_ERROR)
list(APPEND IMGUI_LIBRARIES Vulkan::Vulkan) list(APPEND IMGUI_LIBRARIES Vulkan::Vulkan)
list(APPEND IMGUI_SOURCES ${BACKENDS_FOLDER}imgui_impl_vulkan.cpp) list(APPEND IMGUI_SOURCES ${BACKENDS_FOLDER}imgui_impl_vulkan.cpp)
include_directories(${Vulkan_INCLUDE_DIRS})
#sdl2 #sdl2
list(APPEND IMGUI_SOURCES ${BACKENDS_FOLDER}imgui_impl_sdl2.cpp) list(APPEND IMGUI_SOURCES ${BACKENDS_FOLDER}imgui_impl_sdl2.cpp)
if(DEFINED SDL_PATH) include(FetchContent)
message(STATUS "SDL_PATH defined as " ${SDL_PATH}) Set(FETCHCONTENT_QUIET FALSE)
FIND_PACKAGE(SDL2 PATHS ${SDL_PATH})
else(DEFINED SDL_PATH)
# If SDL_PATH is not set, fallback and attempt to find SDL cmake script at a default location
find_package(SDL2)
endif(DEFINED SDL_PATH)
if(SDL2_FOUND) FetchContent_Declare(
get_target_property(SDL_INCLUDE SDL2::SDL2 INTERFACE_INCLUDE_DIRECTORIES) SDL2
message(STATUS "sdlinclude is " ${SDL_INCLUDE}) GIT_REPOSITORY https://github.com/libsdl-org/SDL.git
if ("${SDL_INCLUDE}" STREQUAL "" OR "${SDL_INCLUDE}" STREQUAL "SDL_INCLUDE-NOTFOUND") #if not found latest SDL2 cmake config use older GIT_TAG release-2.30.12
message(STATUS "sdlinclude2 is " ${SDL2_INCLUDE_DIRS}) #GIT_SHALLOW TRUE
include_directories(${SDL2_INCLUDE_DIRS}) GIT_PROGRESS TRUE
set(IMGUI_SDL_LIBRARY ${SDL2_LIBRARIES}) )
message(STATUS IMGUI_SDL_LIBRARY ${SDL2_LIBRARIES}) FetchContent_GetProperties(SDL2)
else()#use new one SDL2 config if (NOT sdl2_POPULATED)
include_directories(${SDL_INCLUDE}) set(FETCHCONTENT_QUIET NO)
set(IMGUI_SDL_LIBRARY SDL2::SDL2) FetchContent_Populate(SDL2)
set(SDL_MAIN SDL2::SDL2main) set(SDL_TEST OFF CACHE BOOL "" FORCE)
message(STATUS ${SDL_MAIN} ${IMGUI_SDL_LIBRARY}) set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
endif() add_subdirectory(${sdl2_SOURCE_DIR} ${sdl2_BINARY_DIR})
else(SDL2_FOUND) endif()
if(DEFINED SDL_PATH) include_directories(${SDL2_SOURCE_DIR}/include)
message(FATAL_ERROR "Cannot find SDL at SDL_PATH")
else(DEFINED SDL_PATH)
message(FATAL_ERROR "Cannot find SDL. Maybe try specifying SDL_PATH?")
endif(DEFINED SDL_PATH)
endif(SDL2_FOUND)
add_library(cimgui_sdl SHARED ${IMGUI_SOURCES})
target_link_libraries(cimgui_sdl ${IMGUI_LIBRARIES} ${IMGUI_SDL_LIBRARY}) #if dynamic SDL2 then install
# install(TARGETS SDL2 RUNTIME DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
# LIBRARY DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
# )
add_library(cimgui_sdl STATIC ${IMGUI_SOURCES})
target_compile_definitions(cimgui_sdl PUBLIC "-DIMGUI_USER_CONFIG=\"../cimconfig.h\"")
target_compile_definitions(cimgui_sdl PUBLIC "-DIMGUI_DISABLE_OBSOLETE_FUNCTIONS=1")
if (WIN32)
target_compile_definitions(cimgui_sdl PUBLIC "-DIMGUI_IMPL_API=extern \"C\" __declspec\(dllexport\)")
else(WIN32)
target_compile_definitions(cimgui_sdl PUBLIC "-DIMGUI_IMPL_API=extern \"C\" ")
endif(WIN32)
#target_link_libraries(cimgui_sdl ${IMGUI_LIBRARIES} SDL2-static)
#using library #using library
include_directories(../../generator/output/) include_directories(../../generator/output/)
@@ -97,5 +95,5 @@ target_compile_definitions(test_sdl PUBLIC -DCIMGUI_USE_VULKAN -DCIMGUI_USE_SDL2
if (MINGW) if (MINGW)
target_link_options(test_sdl PRIVATE "-mconsole") target_link_options(test_sdl PRIVATE "-mconsole")
endif() endif()
target_link_libraries(test_sdl ${IMGUI_SDL_LIBRARY} cimgui_sdl) target_link_libraries(test_sdl SDL2-static cimgui_sdl ${IMGUI_LIBRARIES})

View File

@@ -0,0 +1,3 @@
This example needs vulkan generation before compilation: Vulkan SDK should be installed and then add "vulkan" to generator.bat and generate.
To build use `cmake path_to_example_sdl_vulkan` and then `make install`

View File

@@ -1,13 +1,19 @@
#include <stdio.h> #include <stdio.h> // printf, fprintf
#include <stdlib.h> // abort
#include <assert.h> #include <assert.h>
#define SDL_MAIN_HANDLED #define SDL_MAIN_HANDLED
#include <SDL.h> #include <SDL.h>
#include <SDL_vulkan.h> #include <SDL_vulkan.h>
#include <vulkan/vulkan.h> #include <vulkan/vulkan.h>
#ifdef _MSC_VER // Volk headers
#include <windows.h> #ifdef IMGUI_IMPL_VULKAN_USE_VOLK
#define VOLK_IMPLEMENTATION
#include <volk.h>
#endif #endif
//this must be equal to that in imgui_impl_vulkan.h
#define IMGUI_IMPL_VULKAN_MINIMUM_IMAGE_SAMPLER_POOL_SIZE (1) // Minimum per atlas
#define CIMGUI_DEFINE_ENUMS_AND_STRUCTS #define CIMGUI_DEFINE_ENUMS_AND_STRUCTS
#include "cimgui.h" #include "cimgui.h"
#include "cimgui_impl.h" #include "cimgui_impl.h"
@@ -24,6 +30,12 @@
#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))))
//#define APP_USE_UNLIMITED_FRAME_RATE
#ifdef _DEBUG
#define APP_USE_VULKAN_DEBUG_REPORT
#endif
#define APP_USE_VULKAN_DEBUG_REPORT
// Data
static VkAllocationCallbacks* g_Allocator = NULL; static VkAllocationCallbacks* g_Allocator = NULL;
static VkInstance g_Instance = VK_NULL_HANDLE; static VkInstance g_Instance = VK_NULL_HANDLE;
static VkPhysicalDevice g_PhysicalDevice = VK_NULL_HANDLE; static VkPhysicalDevice g_PhysicalDevice = VK_NULL_HANDLE;
@@ -40,172 +52,188 @@ static bool g_SwapChainRebuild = false;
static void check_vk_result(VkResult err) static void check_vk_result(VkResult err)
{ {
if (err == 0) if (err == VK_SUCCESS)
return; return;
fprintf(stderr, "[vulkan] Error: VkResult = %d\n", err); fprintf(stderr, "[vulkan] Error: VkResult = %d\n", err);
if (err < 0) if (err < 0)
abort(); abort();
} }
#ifdef IMGUI_VULKAN_DEBUG_REPORT static void check_vk_result_line(VkResult err,int line)
static VKAPI_ATTR VkBool32 VKAPI_CALL debug_report(VkDebugReportFlagsEXT flags,
VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location,
int32_t messageCode, const char* pLayerPrefix, const char* pMessage, void* pUserData)
{ {
(void)flags; (void)object; (void)location; (void)messageCode; if (err == VK_SUCCESS)
(void)pUserData; (void)pLayerPrefix; // Unused arguments return;
fprintf(stderr, "[vulkan] Debug report from ObjectType: %i\nMessage: %s\n\n", fprintf(stderr, "[vulkan] Error: VkResult = %d in line: (%d)\n", err, line);
objectType, pMessage); if (err < 0)
abort();
}
#ifdef APP_USE_VULKAN_DEBUG_REPORT
static VKAPI_ATTR VkBool32 VKAPI_CALL debug_report(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage, void* pUserData)
{
(void)flags; (void)object; (void)location; (void)messageCode; (void)pUserData; (void)pLayerPrefix; // Unused arguments
fprintf(stderr, "[vulkan] Debug report from ObjectType: %i\nMessage: %s\n\n", objectType, pMessage);
return VK_FALSE; return VK_FALSE;
} }
#endif // IMGUI_VULKAN_DEBUG_REPORT #endif // APP_USE_VULKAN_DEBUG_REPORT
//*
static bool IsExtensionAvailable(VkExtensionProperties* properties, uint32_t properties_count, const char* extension)
{
for(uint32_t i = 0 ; i < properties_count; i++){
if (strcmp(properties[i].extensionName, extension) == 0)
return true;
}
return false;
}
static void SetupVulkan(const char** extensions, uint32_t extensions_count) static void SetupVulkan(const char** extensions, uint32_t extensions_count)
{ {
VkResult err; VkResult err;
#ifdef IMGUI_IMPL_VULKAN_USE_VOLK
// Create Vulkan Instance volkInitialize();
VkInstanceCreateInfo inst_create_info = {
.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
.enabledExtensionCount = extensions_count,
.ppEnabledExtensionNames = extensions,
};
#ifdef IMGUI_VULKAN_DEBUG_REPORT
// Enabling validation layers
const char* layers[] = { "VK_LAYER_KHRONOS_validation" };
inst_create_info.enabledLayerCount = 1;
inst_create_info.ppEnabledLayerNames = layers;
// Enable debug report extension (we need additional storage, so we duplicate the user array to add our new extension to it)
const char** extensions_ext = (const char**)malloc(
sizeof(const char*) * (extensions_count + 1));
memcpy(extensions_ext, extensions, extensions_count * sizeof(const char*));
extensions_ext[extensions_count] = "VK_EXT_debug_report";
inst_create_info.enabledExtensionCount = extensions_count + 1;
inst_create_info.ppEnabledExtensionNames = extensions_ext;
// Create Vulkan Instance
err = vkCreateInstance(&inst_create_info, g_Allocator, &g_Instance);
check_vk_result(err);
free(extensions_ext);
// Get the function pointer (required for any extensions)
PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallbackEXT =
(PFN_vkCreateDebugReportCallbackEXT)vkGetInstanceProcAddr(g_Instance,
"vkCreateDebugReportCallbackEXT");
IM_ASSERT(vkCreateDebugReportCallbackEXT != NULL);
// Setup the debug report callback
VkDebugReportCallbackCreateInfoEXT debug_report_ci = {
.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT,
.flags = VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT |
VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT,
.pfnCallback = debug_report,
.pUserData = NULL,
};
err = vkCreateDebugReportCallbackEXT(g_Instance, &debug_report_ci, g_Allocator,
&g_DebugReport);
check_vk_result(err);
#else
// Create Vulkan Instance without any debug feature
err = vkCreateInstance(&inst_create_info, g_Allocator, &g_Instance);
check_vk_result(err);
IM_UNUSED(g_DebugReport);
#endif #endif
// Select GPU // Create Vulkan Instance
uint32_t gpu_count;
err = vkEnumeratePhysicalDevices(g_Instance, &gpu_count, NULL);
check_vk_result(err);
IM_ASSERT(gpu_count > 0);
VkPhysicalDevice* gpus = (VkPhysicalDevice*)malloc(sizeof(VkPhysicalDevice) * gpu_count);
err = vkEnumeratePhysicalDevices(g_Instance, &gpu_count, gpus);
check_vk_result(err);
// If a number >1 of GPUs got reported, find discrete GPU if present, or use first one available. This covers
// most common cases (multi-gpu/integrated+dedicated graphics). Handling more complicated setups (multiple
// dedicated GPUs) is out of scope of this sample.
int use_gpu = 0;
for (int i = 0; i < (int)gpu_count; i++)
{ {
VkPhysicalDeviceProperties properties; VkInstanceCreateInfo create_info = {};
vkGetPhysicalDeviceProperties(gpus[i], &properties); create_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
if (properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU)
// Enumerate available extensions
uint32_t properties_count;
vkEnumerateInstanceExtensionProperties(NULL, &properties_count, NULL);
VkExtensionProperties* properties = (VkExtensionProperties*)malloc(properties_count * sizeof(VkExtensionProperties));
err = vkEnumerateInstanceExtensionProperties(NULL, &properties_count, properties);
check_vk_result_line(err, __LINE__);
// Enable required extensions
if (IsExtensionAvailable(properties, properties_count, VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME)){
//instance_extensions.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
extensions_count++;
extensions = realloc(extensions, extensions_count * sizeof(char*));
assert(extensions);
extensions[extensions_count-1] = VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME;
}
#ifdef VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME
if (IsExtensionAvailable(properties, properties_count, VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME))
{ {
use_gpu = i; //instance_extensions.push_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME);
break; extensions_count++;
extensions = realloc(extensions, extensions_count * sizeof(char*));
assert(extensions);
extensions[extensions_count-1] = VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME;
create_info.flags |= VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR;
} }
#endif
free(properties);
// Enabling validation layers
#ifdef APP_USE_VULKAN_DEBUG_REPORT
const char* layers[] = { "VK_LAYER_KHRONOS_validation" };
create_info.enabledLayerCount = 1;
create_info.ppEnabledLayerNames = layers;
//instance_extensions.push_back("VK_EXT_debug_report");
extensions_count++;
extensions = realloc(extensions, extensions_count * sizeof(char*));
assert(extensions);
extensions[extensions_count-1] = "VK_EXT_debug_report";
#endif
// Create Vulkan Instance
create_info.enabledExtensionCount = extensions_count;//(uint32_t)instance_extensions.Size;
create_info.ppEnabledExtensionNames = extensions;//instance_extensions.Data;
err = vkCreateInstance(&create_info, g_Allocator, &g_Instance);
check_vk_result_line(err, __LINE__);
#ifdef IMGUI_IMPL_VULKAN_USE_VOLK
volkLoadInstance(g_Instance);
#endif
// Setup the debug report callback
#ifdef APP_USE_VULKAN_DEBUG_REPORT
PFN_vkCreateDebugReportCallbackEXT f_vkCreateDebugReportCallbackEXT = (PFN_vkCreateDebugReportCallbackEXT)vkGetInstanceProcAddr(g_Instance, "vkCreateDebugReportCallbackEXT");
IM_ASSERT(f_vkCreateDebugReportCallbackEXT != NULL);
VkDebugReportCallbackCreateInfoEXT debug_report_ci = {};
debug_report_ci.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT;
debug_report_ci.flags = VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT | VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT;
debug_report_ci.pfnCallback = debug_report;
debug_report_ci.pUserData = NULL;
err = f_vkCreateDebugReportCallbackEXT(g_Instance, &debug_report_ci, g_Allocator, &g_DebugReport);
check_vk_result_line(err, __LINE__);
#endif
} }
// Select Physical Device (GPU)
g_PhysicalDevice = gpus[use_gpu]; g_PhysicalDevice = ImGui_ImplVulkanH_SelectPhysicalDevice(g_Instance);
free(gpus); IM_ASSERT(g_PhysicalDevice != VK_NULL_HANDLE);
// Select graphics queue family // Select graphics queue family
uint32_t count; g_QueueFamily = ImGui_ImplVulkanH_SelectQueueFamilyIndex(g_PhysicalDevice);
vkGetPhysicalDeviceQueueFamilyProperties(g_PhysicalDevice, &count, NULL);
VkQueueFamilyProperties* queues = (VkQueueFamilyProperties*)malloc(
sizeof(VkQueueFamilyProperties) * count);
vkGetPhysicalDeviceQueueFamilyProperties(g_PhysicalDevice, &count, queues);
for (uint32_t i = 0; i < count; i++)
if (queues[i].queueFlags & VK_QUEUE_GRAPHICS_BIT)
{
g_QueueFamily = i;
break;
}
free(queues);
IM_ASSERT(g_QueueFamily != (uint32_t)-1); IM_ASSERT(g_QueueFamily != (uint32_t)-1);
// Create Logical Device (with 1 queue) // Create Logical Device (with 1 queue)
int device_extension_count = 1; {
const char* device_extensions[] = { "VK_KHR_swapchain" }; //ImVector<const char*> device_extensions;
//device_extensions.push_back("VK_KHR_swapchain");
uint32_t device_extensions_count = 1;
const char** device_extensions = (const char**)malloc(device_extensions_count * sizeof(char*));
device_extensions[0] = "VK_KHR_swapchain";
// Enumerate physical device extension
uint32_t properties_count;
//ImVector<VkExtensionProperties> properties;
vkEnumerateDeviceExtensionProperties(g_PhysicalDevice, NULL, &properties_count, NULL);
//properties.resize(properties_count);
VkExtensionProperties* properties = (VkExtensionProperties*)malloc(properties_count * sizeof(VkExtensionProperties));
vkEnumerateDeviceExtensionProperties(g_PhysicalDevice, NULL, &properties_count, properties);
#ifdef VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME
if (IsExtensionAvailable(properties, properties_count, VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME)){
//device_extensions.push_back(VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME);
device_extensions_count++;
device_extensions = realloc(device_extensions, device_extensions_count * sizeof(const char*));
assert(device_extensions);
device_extensions[device_extensions_count-1] = VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME;
}
#endif
const float queue_priority[] = { 1.0f }; const float queue_priority[] = { 1.0f };
VkDeviceQueueCreateInfo queue_info[1] = { VkDeviceQueueCreateInfo queue_info[1] = {};
[0].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO, queue_info[0].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
[0].queueFamilyIndex = g_QueueFamily, queue_info[0].queueFamilyIndex = g_QueueFamily;
[0].queueCount = 1, queue_info[0].queueCount = 1;
[0].pQueuePriorities = queue_priority, queue_info[0].pQueuePriorities = queue_priority;
}; VkDeviceCreateInfo create_info = {};
VkDeviceCreateInfo create_info = { create_info.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;
.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, create_info.queueCreateInfoCount = sizeof(queue_info) / sizeof(queue_info[0]);
.queueCreateInfoCount = sizeof(queue_info) / sizeof(queue_info[0]), create_info.pQueueCreateInfos = queue_info;
.pQueueCreateInfos = queue_info, create_info.enabledExtensionCount = device_extensions_count; //(uint32_t)device_extensions.Size;
.enabledExtensionCount = device_extension_count, create_info.ppEnabledExtensionNames = device_extensions;//device_extensions.Data;
.ppEnabledExtensionNames = device_extensions,
};
err = vkCreateDevice(g_PhysicalDevice, &create_info, g_Allocator, &g_Device); err = vkCreateDevice(g_PhysicalDevice, &create_info, g_Allocator, &g_Device);
check_vk_result(err); check_vk_result_line(err, __LINE__);
vkGetDeviceQueue(g_Device, g_QueueFamily, 0, &g_Queue); vkGetDeviceQueue(g_Device, g_QueueFamily, 0, &g_Queue);
}
// Create Descriptor Pool // Create Descriptor Pool
VkDescriptorPoolSize pool_sizes[] = { // If you wish to load e.g. additional textures you may need to alter pools sizes and maxSets.
{ VK_DESCRIPTOR_TYPE_SAMPLER, 1000 }, {
{ VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1000 }, VkDescriptorPoolSize pool_sizes[] =
{ VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 1000 }, {
{ VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 1000 }, { VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, IMGUI_IMPL_VULKAN_MINIMUM_IMAGE_SAMPLER_POOL_SIZE },
{ VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 1000 },
{ VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, 1000 },
{ VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1000 },
{ VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1000 },
{ VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, 1000 },
{ VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, 1000 },
{ VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, 1000 }
};
VkDescriptorPoolCreateInfo pool_info = {
.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT,
.maxSets = 1000 * IM_ARRAYSIZE(pool_sizes),
.poolSizeCount = (uint32_t)IM_ARRAYSIZE(pool_sizes),
.pPoolSizes = pool_sizes,
}; };
VkDescriptorPoolCreateInfo pool_info = {};
pool_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO;
pool_info.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT;
pool_info.maxSets = 0;
//for (VkDescriptorPoolSize& pool_size : pool_sizes)
// pool_info.maxSets += pool_size.descriptorCount;
for(int i = 0; i < IM_ARRAYSIZE(pool_sizes); i++){
VkDescriptorPoolSize pool_size = pool_sizes[i];
pool_info.maxSets += pool_size.descriptorCount;
}
pool_info.poolSizeCount = (uint32_t)IM_ARRAYSIZE(pool_sizes);
pool_info.pPoolSizes = pool_sizes;
err = vkCreateDescriptorPool(g_Device, &pool_info, g_Allocator, &g_DescriptorPool); err = vkCreateDescriptorPool(g_Device, &pool_info, g_Allocator, &g_DescriptorPool);
check_vk_result(err); check_vk_result_line(err, __LINE__);
}
} }
//*/
// All the ImGui_ImplVulkanH_XXX structures/functions are optional helpers used by the demo. // All the ImGui_ImplVulkanH_XXX structures/functions are optional helpers used by the demo.
// Your real engine/app may not use them. // Your real engine/app may not use them.
static void SetupVulkanWindow(ImGui_ImplVulkanH_Window* wd, VkSurfaceKHR surface, static void SetupVulkanWindow(ImGui_ImplVulkanH_Window* wd, VkSurfaceKHR surface, int width, int height)
int width, int height)
{ {
wd->Surface = surface; wd->Surface = surface;
@@ -219,43 +247,33 @@ static void SetupVulkanWindow(ImGui_ImplVulkanH_Window* wd, VkSurfaceKHR surface
} }
// Select Surface Format // Select Surface Format
const VkFormat requestSurfaceImageFormat[] = { const VkFormat requestSurfaceImageFormat[] = { VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_B8G8R8_UNORM, VK_FORMAT_R8G8B8_UNORM };
VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_R8G8B8A8_UNORM,
VK_FORMAT_B8G8R8_UNORM, VK_FORMAT_R8G8B8_UNORM
};
const VkColorSpaceKHR requestSurfaceColorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR; const VkColorSpaceKHR requestSurfaceColorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR;
wd->SurfaceFormat = ImGui_ImplVulkanH_SelectSurfaceFormat( wd->SurfaceFormat = ImGui_ImplVulkanH_SelectSurfaceFormat(g_PhysicalDevice, wd->Surface, requestSurfaceImageFormat, (size_t)IM_ARRAYSIZE(requestSurfaceImageFormat), requestSurfaceColorSpace);
g_PhysicalDevice, wd->Surface, requestSurfaceImageFormat,
(size_t)IM_ARRAYSIZE(requestSurfaceImageFormat), requestSurfaceColorSpace);
// Select Present Mode // Select Present Mode
#ifdef IMGUI_UNLIMITED_FRAME_RATE #ifdef APP_USE_UNLIMITED_FRAME_RATE
VkPresentModeKHR present_modes[] = { VkPresentModeKHR present_modes[] = { VK_PRESENT_MODE_MAILBOX_KHR, VK_PRESENT_MODE_IMMEDIATE_KHR, VK_PRESENT_MODE_FIFO_KHR };
VK_PRESENT_MODE_MAILBOX_KHR,VK_PRESENT_MODE_IMMEDIATE_KHR, VK_PRESENT_MODE_FIFO_KHR
};
#else #else
VkPresentModeKHR present_modes[] = { VK_PRESENT_MODE_FIFO_KHR }; VkPresentModeKHR present_modes[] = { VK_PRESENT_MODE_FIFO_KHR };
#endif #endif
wd->PresentMode = ImGui_ImplVulkanH_SelectPresentMode( wd->PresentMode = ImGui_ImplVulkanH_SelectPresentMode(g_PhysicalDevice, wd->Surface, &present_modes[0], IM_ARRAYSIZE(present_modes));
g_PhysicalDevice, wd->Surface, &present_modes[0], IM_ARRAYSIZE(present_modes)); //printf("[vulkan] Selected PresentMode = %d\n", wd->PresentMode);
// Create SwapChain, RenderPass, Framebuffer, etc. // Create SwapChain, RenderPass, Framebuffer, etc.
IM_ASSERT(g_MinImageCount >= 2); IM_ASSERT(g_MinImageCount >= 2);
ImGui_ImplVulkanH_CreateOrResizeWindow( ImGui_ImplVulkanH_CreateOrResizeWindow(g_Instance, g_PhysicalDevice, g_Device, wd, g_QueueFamily, g_Allocator, width, height, g_MinImageCount);
g_Instance, g_PhysicalDevice, g_Device, wd, g_QueueFamily, g_Allocator,
width, height, g_MinImageCount);
} }
static void CleanupVulkan() static void CleanupVulkan()
{ {
vkDestroyDescriptorPool(g_Device, g_DescriptorPool, g_Allocator); vkDestroyDescriptorPool(g_Device, g_DescriptorPool, g_Allocator);
#ifdef IMGUI_VULKAN_DEBUG_REPORT #ifdef APP_USE_VULKAN_DEBUG_REPORT
// Remove the debug report callback // Remove the debug report callback
PFN_vkDestroyDebugReportCallbackEXT vkDestroyDebugReportCallbackEXT = PFN_vkDestroyDebugReportCallbackEXT f_vkDestroyDebugReportCallbackEXT = (PFN_vkDestroyDebugReportCallbackEXT)vkGetInstanceProcAddr(g_Instance, "vkDestroyDebugReportCallbackEXT");
(PFN_vkDestroyDebugReportCallbackEXT)vkGetInstanceProcAddr(g_Instance, "vkDestroyDebugReportCallbackEXT"); f_vkDestroyDebugReportCallbackEXT(g_Instance, g_DebugReport, g_Allocator);
vkDestroyDebugReportCallbackEXT(g_Instance, g_DebugReport, g_Allocator); #endif // APP_USE_VULKAN_DEBUG_REPORT
#endif // IMGUI_VULKAN_DEBUG_REPORT
vkDestroyDevice(g_Device, g_Allocator); vkDestroyDevice(g_Device, g_Allocator);
vkDestroyInstance(g_Instance, g_Allocator); vkDestroyInstance(g_Instance, g_Allocator);
@@ -268,115 +286,122 @@ static void CleanupVulkanWindow()
static void FrameRender(ImGui_ImplVulkanH_Window* wd, ImDrawData* draw_data) static void FrameRender(ImGui_ImplVulkanH_Window* wd, ImDrawData* draw_data)
{ {
VkResult err; VkSemaphore image_acquired_semaphore = wd->FrameSemaphores.Data[wd->SemaphoreIndex].ImageAcquiredSemaphore;
VkSemaphore render_complete_semaphore = wd->FrameSemaphores.Data[wd->SemaphoreIndex].RenderCompleteSemaphore;
VkSemaphore image_acquired_semaphore = wd->FrameSemaphores[wd->SemaphoreIndex].ImageAcquiredSemaphore; VkResult err = vkAcquireNextImageKHR(g_Device, wd->Swapchain, UINT64_MAX, image_acquired_semaphore, VK_NULL_HANDLE, &wd->FrameIndex);
VkSemaphore render_complete_semaphore = wd->FrameSemaphores[wd->SemaphoreIndex].RenderCompleteSemaphore;
err = vkAcquireNextImageKHR(g_Device, wd->Swapchain, UINT64_MAX, image_acquired_semaphore, VK_NULL_HANDLE, &wd->FrameIndex);
if (err == VK_ERROR_OUT_OF_DATE_KHR || err == VK_SUBOPTIMAL_KHR) if (err == VK_ERROR_OUT_OF_DATE_KHR || err == VK_SUBOPTIMAL_KHR)
{
g_SwapChainRebuild = true; g_SwapChainRebuild = true;
if (err == VK_ERROR_OUT_OF_DATE_KHR)
return; return;
} if (err != VK_SUBOPTIMAL_KHR)
check_vk_result(err); check_vk_result_line(err, __LINE__);
ImGui_ImplVulkanH_Frame* fd = &wd->Frames[wd->FrameIndex]; ImGui_ImplVulkanH_Frame* fd = &wd->Frames.Data[wd->FrameIndex];
{
err = vkWaitForFences(g_Device, 1, &fd->Fence, VK_TRUE, UINT64_MAX); // wait indefinitely instead of periodically checking err = vkWaitForFences(g_Device, 1, &fd->Fence, VK_TRUE, UINT64_MAX); // wait indefinitely instead of periodically checking
check_vk_result(err); check_vk_result_line(err, __LINE__);
err = vkResetFences(g_Device, 1, &fd->Fence); err = vkResetFences(g_Device, 1, &fd->Fence);
check_vk_result(err); check_vk_result_line(err, __LINE__);
}
{
err = vkResetCommandPool(g_Device, fd->CommandPool, 0); err = vkResetCommandPool(g_Device, fd->CommandPool, 0);
check_vk_result(err); check_vk_result_line(err, __LINE__);
VkCommandBufferBeginInfo info = { VkCommandBufferBeginInfo info = {};
.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT, info.flags |= VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
};
err = vkBeginCommandBuffer(fd->CommandBuffer, &info); err = vkBeginCommandBuffer(fd->CommandBuffer, &info);
check_vk_result(err); check_vk_result_line(err, __LINE__);
VkRenderPassBeginInfo rp_info = { }
.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, {
.renderPass = wd->RenderPass, VkRenderPassBeginInfo info = {};
.framebuffer = fd->Framebuffer, info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO;
.renderArea.extent.width = wd->Width, info.renderPass = wd->RenderPass;
.renderArea.extent.height = wd->Height, info.framebuffer = fd->Framebuffer;
.clearValueCount = 1, info.renderArea.extent.width = wd->Width;
.pClearValues = &wd->ClearValue, info.renderArea.extent.height = wd->Height;
}; info.clearValueCount = 1;
vkCmdBeginRenderPass(fd->CommandBuffer, &rp_info, VK_SUBPASS_CONTENTS_INLINE); info.pClearValues = &wd->ClearValue;
vkCmdBeginRenderPass(fd->CommandBuffer, &info, VK_SUBPASS_CONTENTS_INLINE);
}
// Record dear imgui primitives into command buffer // Record dear imgui primitives into command buffer
ImGui_ImplVulkan_RenderDrawData(draw_data, fd->CommandBuffer, VK_NULL_HANDLE); ImGui_ImplVulkan_RenderDrawData(draw_data, fd->CommandBuffer, VK_NULL_HANDLE);
// Submit command buffer // Submit command buffer
vkCmdEndRenderPass(fd->CommandBuffer); vkCmdEndRenderPass(fd->CommandBuffer);
{
VkPipelineStageFlags wait_stage = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT; VkPipelineStageFlags wait_stage = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
VkSubmitInfo sub_info = { VkSubmitInfo info = {};
.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO, info.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
.waitSemaphoreCount = 1, info.waitSemaphoreCount = 1;
.pWaitSemaphores = &image_acquired_semaphore, info.pWaitSemaphores = &image_acquired_semaphore;
.pWaitDstStageMask = &wait_stage, info.pWaitDstStageMask = &wait_stage;
.commandBufferCount = 1, info.commandBufferCount = 1;
.pCommandBuffers = &fd->CommandBuffer, info.pCommandBuffers = &fd->CommandBuffer;
.signalSemaphoreCount = 1, info.signalSemaphoreCount = 1;
.pSignalSemaphores = &render_complete_semaphore, info.pSignalSemaphores = &render_complete_semaphore;
};
err = vkEndCommandBuffer(fd->CommandBuffer); err = vkEndCommandBuffer(fd->CommandBuffer);
check_vk_result(err); check_vk_result_line(err, __LINE__);
err = vkQueueSubmit(g_Queue, 1, &sub_info, fd->Fence); err = vkQueueSubmit(g_Queue, 1, &info, fd->Fence);
check_vk_result(err); check_vk_result_line(err, __LINE__);
}
} }
static void FramePresent(ImGui_ImplVulkanH_Window* wd) static void FramePresent(ImGui_ImplVulkanH_Window* wd)
{ {
if (g_SwapChainRebuild) return; if (g_SwapChainRebuild)
VkSemaphore render_complete_semaphore = wd->FrameSemaphores[wd->SemaphoreIndex].RenderCompleteSemaphore; return;
VkPresentInfoKHR info = { VkSemaphore render_complete_semaphore = wd->FrameSemaphores.Data[wd->SemaphoreIndex].RenderCompleteSemaphore;
.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR, VkPresentInfoKHR info = {};
.waitSemaphoreCount = 1, info.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR;
.pWaitSemaphores = &render_complete_semaphore, info.waitSemaphoreCount = 1;
.swapchainCount = 1, info.pWaitSemaphores = &render_complete_semaphore;
.pSwapchains = &wd->Swapchain, info.swapchainCount = 1;
.pImageIndices = &wd->FrameIndex, info.pSwapchains = &wd->Swapchain;
}; info.pImageIndices = &wd->FrameIndex;
VkResult err = vkQueuePresentKHR(g_Queue, &info); VkResult err = vkQueuePresentKHR(g_Queue, &info);
if (err == VK_ERROR_OUT_OF_DATE_KHR || err == VK_SUBOPTIMAL_KHR) if (err == VK_ERROR_OUT_OF_DATE_KHR || err == VK_SUBOPTIMAL_KHR)
{
g_SwapChainRebuild = true; g_SwapChainRebuild = true;
if (err == VK_ERROR_OUT_OF_DATE_KHR)
return; return;
} if (err != VK_SUBOPTIMAL_KHR)
check_vk_result(err); check_vk_result_line(err, __LINE__);
wd->SemaphoreIndex = (wd->SemaphoreIndex + 1) % wd->ImageCount; // Now we can use the next set of semaphores wd->SemaphoreIndex = (wd->SemaphoreIndex + 1) % wd->SemaphoreCount; // Now we can use the next set of semaphores
} }
// Main code
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
// Setup SDL
if (SDL_Init(SDL_INIT_VIDEO) < 0) { if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_GAMECONTROLLER) != 0)
SDL_Log("failed to init: %s", SDL_GetError()); {
printf("Error: %s\n", SDL_GetError());
return -1; return -1;
} }
/// Setup window // From 2.0.18: Enable native IME.
SDL_WindowFlags window_flags = (SDL_WindowFlags)(SDL_WINDOW_VULKAN | #ifdef SDL_HINT_IME_SHOW_UI
SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI); SDL_SetHint(SDL_HINT_IME_SHOW_UI, "1");
SDL_Window* window = SDL_CreateWindow("cImGui SDL2+Vulkan example", #endif
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1280, 720, window_flags);
if (window == NULL) { // Create window with Vulkan graphics context
SDL_Log("Failed to create window: %s", SDL_GetError()); SDL_WindowFlags window_flags = (SDL_WindowFlags)(SDL_WINDOW_VULKAN | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI);
SDL_Window* window = SDL_CreateWindow("Dear ImGui SDL2+Vulkan example", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1280, 720, window_flags);
if (window == NULL)
{
printf("Error: SDL_CreateWindow(): %s\n", SDL_GetError());
return -1; return -1;
} }
// Setup Vulkan // Setup Vulkan
uint32_t extensions_count = 0; uint32_t extensions_count = 0;
SDL_Vulkan_GetInstanceExtensions(window, &extensions_count, NULL); SDL_Vulkan_GetInstanceExtensions(window, &extensions_count, NULL);
const char** extensions = malloc(extensions_count * sizeof(const char*)); const char** extensions = (const char**)malloc(extensions_count * sizeof(const char*));
SDL_Vulkan_GetInstanceExtensions(window, &extensions_count, extensions); SDL_Vulkan_GetInstanceExtensions(window, &extensions_count, extensions);
SetupVulkan(extensions, extensions_count); SetupVulkan(extensions, extensions_count);
free(extensions); //leak?? but free crashes
// free(extensions);
// Create Window Surface // Create Window Surface
VkSurfaceKHR surface; VkSurfaceKHR surface;
VkResult err; VkResult err;
@@ -392,126 +417,129 @@ int main(int argc, char* argv[])
ImGui_ImplVulkanH_Window* wd = &g_MainWindowData; ImGui_ImplVulkanH_Window* wd = &g_MainWindowData;
SetupVulkanWindow(wd, surface, w, h); SetupVulkanWindow(wd, surface, w, h);
// setup imgui // Setup Dear ImGui context
//IMGUI_CHECKVERSION();
igCreateContext(NULL); igCreateContext(NULL);
ImGuiIO* io = igGetIO(); (void)io;
io->ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
io->ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
io->ConfigFlags |= ImGuiConfigFlags_DockingEnable; // Enable Docking
io->ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; // Enable Multi-Viewport / Platform Windows
//io.ConfigFlags |= ImGuiConfigFlags_ViewportsNoTaskBarIcons;
//io.ConfigFlags |= ImGuiConfigFlags_ViewportsNoMerge;
//set docking // Setup Dear ImGui style
ImGuiIO* ioptr = igGetIO(); igStyleColorsDark(NULL);
ioptr->ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls //ImGui::StyleColorsLight();
//ioptr->ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
// When viewports are enabled we tweak WindowRounding/WindowBg so platform windows can look identical to regular ones.
ImGuiStyle* style = igGetStyle();
if (io->ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
{
style->WindowRounding = 0.0f;
style->Colors[ImGuiCol_WindowBg].w = 1.0f;
}
// Setup Platform/Renderer backends // Setup Platform/Renderer backends
ImGui_ImplSDL2_InitForVulkan(window); ImGui_ImplSDL2_InitForVulkan(window);
ImGui_ImplVulkan_InitInfo init_info = { ImGui_ImplVulkan_InitInfo init_info = {};
.Instance = g_Instance, init_info.Instance = g_Instance;
.PhysicalDevice = g_PhysicalDevice, init_info.PhysicalDevice = g_PhysicalDevice;
.Device = g_Device, init_info.Device = g_Device;
.QueueFamily = g_QueueFamily, init_info.QueueFamily = g_QueueFamily;
.Queue = g_Queue, init_info.Queue = g_Queue;
.PipelineCache = g_PipelineCache, init_info.PipelineCache = g_PipelineCache;
.DescriptorPool = g_DescriptorPool, init_info.DescriptorPool = g_DescriptorPool;
.Subpass = 0, init_info.RenderPass = wd->RenderPass;
.MinImageCount = g_MinImageCount, init_info.Subpass = 0;
.ImageCount = wd->ImageCount, init_info.MinImageCount = g_MinImageCount;
.MSAASamples = VK_SAMPLE_COUNT_1_BIT, init_info.ImageCount = wd->ImageCount;
.Allocator = g_Allocator, init_info.MSAASamples = VK_SAMPLE_COUNT_1_BIT;
.CheckVkResultFn = check_vk_result init_info.Allocator = g_Allocator;
}; init_info.CheckVkResultFn = check_vk_result;
ImGui_ImplVulkan_Init(&init_info, wd->RenderPass); ImGui_ImplVulkan_Init(&init_info);
igStyleColorsDark(NULL); // Load Fonts
// - If no fonts are loaded, dear imgui will use the default font. You can also load multiple fonts and use ImGui::PushFont()/PopFont() to select them.
// - AddFontFromFileTTF() will return the ImFont* so you can store it if you need to select the font among multiple.
// - If the file cannot be loaded, the function will return a nullptr. Please handle those errors in your application (e.g. use an assertion, or display an error and quit).
// - The fonts will be rasterized at a given size (w/ oversampling) and stored into a texture when calling ImFontAtlas::Build()/GetTexDataAsXXXX(), which ImGui_ImplXXXX_NewFrame below will call.
// - Use '#define IMGUI_ENABLE_FREETYPE' in your imconfig file to use Freetype for higher quality font rendering.
// - Read 'docs/FONTS.md' for more instructions and details.
// - Remember that in C/C++ if you want to include a backslash \ in a string literal you need to write a double backslash \\ !
//io.Fonts->AddFontDefault();
//io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\segoeui.ttf", 18.0f);
//io.Fonts->AddFontFromFileTTF("../../misc/fonts/DroidSans.ttf", 16.0f);
//io.Fonts->AddFontFromFileTTF("../../misc/fonts/Roboto-Medium.ttf", 16.0f);
//io.Fonts->AddFontFromFileTTF("../../misc/fonts/Cousine-Regular.ttf", 15.0f);
//ImFont* font = io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, nullptr, io.Fonts->GetGlyphRangesJapanese());
//IM_ASSERT(font != nullptr);
// Upload Fonts // Our state
// Use any command queue bool show_demo_window = true;
VkCommandPool command_pool = wd->Frames[wd->FrameIndex].CommandPool; bool show_another_window = false;
VkCommandBuffer command_buffer = wd->Frames[wd->FrameIndex].CommandBuffer; ImVec4 clear_color;
clear_color.x = 0.45f;
clear_color.y = 0.55f;
clear_color.z = 0.60f;
clear_color.w = 1.00f;
err = vkResetCommandPool(g_Device, command_pool, 0); // Main loop
check_vk_result(err); bool done = false;
VkCommandBufferBeginInfo begin_info = { while (!done)
.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,
};
err = vkBeginCommandBuffer(command_buffer, &begin_info);
check_vk_result(err);
ImGui_ImplVulkan_CreateFontsTexture(command_buffer);
VkSubmitInfo end_info = {
.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
.commandBufferCount = 1,
.pCommandBuffers = &command_buffer,
};
err = vkEndCommandBuffer(command_buffer);
check_vk_result(err);
err = vkQueueSubmit(g_Queue, 1, &end_info, VK_NULL_HANDLE);
check_vk_result(err);
err = vkDeviceWaitIdle(g_Device);
check_vk_result(err);
ImGui_ImplVulkan_DestroyFontUploadObjects();
bool showDemoWindow = true;
bool showAnotherWindow = false;
ImVec4 clearColor;
clearColor.x = 0.45f;
clearColor.y = 0.55f;
clearColor.z = 0.60f;
clearColor.w = 1.00f;
bool quit = false;
while (!quit)
{ {
SDL_Event e; // Poll and handle events (inputs, window resize, etc.)
// You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.
// we need to call SDL_PollEvent to let window rendered, otherwise // - When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application, or clear/overwrite your copy of the mouse data.
// no window will be shown // - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application, or clear/overwrite your copy of the keyboard data.
while (SDL_PollEvent(&e) != 0) // Generally you may always pass all inputs to dear imgui, and hide them from your application based on those two flags.
SDL_Event event;
while (SDL_PollEvent(&event))
{ {
ImGui_ImplSDL2_ProcessEvent(&e); ImGui_ImplSDL2_ProcessEvent(&event);
if (e.type == SDL_QUIT) if (event.type == SDL_QUIT)
quit = true; done = true;
if (e.type == SDL_WINDOWEVENT && e.window.event == SDL_WINDOWEVENT_CLOSE && if (event.type == SDL_WINDOWEVENT && event.window.event == SDL_WINDOWEVENT_CLOSE && event.window.windowID == SDL_GetWindowID(window))
e.window.windowID == SDL_GetWindowID(window)) done = true;
quit = true; }
if (SDL_GetWindowFlags(window) & SDL_WINDOW_MINIMIZED)
{
SDL_Delay(10);
continue;
} }
// Resize swap chain // Resize swap chain?
if (g_SwapChainRebuild) int fb_width, fb_height;
{ SDL_GetWindowSize(window, &fb_width, &fb_height);
int width, height; if (fb_width > 0 && fb_height > 0 && (g_SwapChainRebuild || g_MainWindowData.Width != fb_width || g_MainWindowData.Height != fb_height))
SDL_GetWindowSize(window, &width, &height);
if (width > 0 && height > 0)
{ {
ImGui_ImplVulkan_SetMinImageCount(g_MinImageCount); ImGui_ImplVulkan_SetMinImageCount(g_MinImageCount);
ImGui_ImplVulkanH_CreateOrResizeWindow( ImGui_ImplVulkanH_CreateOrResizeWindow(g_Instance, g_PhysicalDevice, g_Device, &g_MainWindowData, g_QueueFamily, g_Allocator, fb_width, fb_height, g_MinImageCount);
g_Instance, g_PhysicalDevice, g_Device, &g_MainWindowData,
g_QueueFamily, g_Allocator, width, height, g_MinImageCount);
g_MainWindowData.FrameIndex = 0; g_MainWindowData.FrameIndex = 0;
g_SwapChainRebuild = false; g_SwapChainRebuild = false;
} }
}
// start imgui frame // Start the Dear ImGui frame
ImGui_ImplVulkan_NewFrame(); ImGui_ImplVulkan_NewFrame();
ImGui_ImplSDL2_NewFrame(); ImGui_ImplSDL2_NewFrame();
igNewFrame(); igNewFrame();
if (showDemoWindow) // 1. Show the big demo window (Most of the sample code is in ImGui::ShowDemoWindow()! You can browse its code to learn more about Dear ImGui!).
igShowDemoWindow(&showDemoWindow); if (show_demo_window)
igShowDemoWindow(&show_demo_window);
// show a simple window that we created ourselves. // 2. Show a simple window that we create ourselves. We use a Begin/End pair to create a named window.
{ {
static float f = 0.0f; static float f = 0.0f;
static int counter = 0; static int counter = 0;
igBegin("Hello, world!", NULL, 0); igBegin("Hello, world!", NULL, 0);
igText("This is some useful text"); igText("This is some useful text");
igCheckbox("Demo window", &showDemoWindow); igCheckbox("Demo window", &show_demo_window);
igCheckbox("Another window", &showAnotherWindow); igCheckbox("Another window", &show_another_window);
igSliderFloat("Float", &f, 0.0f, 1.0f, "%.3f", 0); igSliderFloat("Float", &f, 0.0f, 1.0f, "%.3f", 0);
igColorEdit3("clear color", (float*)&clearColor, 0); igColorEdit3("clear color", (float*)&clear_color, 0);
ImVec2 buttonSize; ImVec2 buttonSize;
buttonSize.x = 0; buttonSize.x = 0;
@@ -526,37 +554,46 @@ int main(int argc, char* argv[])
igEnd(); igEnd();
} }
if (showAnotherWindow) // 3. Show another simple window.
if (show_another_window)
{ {
igBegin("imgui Another Window", &showAnotherWindow, 0); igBegin("imgui Another Window", &show_another_window, 0);
igText("Hello from imgui"); igText("Hello from imgui");
ImVec2 buttonSize; ImVec2 buttonSize;
buttonSize.x = 0; buttonSize.y = 0; buttonSize.x = 0; buttonSize.y = 0;
if (igButton("Close me", buttonSize)) if (igButton("Close me", buttonSize))
{ {
showAnotherWindow = false; show_another_window = false;
} }
igEnd(); igEnd();
} }
// render // Rendering
igRender(); igRender();
ImDrawData* draw_data = igGetDrawData(); ImDrawData* main_draw_data = igGetDrawData();
const bool is_minimized = (draw_data->DisplaySize.x <= 0.0f || draw_data->DisplaySize.y <= 0.0f); const bool main_is_minimized = (main_draw_data->DisplaySize.x <= 0.0f || main_draw_data->DisplaySize.y <= 0.0f);
if (!is_minimized) wd->ClearValue.color.float32[0] = clear_color.x * clear_color.w;
wd->ClearValue.color.float32[1] = clear_color.y * clear_color.w;
wd->ClearValue.color.float32[2] = clear_color.z * clear_color.w;
wd->ClearValue.color.float32[3] = clear_color.w;
if (!main_is_minimized)
FrameRender(wd, main_draw_data);
// Update and Render additional Platform Windows
if (io->ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
{ {
wd->ClearValue.color.float32[0] = clearColor.x * clearColor.w; igUpdatePlatformWindows();
wd->ClearValue.color.float32[1] = clearColor.y * clearColor.w; igRenderPlatformWindowsDefault(NULL, NULL);
wd->ClearValue.color.float32[2] = clearColor.z * clearColor.w;
wd->ClearValue.color.float32[3] = clearColor.w;
FrameRender(wd, draw_data);
FramePresent(wd);
} }
// Present Main Platform Window
if (!main_is_minimized)
FramePresent(wd);
} }
// Cleanup // Cleanup
err = vkDeviceWaitIdle(g_Device); err = vkDeviceWaitIdle(g_Device);
check_vk_result(err); check_vk_result_line(err, __LINE__);
ImGui_ImplVulkan_Shutdown(); ImGui_ImplVulkan_Shutdown();
ImGui_ImplSDL2_Shutdown(); ImGui_ImplSDL2_Shutdown();
igDestroyContext(NULL); igDestroyContext(NULL);

View File

@@ -1,5 +1,5 @@
//This file is automatically generated by generator.lua from https://github.com/cimgui/cimgui //This file is automatically generated by generator.lua from https://github.com/cimgui/cimgui
//based on imgui.h file version "1.91.7" 19170 from Dear ImGui https://github.com/ocornut/imgui //based on imgui.h file version "1.91.8" 19180 from Dear ImGui https://github.com/ocornut/imgui
//with imgui_internal.h api //with imgui_internal.h api
//with imgui_freetype.h api //with imgui_freetype.h api
//docking branch //docking branch
@@ -1577,6 +1577,10 @@ CIMGUI_API bool igIsMouseDoubleClicked_Nil(ImGuiMouseButton button)
{ {
return ImGui::IsMouseDoubleClicked(button); return ImGui::IsMouseDoubleClicked(button);
} }
CIMGUI_API bool igIsMouseReleasedWithDelay(ImGuiMouseButton button,float delay)
{
return ImGui::IsMouseReleasedWithDelay(button,delay);
}
CIMGUI_API int igGetMouseClickedCount(ImGuiMouseButton button) CIMGUI_API int igGetMouseClickedCount(ImGuiMouseButton button)
{ {
return ImGui::GetMouseClickedCount(button); return ImGui::GetMouseClickedCount(button);
@@ -2596,14 +2600,14 @@ CIMGUI_API void ImFontAtlas_ClearInputData(ImFontAtlas* self)
{ {
return self->ClearInputData(); return self->ClearInputData();
} }
CIMGUI_API void ImFontAtlas_ClearTexData(ImFontAtlas* self)
{
return self->ClearTexData();
}
CIMGUI_API void ImFontAtlas_ClearFonts(ImFontAtlas* self) CIMGUI_API void ImFontAtlas_ClearFonts(ImFontAtlas* self)
{ {
return self->ClearFonts(); return self->ClearFonts();
} }
CIMGUI_API void ImFontAtlas_ClearTexData(ImFontAtlas* self)
{
return self->ClearTexData();
}
CIMGUI_API void ImFontAtlas_Clear(ImFontAtlas* self) CIMGUI_API void ImFontAtlas_Clear(ImFontAtlas* self)
{ {
return self->Clear(); return self->Clear();
@@ -4127,6 +4131,10 @@ CIMGUI_API ImFont* igGetDefaultFont()
{ {
return ImGui::GetDefaultFont(); return ImGui::GetDefaultFont();
} }
CIMGUI_API void igPushPasswordFont()
{
return ImGui::PushPasswordFont();
}
CIMGUI_API ImDrawList* igGetForegroundDrawList_WindowPtr(ImGuiWindow* window) CIMGUI_API ImDrawList* igGetForegroundDrawList_WindowPtr(ImGuiWindow* window)
{ {
return ImGui::GetForegroundDrawList(window); return ImGui::GetForegroundDrawList(window);
@@ -4371,9 +4379,9 @@ CIMGUI_API bool igIsClippedEx(const ImRect bb,ImGuiID id)
{ {
return ImGui::IsClippedEx(bb,id); return ImGui::IsClippedEx(bb,id);
} }
CIMGUI_API void igSetLastItemData(ImGuiID item_id,ImGuiItemFlags in_flags,ImGuiItemStatusFlags status_flags,const ImRect item_rect) CIMGUI_API void igSetLastItemData(ImGuiID item_id,ImGuiItemFlags item_flags,ImGuiItemStatusFlags status_flags,const ImRect item_rect)
{ {
return ImGui::SetLastItemData(item_id,in_flags,status_flags,item_rect); return ImGui::SetLastItemData(item_id,item_flags,status_flags,item_rect);
} }
CIMGUI_API void igCalcItemSize(ImVec2 *pOut,ImVec2 size,float default_w,float default_h) CIMGUI_API void igCalcItemSize(ImVec2 *pOut,ImVec2 size,float default_w,float default_h)
{ {
@@ -5295,6 +5303,10 @@ CIMGUI_API bool igTabItemEx(ImGuiTabBar* tab_bar,const char* label,bool* p_open,
{ {
return ImGui::TabItemEx(tab_bar,label,p_open,flags,docked_window); return ImGui::TabItemEx(tab_bar,label,p_open,flags,docked_window);
} }
CIMGUI_API void igTabItemSpacing(const char* str_id,ImGuiTabItemFlags flags,float width)
{
return ImGui::TabItemSpacing(str_id,flags,width);
}
CIMGUI_API void igTabItemCalcSize_Str(ImVec2 *pOut,const char* label,bool has_close_button_or_unsaved_marker) CIMGUI_API void igTabItemCalcSize_Str(ImVec2 *pOut,const char* label,bool has_close_button_or_unsaved_marker)
{ {
*pOut = ImGui::TabItemCalcSize(label,has_close_button_or_unsaved_marker); *pOut = ImGui::TabItemCalcSize(label,has_close_button_or_unsaved_marker);
@@ -5791,6 +5803,10 @@ CIMGUI_API void igImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table[2
{ {
return ImFontAtlasBuildMultiplyRectAlpha8(table,pixels,x,y,w,h,stride); return ImFontAtlasBuildMultiplyRectAlpha8(table,pixels,x,y,w,h,stride);
} }
CIMGUI_API void igImFontAtlasBuildGetOversampleFactors(const ImFontConfig* cfg,int* out_oversample_h,int* out_oversample_v)
{
return ImFontAtlasBuildGetOversampleFactors(cfg,out_oversample_h,out_oversample_v);
}
#ifdef IMGUI_ENABLE_FREETYPE #ifdef IMGUI_ENABLE_FREETYPE
CIMGUI_API const ImFontBuilderIO* ImGuiFreeType_GetBuilderForFreeType() CIMGUI_API const ImFontBuilderIO* ImGuiFreeType_GetBuilderForFreeType()
{ {

View File

@@ -1,5 +1,5 @@
//This file is automatically generated by generator.lua from https://github.com/cimgui/cimgui //This file is automatically generated by generator.lua from https://github.com/cimgui/cimgui
//based on imgui.h file version "1.91.7" 19170 from Dear ImGui https://github.com/ocornut/imgui //based on imgui.h file version "1.91.8" 19180 from Dear ImGui https://github.com/ocornut/imgui
//with imgui_internal.h api //with imgui_internal.h api
//with imgui_freetype.h api //with imgui_freetype.h api
//docking branch //docking branch
@@ -82,6 +82,7 @@ typedef struct ImGuiViewport ImGuiViewport;
typedef struct ImGuiWindowClass ImGuiWindowClass; typedef struct ImGuiWindowClass ImGuiWindowClass;
typedef struct ImBitVector ImBitVector; typedef struct ImBitVector ImBitVector;
typedef struct ImRect ImRect; typedef struct ImRect ImRect;
typedef struct ImGuiTextIndex ImGuiTextIndex;
typedef struct ImDrawDataBuilder ImDrawDataBuilder; typedef struct ImDrawDataBuilder ImDrawDataBuilder;
typedef struct ImGuiBoxSelectState ImGuiBoxSelectState; typedef struct ImGuiBoxSelectState ImGuiBoxSelectState;
typedef struct ImGuiColorMod ImGuiColorMod; typedef struct ImGuiColorMod ImGuiColorMod;
@@ -269,12 +270,12 @@ typedef enum {
ImGuiWindowFlags_NoNav = ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus, ImGuiWindowFlags_NoNav = ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus,
ImGuiWindowFlags_NoDecoration = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoCollapse, ImGuiWindowFlags_NoDecoration = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoCollapse,
ImGuiWindowFlags_NoInputs = ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus, ImGuiWindowFlags_NoInputs = ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus,
ImGuiWindowFlags_DockNodeHost = 1 << 23,
ImGuiWindowFlags_ChildWindow = 1 << 24, ImGuiWindowFlags_ChildWindow = 1 << 24,
ImGuiWindowFlags_Tooltip = 1 << 25, ImGuiWindowFlags_Tooltip = 1 << 25,
ImGuiWindowFlags_Popup = 1 << 26, ImGuiWindowFlags_Popup = 1 << 26,
ImGuiWindowFlags_Modal = 1 << 27, ImGuiWindowFlags_Modal = 1 << 27,
ImGuiWindowFlags_ChildMenu = 1 << 28, ImGuiWindowFlags_ChildMenu = 1 << 28,
ImGuiWindowFlags_DockNodeHost = 1 << 29,
}ImGuiWindowFlags_; }ImGuiWindowFlags_;
typedef enum { typedef enum {
ImGuiChildFlags_None = 0, ImGuiChildFlags_None = 0,
@@ -812,9 +813,10 @@ typedef enum {
ImGuiColorEditFlags_NoSidePreview = 1 << 8, ImGuiColorEditFlags_NoSidePreview = 1 << 8,
ImGuiColorEditFlags_NoDragDrop = 1 << 9, ImGuiColorEditFlags_NoDragDrop = 1 << 9,
ImGuiColorEditFlags_NoBorder = 1 << 10, ImGuiColorEditFlags_NoBorder = 1 << 10,
ImGuiColorEditFlags_AlphaOpaque = 1 << 11,
ImGuiColorEditFlags_AlphaNoBg = 1 << 12,
ImGuiColorEditFlags_AlphaPreviewHalf= 1 << 13,
ImGuiColorEditFlags_AlphaBar = 1 << 16, ImGuiColorEditFlags_AlphaBar = 1 << 16,
ImGuiColorEditFlags_AlphaPreview = 1 << 17,
ImGuiColorEditFlags_AlphaPreviewHalf= 1 << 18,
ImGuiColorEditFlags_HDR = 1 << 19, ImGuiColorEditFlags_HDR = 1 << 19,
ImGuiColorEditFlags_DisplayRGB = 1 << 20, ImGuiColorEditFlags_DisplayRGB = 1 << 20,
ImGuiColorEditFlags_DisplayHSV = 1 << 21, ImGuiColorEditFlags_DisplayHSV = 1 << 21,
@@ -826,6 +828,7 @@ typedef enum {
ImGuiColorEditFlags_InputRGB = 1 << 27, ImGuiColorEditFlags_InputRGB = 1 << 27,
ImGuiColorEditFlags_InputHSV = 1 << 28, ImGuiColorEditFlags_InputHSV = 1 << 28,
ImGuiColorEditFlags_DefaultOptions_ = ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_PickerHueBar, ImGuiColorEditFlags_DefaultOptions_ = ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_PickerHueBar,
ImGuiColorEditFlags_AlphaMask_ = ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaOpaque | ImGuiColorEditFlags_AlphaNoBg | ImGuiColorEditFlags_AlphaPreviewHalf,
ImGuiColorEditFlags_DisplayMask_ = ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_DisplayHex, ImGuiColorEditFlags_DisplayMask_ = ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_DisplayHex,
ImGuiColorEditFlags_DataTypeMask_ = ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_Float, ImGuiColorEditFlags_DataTypeMask_ = ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_Float,
ImGuiColorEditFlags_PickerMask_ = ImGuiColorEditFlags_PickerHueWheel | ImGuiColorEditFlags_PickerHueBar, ImGuiColorEditFlags_PickerMask_ = ImGuiColorEditFlags_PickerHueWheel | ImGuiColorEditFlags_PickerHueBar,
@@ -1129,6 +1132,7 @@ struct ImGuiIO
ImU16 MouseClickedCount[5]; ImU16 MouseClickedCount[5];
ImU16 MouseClickedLastCount[5]; ImU16 MouseClickedLastCount[5];
bool MouseReleased[5]; bool MouseReleased[5];
double MouseReleasedTime[5];
bool MouseDownOwned[5]; bool MouseDownOwned[5];
bool MouseDownOwnedUnlessPopupClose[5]; bool MouseDownOwnedUnlessPopupClose[5];
bool MouseWheelRequestAxisSwap; bool MouseWheelRequestAxisSwap;
@@ -1412,17 +1416,17 @@ struct ImFontConfig
void* FontData; void* FontData;
int FontDataSize; int FontDataSize;
bool FontDataOwnedByAtlas; bool FontDataOwnedByAtlas;
bool MergeMode;
bool PixelSnapH;
int FontNo; int FontNo;
float SizePixels;
int OversampleH; int OversampleH;
int OversampleV; int OversampleV;
bool PixelSnapH; float SizePixels;
ImVec2 GlyphExtraSpacing; ImVec2 GlyphExtraSpacing;
ImVec2 GlyphOffset; ImVec2 GlyphOffset;
const ImWchar* GlyphRanges; const ImWchar* GlyphRanges;
float GlyphMinAdvanceX; float GlyphMinAdvanceX;
float GlyphMaxAdvanceX; float GlyphMaxAdvanceX;
bool MergeMode;
unsigned int FontBuilderFlags; unsigned int FontBuilderFlags;
float RasterizerMultiply; float RasterizerMultiply;
float RasterizerDensity; float RasterizerDensity;
@@ -1474,8 +1478,8 @@ struct ImFontAtlas
ImTextureID TexID; ImTextureID TexID;
int TexDesiredWidth; int TexDesiredWidth;
int TexGlyphPadding; int TexGlyphPadding;
bool Locked;
void* UserData; void* UserData;
bool Locked;
bool TexReady; bool TexReady;
bool TexPixelsUseColors; bool TexPixelsUseColors;
unsigned char* TexPixelsAlpha8; unsigned char* TexPixelsAlpha8;
@@ -1487,7 +1491,7 @@ struct ImFontAtlas
ImVector_ImFontPtr Fonts; ImVector_ImFontPtr Fonts;
ImVector_ImFontAtlasCustomRect CustomRects; ImVector_ImFontAtlasCustomRect CustomRects;
ImVector_ImFontConfig ConfigData; ImVector_ImFontConfig ConfigData;
ImVec4 TexUvLines[(63) + 1]; ImVec4 TexUvLines[(32) + 1];
const ImFontBuilderIO* FontBuilderIO; const ImFontBuilderIO* FontBuilderIO;
unsigned int FontBuilderFlags; unsigned int FontBuilderFlags;
int PackIdMouseCursors; int PackIdMouseCursors;
@@ -1495,6 +1499,8 @@ struct ImFontAtlas
}; };
typedef struct ImVector_float {int Size;int Capacity;float* Data;} ImVector_float; typedef struct ImVector_float {int Size;int Capacity;float* Data;} ImVector_float;
typedef struct ImVector_ImU16 {int Size;int Capacity;ImU16* Data;} ImVector_ImU16;
typedef struct ImVector_ImFontGlyph {int Size;int Capacity;ImFontGlyph* Data;} ImVector_ImFontGlyph; typedef struct ImVector_ImFontGlyph {int Size;int Capacity;ImFontGlyph* Data;} ImVector_ImFontGlyph;
struct ImFont struct ImFont
@@ -1502,7 +1508,7 @@ struct ImFont
ImVector_float IndexAdvanceX; ImVector_float IndexAdvanceX;
float FallbackAdvanceX; float FallbackAdvanceX;
float FontSize; float FontSize;
ImVector_ImWchar IndexLookup; ImVector_ImU16 IndexLookup;
ImVector_ImFontGlyph Glyphs; ImVector_ImFontGlyph Glyphs;
const ImFontGlyph* FallbackGlyph; const ImFontGlyph* FallbackGlyph;
ImFontAtlas* ContainerAtlas; ImFontAtlas* ContainerAtlas;
@@ -1513,11 +1519,11 @@ struct ImFont
ImWchar FallbackChar; ImWchar FallbackChar;
float EllipsisWidth; float EllipsisWidth;
float EllipsisCharStep; float EllipsisCharStep;
bool DirtyLookupTables;
float Scale; float Scale;
float Ascent, Descent; float Ascent, Descent;
int MetricsTotalSurface; int MetricsTotalSurface;
ImU8 Used4kPagesMap[(IM_UNICODE_CODEPOINT_MAX +1)/4096/8]; bool DirtyLookupTables;
ImU8 Used8kPagesMap[(IM_UNICODE_CODEPOINT_MAX +1)/8192/8];
}; };
typedef enum { typedef enum {
ImGuiViewportFlags_None = 0, ImGuiViewportFlags_None = 0,
@@ -1613,6 +1619,7 @@ struct ImGuiPlatformImeData
}; };
struct ImBitVector; struct ImBitVector;
struct ImRect; struct ImRect;
struct ImGuiTextIndex;
struct ImDrawDataBuilder; struct ImDrawDataBuilder;
struct ImDrawListSharedData; struct ImDrawListSharedData;
struct ImGuiBoxSelectState; struct ImGuiBoxSelectState;
@@ -1701,7 +1708,6 @@ struct ImBitVector
ImVector_ImU32 Storage; ImVector_ImU32 Storage;
}; };
typedef int ImPoolIdx; typedef int ImPoolIdx;
typedef struct ImGuiTextIndex ImGuiTextIndex;
typedef struct ImVector_int {int Size;int Capacity;int* Data;} ImVector_int; typedef struct ImVector_int {int Size;int Capacity;int* Data;} ImVector_int;
struct ImGuiTextIndex struct ImGuiTextIndex
@@ -3072,6 +3078,10 @@ struct ImGuiWindowTempData
ImGuiLayoutType LayoutType; ImGuiLayoutType LayoutType;
ImGuiLayoutType ParentLayoutType; ImGuiLayoutType ParentLayoutType;
ImU32 ModalDimBgColor; ImU32 ModalDimBgColor;
ImGuiItemStatusFlags WindowItemStatusFlags;
ImGuiItemStatusFlags ChildItemStatusFlags;
ImGuiItemStatusFlags DockTabItemStatusFlags;
ImRect DockTabItemRect;
float ItemWidth; float ItemWidth;
float TextWrapPos; float TextWrapPos;
ImVector_float ItemWidthStack; ImVector_float ItemWidthStack;
@@ -3167,7 +3177,9 @@ struct ImGuiWindow
ImGuiStorage StateStorage; ImGuiStorage StateStorage;
ImVector_ImGuiOldColumns ColumnsStorage; ImVector_ImGuiOldColumns ColumnsStorage;
float FontWindowScale; float FontWindowScale;
float FontWindowScaleParents;
float FontDpiScale; float FontDpiScale;
float FontRefSize;
int SettingsOffset; int SettingsOffset;
ImDrawList* DrawList; ImDrawList* DrawList;
ImDrawList DrawListInst; ImDrawList DrawListInst;
@@ -3196,8 +3208,6 @@ struct ImGuiWindow
ImGuiDockNode* DockNode; ImGuiDockNode* DockNode;
ImGuiDockNode* DockNodeAsHost; ImGuiDockNode* DockNodeAsHost;
ImGuiID DockId; ImGuiID DockId;
ImGuiItemStatusFlags DockTabItemStatusFlags;
ImRect DockTabItemRect;
}; };
typedef enum { typedef enum {
ImGuiTabBarFlags_DockNode = 1 << 20, ImGuiTabBarFlags_DockNode = 1 << 20,
@@ -3208,7 +3218,8 @@ typedef enum {
ImGuiTabItemFlags_SectionMask_ = ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Trailing, ImGuiTabItemFlags_SectionMask_ = ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Trailing,
ImGuiTabItemFlags_NoCloseButton = 1 << 20, ImGuiTabItemFlags_NoCloseButton = 1 << 20,
ImGuiTabItemFlags_Button = 1 << 21, ImGuiTabItemFlags_Button = 1 << 21,
ImGuiTabItemFlags_Unsorted = 1 << 22, ImGuiTabItemFlags_Invisible = 1 << 22,
ImGuiTabItemFlags_Unsorted = 1 << 23,
}ImGuiTabItemFlagsPrivate_; }ImGuiTabItemFlagsPrivate_;
struct ImGuiTabItem struct ImGuiTabItem
{ {
@@ -3438,6 +3449,7 @@ struct ImGuiTable
ImGuiTableDrawChannelIdx DummyDrawChannel; ImGuiTableDrawChannelIdx DummyDrawChannel;
ImGuiTableDrawChannelIdx Bg2DrawChannelCurrent; ImGuiTableDrawChannelIdx Bg2DrawChannelCurrent;
ImGuiTableDrawChannelIdx Bg2DrawChannelUnfrozen; ImGuiTableDrawChannelIdx Bg2DrawChannelUnfrozen;
ImS8 NavLayer;
bool IsLayoutLocked; bool IsLayoutLocked;
bool IsInsideRow; bool IsInsideRow;
bool IsInitializing; bool IsInitializing;
@@ -3585,6 +3597,7 @@ typedef ImVector<ImGuiViewportP*> ImVector_ImGuiViewportPPtr;
typedef ImVector<ImGuiWindow*> ImVector_ImGuiWindowPtr; typedef ImVector<ImGuiWindow*> ImVector_ImGuiWindowPtr;
typedef ImVector<ImGuiWindowStackData> ImVector_ImGuiWindowStackData; typedef ImVector<ImGuiWindowStackData> ImVector_ImGuiWindowStackData;
typedef ImVector<ImTextureID> ImVector_ImTextureID; typedef ImVector<ImTextureID> ImVector_ImTextureID;
typedef ImVector<ImU16> ImVector_ImU16;
typedef ImVector<ImU32> ImVector_ImU32; typedef ImVector<ImU32> ImVector_ImU32;
typedef ImVector<ImU8> ImVector_ImU8; typedef ImVector<ImU8> ImVector_ImU8;
typedef ImVector<ImVec2> ImVector_ImVec2; typedef ImVector<ImVec2> ImVector_ImVec2;
@@ -3977,6 +3990,7 @@ CIMGUI_API bool igIsMouseDown_Nil(ImGuiMouseButton button);
CIMGUI_API bool igIsMouseClicked_Bool(ImGuiMouseButton button,bool repeat); CIMGUI_API bool igIsMouseClicked_Bool(ImGuiMouseButton button,bool repeat);
CIMGUI_API bool igIsMouseReleased_Nil(ImGuiMouseButton button); CIMGUI_API bool igIsMouseReleased_Nil(ImGuiMouseButton button);
CIMGUI_API bool igIsMouseDoubleClicked_Nil(ImGuiMouseButton button); CIMGUI_API bool igIsMouseDoubleClicked_Nil(ImGuiMouseButton button);
CIMGUI_API bool igIsMouseReleasedWithDelay(ImGuiMouseButton button,float delay);
CIMGUI_API int igGetMouseClickedCount(ImGuiMouseButton button); CIMGUI_API int igGetMouseClickedCount(ImGuiMouseButton button);
CIMGUI_API bool igIsMouseHoveringRect(const ImVec2 r_min,const ImVec2 r_max,bool clip); CIMGUI_API bool igIsMouseHoveringRect(const ImVec2 r_min,const ImVec2 r_max,bool clip);
CIMGUI_API bool igIsMousePosValid(const ImVec2* mouse_pos); CIMGUI_API bool igIsMousePosValid(const ImVec2* mouse_pos);
@@ -4231,8 +4245,8 @@ CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryTTF(ImFontAtlas* self,void* font
CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedTTF(ImFontAtlas* self,const void* compressed_font_data,int compressed_font_data_size,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges); CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedTTF(ImFontAtlas* self,const void* compressed_font_data,int compressed_font_data_size,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges);
CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(ImFontAtlas* self,const char* compressed_font_data_base85,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges); CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(ImFontAtlas* self,const char* compressed_font_data_base85,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges);
CIMGUI_API void ImFontAtlas_ClearInputData(ImFontAtlas* self); CIMGUI_API void ImFontAtlas_ClearInputData(ImFontAtlas* self);
CIMGUI_API void ImFontAtlas_ClearTexData(ImFontAtlas* self);
CIMGUI_API void ImFontAtlas_ClearFonts(ImFontAtlas* self); CIMGUI_API void ImFontAtlas_ClearFonts(ImFontAtlas* self);
CIMGUI_API void ImFontAtlas_ClearTexData(ImFontAtlas* self);
CIMGUI_API void ImFontAtlas_Clear(ImFontAtlas* self); CIMGUI_API void ImFontAtlas_Clear(ImFontAtlas* self);
CIMGUI_API bool ImFontAtlas_Build(ImFontAtlas* self); CIMGUI_API bool ImFontAtlas_Build(ImFontAtlas* self);
CIMGUI_API void ImFontAtlas_GetTexDataAsAlpha8(ImFontAtlas* self,unsigned char** out_pixels,int* out_width,int* out_height,int* out_bytes_per_pixel); CIMGUI_API void ImFontAtlas_GetTexDataAsAlpha8(ImFontAtlas* self,unsigned char** out_pixels,int* out_width,int* out_height,int* out_bytes_per_pixel);
@@ -4612,6 +4626,7 @@ CIMGUI_API ImGuiWindow* igFindBottomMostVisibleWindowWithinBeginStack(ImGuiWindo
CIMGUI_API void igSetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags flags); CIMGUI_API void igSetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags flags);
CIMGUI_API void igSetCurrentFont(ImFont* font); CIMGUI_API void igSetCurrentFont(ImFont* font);
CIMGUI_API ImFont* igGetDefaultFont(void); CIMGUI_API ImFont* igGetDefaultFont(void);
CIMGUI_API void igPushPasswordFont(void);
CIMGUI_API ImDrawList* igGetForegroundDrawList_WindowPtr(ImGuiWindow* window); CIMGUI_API ImDrawList* igGetForegroundDrawList_WindowPtr(ImGuiWindow* window);
CIMGUI_API void igAddDrawListToDrawDataEx(ImDrawData* draw_data,ImVector_ImDrawListPtr* out_list,ImDrawList* draw_list); CIMGUI_API void igAddDrawListToDrawDataEx(ImDrawData* draw_data,ImVector_ImDrawListPtr* out_list,ImDrawList* draw_list);
CIMGUI_API void igInitialize(void); CIMGUI_API void igInitialize(void);
@@ -4673,7 +4688,7 @@ CIMGUI_API bool igItemAdd(const ImRect bb,ImGuiID id,const ImRect* nav_bb,ImGuiI
CIMGUI_API bool igItemHoverable(const ImRect bb,ImGuiID id,ImGuiItemFlags item_flags); CIMGUI_API bool igItemHoverable(const ImRect bb,ImGuiID id,ImGuiItemFlags item_flags);
CIMGUI_API bool igIsWindowContentHoverable(ImGuiWindow* window,ImGuiHoveredFlags flags); CIMGUI_API bool igIsWindowContentHoverable(ImGuiWindow* window,ImGuiHoveredFlags flags);
CIMGUI_API bool igIsClippedEx(const ImRect bb,ImGuiID id); CIMGUI_API bool igIsClippedEx(const ImRect bb,ImGuiID id);
CIMGUI_API void igSetLastItemData(ImGuiID item_id,ImGuiItemFlags in_flags,ImGuiItemStatusFlags status_flags,const ImRect item_rect); CIMGUI_API void igSetLastItemData(ImGuiID item_id,ImGuiItemFlags item_flags,ImGuiItemStatusFlags status_flags,const ImRect item_rect);
CIMGUI_API void igCalcItemSize(ImVec2 *pOut,ImVec2 size,float default_w,float default_h); CIMGUI_API void igCalcItemSize(ImVec2 *pOut,ImVec2 size,float default_w,float default_h);
CIMGUI_API float igCalcWrapWidthForPos(const ImVec2 pos,float wrap_pos_x); CIMGUI_API float igCalcWrapWidthForPos(const ImVec2 pos,float wrap_pos_x);
CIMGUI_API void igPushMultiItemsWidths(int components,float width_full); CIMGUI_API void igPushMultiItemsWidths(int components,float width_full);
@@ -4904,6 +4919,7 @@ CIMGUI_API void igTabBarQueueReorder(ImGuiTabBar* tab_bar,ImGuiTabItem* tab,int
CIMGUI_API void igTabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar,ImGuiTabItem* tab,ImVec2 mouse_pos); CIMGUI_API void igTabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar,ImGuiTabItem* tab,ImVec2 mouse_pos);
CIMGUI_API bool igTabBarProcessReorder(ImGuiTabBar* tab_bar); CIMGUI_API bool igTabBarProcessReorder(ImGuiTabBar* tab_bar);
CIMGUI_API bool igTabItemEx(ImGuiTabBar* tab_bar,const char* label,bool* p_open,ImGuiTabItemFlags flags,ImGuiWindow* docked_window); CIMGUI_API bool igTabItemEx(ImGuiTabBar* tab_bar,const char* label,bool* p_open,ImGuiTabItemFlags flags,ImGuiWindow* docked_window);
CIMGUI_API void igTabItemSpacing(const char* str_id,ImGuiTabItemFlags flags,float width);
CIMGUI_API void igTabItemCalcSize_Str(ImVec2 *pOut,const char* label,bool has_close_button_or_unsaved_marker); CIMGUI_API void igTabItemCalcSize_Str(ImVec2 *pOut,const char* label,bool has_close_button_or_unsaved_marker);
CIMGUI_API void igTabItemCalcSize_WindowPtr(ImVec2 *pOut,ImGuiWindow* window); CIMGUI_API void igTabItemCalcSize_WindowPtr(ImVec2 *pOut,ImGuiWindow* window);
CIMGUI_API void igTabItemBackground(ImDrawList* draw_list,const ImRect bb,ImGuiTabItemFlags flags,ImU32 col); CIMGUI_API void igTabItemBackground(ImDrawList* draw_list,const ImRect bb,ImGuiTabItemFlags flags,ImU32 col);
@@ -5028,6 +5044,7 @@ CIMGUI_API void igImFontAtlasBuildRender8bppRectFromString(ImFontAtlas* atlas,in
CIMGUI_API void igImFontAtlasBuildRender32bppRectFromString(ImFontAtlas* atlas,int x,int y,int w,int h,const char* in_str,char in_marker_char,unsigned int in_marker_pixel_value); CIMGUI_API void igImFontAtlasBuildRender32bppRectFromString(ImFontAtlas* atlas,int x,int y,int w,int h,const char* in_str,char in_marker_char,unsigned int in_marker_pixel_value);
CIMGUI_API void igImFontAtlasBuildMultiplyCalcLookupTable(unsigned char out_table[256],float in_multiply_factor); CIMGUI_API void igImFontAtlasBuildMultiplyCalcLookupTable(unsigned char out_table[256],float in_multiply_factor);
CIMGUI_API void igImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table[256],unsigned char* pixels,int x,int y,int w,int h,int stride); CIMGUI_API void igImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table[256],unsigned char* pixels,int x,int y,int w,int h,int stride);
CIMGUI_API void igImFontAtlasBuildGetOversampleFactors(const ImFontConfig* cfg,int* out_oversample_h,int* out_oversample_v);
#ifdef IMGUI_ENABLE_FREETYPE #ifdef IMGUI_ENABLE_FREETYPE
CIMGUI_API const ImFontBuilderIO* ImGuiFreeType_GetBuilderForFreeType(void); CIMGUI_API const ImFontBuilderIO* ImGuiFreeType_GetBuilderForFreeType(void);
CIMGUI_API void ImGuiFreeType_SetAllocatorFunctions(void*(*alloc_func)(size_t sz,void* user_data),void(*free_func)(void* ptr,void* user_data),void* user_data); CIMGUI_API void ImGuiFreeType_SetAllocatorFunctions(void*(*alloc_func)(size_t sz,void* user_data),void(*free_func)(void* ptr,void* user_data),void* user_data);

View File

@@ -464,10 +464,11 @@ if #implementations > 0 then
extra_includes = extra_includes .. include_cmd .. inc .. " " extra_includes = extra_includes .. include_cmd .. inc .. " "
end end
end end
parser2.cimgui_inherited = dofile([[../../cimgui/generator/output/structs_and_enums.lua]])
local defines = parser2:take_lines(CPRE..extra_defines..extra_includes..source, {locati}, COMPILER) local defines = parser2:take_lines(CPRE..extra_defines..extra_includes..source, {locati}, COMPILER)
local parser3 = cpp2ffi.Parser() local parser3 = cpp2ffi.Parser()
parser3.cimgui_inherited = dofile([[../../cimgui/generator/output/structs_and_enums.lua]])
parser3:take_lines(CPRE..extra_defines..extra_includes..source, {locati}, COMPILER) parser3:take_lines(CPRE..extra_defines..extra_includes..source, {locati}, COMPILER)
parser3:do_parse() parser3:do_parse()
local cfuncsstr = func_header_impl_generate(parser3) local cfuncsstr = func_header_impl_generate(parser3)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -924,7 +924,7 @@
"cimguiname": "ImGui_ImplSDL3_InitForD3D", "cimguiname": "ImGui_ImplSDL3_InitForD3D",
"defaults": {}, "defaults": {},
"funcname": "ImGui_ImplSDL3_InitForD3D", "funcname": "ImGui_ImplSDL3_InitForD3D",
"location": "imgui_impl_sdl3:38", "location": "imgui_impl_sdl3:36",
"ov_cimguiname": "ImGui_ImplSDL3_InitForD3D", "ov_cimguiname": "ImGui_ImplSDL3_InitForD3D",
"ret": "bool", "ret": "bool",
"signature": "(SDL_Window*)", "signature": "(SDL_Window*)",
@@ -945,7 +945,7 @@
"cimguiname": "ImGui_ImplSDL3_InitForMetal", "cimguiname": "ImGui_ImplSDL3_InitForMetal",
"defaults": {}, "defaults": {},
"funcname": "ImGui_ImplSDL3_InitForMetal", "funcname": "ImGui_ImplSDL3_InitForMetal",
"location": "imgui_impl_sdl3:39", "location": "imgui_impl_sdl3:37",
"ov_cimguiname": "ImGui_ImplSDL3_InitForMetal", "ov_cimguiname": "ImGui_ImplSDL3_InitForMetal",
"ret": "bool", "ret": "bool",
"signature": "(SDL_Window*)", "signature": "(SDL_Window*)",
@@ -970,7 +970,7 @@
"cimguiname": "ImGui_ImplSDL3_InitForOpenGL", "cimguiname": "ImGui_ImplSDL3_InitForOpenGL",
"defaults": {}, "defaults": {},
"funcname": "ImGui_ImplSDL3_InitForOpenGL", "funcname": "ImGui_ImplSDL3_InitForOpenGL",
"location": "imgui_impl_sdl3:36", "location": "imgui_impl_sdl3:34",
"ov_cimguiname": "ImGui_ImplSDL3_InitForOpenGL", "ov_cimguiname": "ImGui_ImplSDL3_InitForOpenGL",
"ret": "bool", "ret": "bool",
"signature": "(SDL_Window*,void*)", "signature": "(SDL_Window*,void*)",
@@ -991,7 +991,7 @@
"cimguiname": "ImGui_ImplSDL3_InitForOther", "cimguiname": "ImGui_ImplSDL3_InitForOther",
"defaults": {}, "defaults": {},
"funcname": "ImGui_ImplSDL3_InitForOther", "funcname": "ImGui_ImplSDL3_InitForOther",
"location": "imgui_impl_sdl3:42", "location": "imgui_impl_sdl3:40",
"ov_cimguiname": "ImGui_ImplSDL3_InitForOther", "ov_cimguiname": "ImGui_ImplSDL3_InitForOther",
"ret": "bool", "ret": "bool",
"signature": "(SDL_Window*)", "signature": "(SDL_Window*)",
@@ -1012,7 +1012,7 @@
"cimguiname": "ImGui_ImplSDL3_InitForSDLGPU", "cimguiname": "ImGui_ImplSDL3_InitForSDLGPU",
"defaults": {}, "defaults": {},
"funcname": "ImGui_ImplSDL3_InitForSDLGPU", "funcname": "ImGui_ImplSDL3_InitForSDLGPU",
"location": "imgui_impl_sdl3:41", "location": "imgui_impl_sdl3:39",
"ov_cimguiname": "ImGui_ImplSDL3_InitForSDLGPU", "ov_cimguiname": "ImGui_ImplSDL3_InitForSDLGPU",
"ret": "bool", "ret": "bool",
"signature": "(SDL_Window*)", "signature": "(SDL_Window*)",
@@ -1037,7 +1037,7 @@
"cimguiname": "ImGui_ImplSDL3_InitForSDLRenderer", "cimguiname": "ImGui_ImplSDL3_InitForSDLRenderer",
"defaults": {}, "defaults": {},
"funcname": "ImGui_ImplSDL3_InitForSDLRenderer", "funcname": "ImGui_ImplSDL3_InitForSDLRenderer",
"location": "imgui_impl_sdl3:40", "location": "imgui_impl_sdl3:38",
"ov_cimguiname": "ImGui_ImplSDL3_InitForSDLRenderer", "ov_cimguiname": "ImGui_ImplSDL3_InitForSDLRenderer",
"ret": "bool", "ret": "bool",
"signature": "(SDL_Window*,SDL_Renderer*)", "signature": "(SDL_Window*,SDL_Renderer*)",
@@ -1058,7 +1058,7 @@
"cimguiname": "ImGui_ImplSDL3_InitForVulkan", "cimguiname": "ImGui_ImplSDL3_InitForVulkan",
"defaults": {}, "defaults": {},
"funcname": "ImGui_ImplSDL3_InitForVulkan", "funcname": "ImGui_ImplSDL3_InitForVulkan",
"location": "imgui_impl_sdl3:37", "location": "imgui_impl_sdl3:35",
"ov_cimguiname": "ImGui_ImplSDL3_InitForVulkan", "ov_cimguiname": "ImGui_ImplSDL3_InitForVulkan",
"ret": "bool", "ret": "bool",
"signature": "(SDL_Window*)", "signature": "(SDL_Window*)",
@@ -1074,7 +1074,7 @@
"cimguiname": "ImGui_ImplSDL3_NewFrame", "cimguiname": "ImGui_ImplSDL3_NewFrame",
"defaults": {}, "defaults": {},
"funcname": "ImGui_ImplSDL3_NewFrame", "funcname": "ImGui_ImplSDL3_NewFrame",
"location": "imgui_impl_sdl3:44", "location": "imgui_impl_sdl3:42",
"ov_cimguiname": "ImGui_ImplSDL3_NewFrame", "ov_cimguiname": "ImGui_ImplSDL3_NewFrame",
"ret": "void", "ret": "void",
"signature": "()", "signature": "()",
@@ -1095,7 +1095,7 @@
"cimguiname": "ImGui_ImplSDL3_ProcessEvent", "cimguiname": "ImGui_ImplSDL3_ProcessEvent",
"defaults": {}, "defaults": {},
"funcname": "ImGui_ImplSDL3_ProcessEvent", "funcname": "ImGui_ImplSDL3_ProcessEvent",
"location": "imgui_impl_sdl3:45", "location": "imgui_impl_sdl3:43",
"ov_cimguiname": "ImGui_ImplSDL3_ProcessEvent", "ov_cimguiname": "ImGui_ImplSDL3_ProcessEvent",
"ret": "bool", "ret": "bool",
"signature": "(const SDL_Event*)", "signature": "(const SDL_Event*)",
@@ -1127,7 +1127,7 @@
"manual_gamepads_count": "-1" "manual_gamepads_count": "-1"
}, },
"funcname": "ImGui_ImplSDL3_SetGamepadMode", "funcname": "ImGui_ImplSDL3_SetGamepadMode",
"location": "imgui_impl_sdl3:50", "location": "imgui_impl_sdl3:48",
"ov_cimguiname": "ImGui_ImplSDL3_SetGamepadMode", "ov_cimguiname": "ImGui_ImplSDL3_SetGamepadMode",
"ret": "void", "ret": "void",
"signature": "(ImGui_ImplSDL3_GamepadMode,SDL_Gamepad**,int)", "signature": "(ImGui_ImplSDL3_GamepadMode,SDL_Gamepad**,int)",
@@ -1143,7 +1143,7 @@
"cimguiname": "ImGui_ImplSDL3_Shutdown", "cimguiname": "ImGui_ImplSDL3_Shutdown",
"defaults": {}, "defaults": {},
"funcname": "ImGui_ImplSDL3_Shutdown", "funcname": "ImGui_ImplSDL3_Shutdown",
"location": "imgui_impl_sdl3:43", "location": "imgui_impl_sdl3:41",
"ov_cimguiname": "ImGui_ImplSDL3_Shutdown", "ov_cimguiname": "ImGui_ImplSDL3_Shutdown",
"ret": "void", "ret": "void",
"signature": "()", "signature": "()",

View File

@@ -803,7 +803,7 @@ local t={
cimguiname="ImGui_ImplSDL3_InitForD3D", cimguiname="ImGui_ImplSDL3_InitForD3D",
defaults={}, defaults={},
funcname="ImGui_ImplSDL3_InitForD3D", funcname="ImGui_ImplSDL3_InitForD3D",
location="imgui_impl_sdl3:38", location="imgui_impl_sdl3:36",
ov_cimguiname="ImGui_ImplSDL3_InitForD3D", ov_cimguiname="ImGui_ImplSDL3_InitForD3D",
ret="bool", ret="bool",
signature="(SDL_Window*)", signature="(SDL_Window*)",
@@ -821,7 +821,7 @@ local t={
cimguiname="ImGui_ImplSDL3_InitForMetal", cimguiname="ImGui_ImplSDL3_InitForMetal",
defaults={}, defaults={},
funcname="ImGui_ImplSDL3_InitForMetal", funcname="ImGui_ImplSDL3_InitForMetal",
location="imgui_impl_sdl3:39", location="imgui_impl_sdl3:37",
ov_cimguiname="ImGui_ImplSDL3_InitForMetal", ov_cimguiname="ImGui_ImplSDL3_InitForMetal",
ret="bool", ret="bool",
signature="(SDL_Window*)", signature="(SDL_Window*)",
@@ -842,7 +842,7 @@ local t={
cimguiname="ImGui_ImplSDL3_InitForOpenGL", cimguiname="ImGui_ImplSDL3_InitForOpenGL",
defaults={}, defaults={},
funcname="ImGui_ImplSDL3_InitForOpenGL", funcname="ImGui_ImplSDL3_InitForOpenGL",
location="imgui_impl_sdl3:36", location="imgui_impl_sdl3:34",
ov_cimguiname="ImGui_ImplSDL3_InitForOpenGL", ov_cimguiname="ImGui_ImplSDL3_InitForOpenGL",
ret="bool", ret="bool",
signature="(SDL_Window*,void*)", signature="(SDL_Window*,void*)",
@@ -860,7 +860,7 @@ local t={
cimguiname="ImGui_ImplSDL3_InitForOther", cimguiname="ImGui_ImplSDL3_InitForOther",
defaults={}, defaults={},
funcname="ImGui_ImplSDL3_InitForOther", funcname="ImGui_ImplSDL3_InitForOther",
location="imgui_impl_sdl3:42", location="imgui_impl_sdl3:40",
ov_cimguiname="ImGui_ImplSDL3_InitForOther", ov_cimguiname="ImGui_ImplSDL3_InitForOther",
ret="bool", ret="bool",
signature="(SDL_Window*)", signature="(SDL_Window*)",
@@ -878,7 +878,7 @@ local t={
cimguiname="ImGui_ImplSDL3_InitForSDLGPU", cimguiname="ImGui_ImplSDL3_InitForSDLGPU",
defaults={}, defaults={},
funcname="ImGui_ImplSDL3_InitForSDLGPU", funcname="ImGui_ImplSDL3_InitForSDLGPU",
location="imgui_impl_sdl3:41", location="imgui_impl_sdl3:39",
ov_cimguiname="ImGui_ImplSDL3_InitForSDLGPU", ov_cimguiname="ImGui_ImplSDL3_InitForSDLGPU",
ret="bool", ret="bool",
signature="(SDL_Window*)", signature="(SDL_Window*)",
@@ -899,7 +899,7 @@ local t={
cimguiname="ImGui_ImplSDL3_InitForSDLRenderer", cimguiname="ImGui_ImplSDL3_InitForSDLRenderer",
defaults={}, defaults={},
funcname="ImGui_ImplSDL3_InitForSDLRenderer", funcname="ImGui_ImplSDL3_InitForSDLRenderer",
location="imgui_impl_sdl3:40", location="imgui_impl_sdl3:38",
ov_cimguiname="ImGui_ImplSDL3_InitForSDLRenderer", ov_cimguiname="ImGui_ImplSDL3_InitForSDLRenderer",
ret="bool", ret="bool",
signature="(SDL_Window*,SDL_Renderer*)", signature="(SDL_Window*,SDL_Renderer*)",
@@ -917,7 +917,7 @@ local t={
cimguiname="ImGui_ImplSDL3_InitForVulkan", cimguiname="ImGui_ImplSDL3_InitForVulkan",
defaults={}, defaults={},
funcname="ImGui_ImplSDL3_InitForVulkan", funcname="ImGui_ImplSDL3_InitForVulkan",
location="imgui_impl_sdl3:37", location="imgui_impl_sdl3:35",
ov_cimguiname="ImGui_ImplSDL3_InitForVulkan", ov_cimguiname="ImGui_ImplSDL3_InitForVulkan",
ret="bool", ret="bool",
signature="(SDL_Window*)", signature="(SDL_Window*)",
@@ -932,7 +932,7 @@ local t={
cimguiname="ImGui_ImplSDL3_NewFrame", cimguiname="ImGui_ImplSDL3_NewFrame",
defaults={}, defaults={},
funcname="ImGui_ImplSDL3_NewFrame", funcname="ImGui_ImplSDL3_NewFrame",
location="imgui_impl_sdl3:44", location="imgui_impl_sdl3:42",
ov_cimguiname="ImGui_ImplSDL3_NewFrame", ov_cimguiname="ImGui_ImplSDL3_NewFrame",
ret="void", ret="void",
signature="()", signature="()",
@@ -950,7 +950,7 @@ local t={
cimguiname="ImGui_ImplSDL3_ProcessEvent", cimguiname="ImGui_ImplSDL3_ProcessEvent",
defaults={}, defaults={},
funcname="ImGui_ImplSDL3_ProcessEvent", funcname="ImGui_ImplSDL3_ProcessEvent",
location="imgui_impl_sdl3:45", location="imgui_impl_sdl3:43",
ov_cimguiname="ImGui_ImplSDL3_ProcessEvent", ov_cimguiname="ImGui_ImplSDL3_ProcessEvent",
ret="bool", ret="bool",
signature="(const SDL_Event*)", signature="(const SDL_Event*)",
@@ -976,7 +976,7 @@ local t={
manual_gamepads_array="nullptr", manual_gamepads_array="nullptr",
manual_gamepads_count="-1"}, manual_gamepads_count="-1"},
funcname="ImGui_ImplSDL3_SetGamepadMode", funcname="ImGui_ImplSDL3_SetGamepadMode",
location="imgui_impl_sdl3:50", location="imgui_impl_sdl3:48",
ov_cimguiname="ImGui_ImplSDL3_SetGamepadMode", ov_cimguiname="ImGui_ImplSDL3_SetGamepadMode",
ret="void", ret="void",
signature="(ImGui_ImplSDL3_GamepadMode,SDL_Gamepad**,int)", signature="(ImGui_ImplSDL3_GamepadMode,SDL_Gamepad**,int)",
@@ -991,7 +991,7 @@ local t={
cimguiname="ImGui_ImplSDL3_Shutdown", cimguiname="ImGui_ImplSDL3_Shutdown",
defaults={}, defaults={},
funcname="ImGui_ImplSDL3_Shutdown", funcname="ImGui_ImplSDL3_Shutdown",
location="imgui_impl_sdl3:43", location="imgui_impl_sdl3:41",
ov_cimguiname="ImGui_ImplSDL3_Shutdown", ov_cimguiname="ImGui_ImplSDL3_Shutdown",
ret="void", ret="void",
signature="()", signature="()",

View File

@@ -736,21 +736,26 @@
"name": "ImGuiColorEditFlags_NoBorder", "name": "ImGuiColorEditFlags_NoBorder",
"value": "1 << 10" "value": "1 << 10"
}, },
{
"calc_value": 2048,
"name": "ImGuiColorEditFlags_AlphaOpaque",
"value": "1 << 11"
},
{
"calc_value": 4096,
"name": "ImGuiColorEditFlags_AlphaNoBg",
"value": "1 << 12"
},
{
"calc_value": 8192,
"name": "ImGuiColorEditFlags_AlphaPreviewHalf",
"value": "1 << 13"
},
{ {
"calc_value": 65536, "calc_value": 65536,
"name": "ImGuiColorEditFlags_AlphaBar", "name": "ImGuiColorEditFlags_AlphaBar",
"value": "1 << 16" "value": "1 << 16"
}, },
{
"calc_value": 131072,
"name": "ImGuiColorEditFlags_AlphaPreview",
"value": "1 << 17"
},
{
"calc_value": 262144,
"name": "ImGuiColorEditFlags_AlphaPreviewHalf",
"value": "1 << 18"
},
{ {
"calc_value": 524288, "calc_value": 524288,
"name": "ImGuiColorEditFlags_HDR", "name": "ImGuiColorEditFlags_HDR",
@@ -806,6 +811,11 @@
"name": "ImGuiColorEditFlags_DefaultOptions_", "name": "ImGuiColorEditFlags_DefaultOptions_",
"value": "ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_PickerHueBar" "value": "ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_PickerHueBar"
}, },
{
"calc_value": 14338,
"name": "ImGuiColorEditFlags_AlphaMask_",
"value": "ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaOpaque | ImGuiColorEditFlags_AlphaNoBg | ImGuiColorEditFlags_AlphaPreviewHalf"
},
{ {
"calc_value": 7340032, "calc_value": 7340032,
"name": "ImGuiColorEditFlags_DisplayMask_", "name": "ImGuiColorEditFlags_DisplayMask_",
@@ -4242,8 +4252,13 @@
}, },
{ {
"calc_value": 4194304, "calc_value": 4194304,
"name": "ImGuiTabItemFlags_Unsorted", "name": "ImGuiTabItemFlags_Invisible",
"value": "1 << 22" "value": "1 << 22"
},
{
"calc_value": 8388608,
"name": "ImGuiTabItemFlags_Unsorted",
"value": "1 << 23"
} }
], ],
"ImGuiTabItemFlags_": [ "ImGuiTabItemFlags_": [
@@ -5061,6 +5076,11 @@
"name": "ImGuiWindowFlags_NoInputs", "name": "ImGuiWindowFlags_NoInputs",
"value": "ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus" "value": "ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus"
}, },
{
"calc_value": 8388608,
"name": "ImGuiWindowFlags_DockNodeHost",
"value": "1 << 23"
},
{ {
"calc_value": 16777216, "calc_value": 16777216,
"name": "ImGuiWindowFlags_ChildWindow", "name": "ImGuiWindowFlags_ChildWindow",
@@ -5085,11 +5105,6 @@
"calc_value": 268435456, "calc_value": 268435456,
"name": "ImGuiWindowFlags_ChildMenu", "name": "ImGuiWindowFlags_ChildMenu",
"value": "1 << 28" "value": "1 << 28"
},
{
"calc_value": 536870912,
"name": "ImGuiWindowFlags_DockNodeHost",
"value": "1 << 29"
} }
], ],
"ImGuiWindowRefreshFlags_": [ "ImGuiWindowRefreshFlags_": [
@@ -5123,204 +5138,204 @@
"ImGuiSortDirection": "ImU8" "ImGuiSortDirection": "ImU8"
}, },
"locations": { "locations": {
"ImBitVector": "imgui_internal:616", "ImBitVector": "imgui_internal:623",
"ImColor": "imgui:2869", "ImColor": "imgui:2883",
"ImDrawChannel": "imgui:3109", "ImDrawChannel": "imgui:3123",
"ImDrawCmd": "imgui:3066", "ImDrawCmd": "imgui:3080",
"ImDrawCmdHeader": "imgui:3101", "ImDrawCmdHeader": "imgui:3115",
"ImDrawData": "imgui:3326", "ImDrawData": "imgui:3339",
"ImDrawDataBuilder": "imgui_internal:805", "ImDrawDataBuilder": "imgui_internal:813",
"ImDrawFlags_": "imgui:3135", "ImDrawFlags_": "imgui:3148",
"ImDrawList": "imgui:3173", "ImDrawList": "imgui:3186",
"ImDrawListFlags_": "imgui:3155", "ImDrawListFlags_": "imgui:3168",
"ImDrawListSharedData": "imgui_internal:783", "ImDrawListSharedData": "imgui_internal:791",
"ImDrawListSplitter": "imgui:3118", "ImDrawListSplitter": "imgui:3131",
"ImDrawVert": "imgui:3086", "ImDrawVert": "imgui:3100",
"ImFont": "imgui:3552", "ImFont": "imgui:3566",
"ImFontAtlas": "imgui:3448", "ImFontAtlas": "imgui:3462",
"ImFontAtlasCustomRect": "imgui:3407", "ImFontAtlasCustomRect": "imgui:3421",
"ImFontAtlasFlags_": "imgui:3423", "ImFontAtlasFlags_": "imgui:3437",
"ImFontBuilderIO": "imgui_internal:3849", "ImFontBuilderIO": "imgui_internal:3867",
"ImFontConfig": "imgui:3350", "ImFontConfig": "imgui:3364",
"ImFontGlyph": "imgui:3380", "ImFontGlyph": "imgui:3394",
"ImFontGlyphRangesBuilder": "imgui:3392", "ImFontGlyphRangesBuilder": "imgui:3406",
"ImGuiActivateFlags_": "imgui_internal:1573", "ImGuiActivateFlags_": "imgui_internal:1581",
"ImGuiAxis": "imgui_internal:1030", "ImGuiAxis": "imgui_internal:1038",
"ImGuiBackendFlags_": "imgui:1672", "ImGuiBackendFlags_": "imgui:1675",
"ImGuiBoxSelectState": "imgui_internal:1762", "ImGuiBoxSelectState": "imgui_internal:1770",
"ImGuiButtonFlagsPrivate_": "imgui_internal:920", "ImGuiButtonFlagsPrivate_": "imgui_internal:928",
"ImGuiButtonFlags_": "imgui:1806", "ImGuiButtonFlags_": "imgui:1809",
"ImGuiChildFlags_": "imgui:1155", "ImGuiChildFlags_": "imgui:1158",
"ImGuiCol_": "imgui:1687", "ImGuiCol_": "imgui:1690",
"ImGuiColorEditFlags_": "imgui:1817", "ImGuiColorEditFlags_": "imgui:1820",
"ImGuiColorMod": "imgui_internal:1044", "ImGuiColorMod": "imgui_internal:1052",
"ImGuiComboFlagsPrivate_": "imgui_internal:945", "ImGuiComboFlagsPrivate_": "imgui_internal:953",
"ImGuiComboFlags_": "imgui:1303", "ImGuiComboFlags_": "imgui:1306",
"ImGuiComboPreviewData": "imgui_internal:1061", "ImGuiComboPreviewData": "imgui_internal:1069",
"ImGuiCond_": "imgui:1919", "ImGuiCond_": "imgui:1932",
"ImGuiConfigFlags_": "imgui:1643", "ImGuiConfigFlags_": "imgui:1646",
"ImGuiContext": "imgui_internal:2233", "ImGuiContext": "imgui_internal:2241",
"ImGuiContextHook": "imgui_internal:2218", "ImGuiContextHook": "imgui_internal:2226",
"ImGuiContextHookType": "imgui_internal:2216", "ImGuiContextHookType": "imgui_internal:2224",
"ImGuiDataAuthority_": "imgui_internal:1875", "ImGuiDataAuthority_": "imgui_internal:1883",
"ImGuiDataTypeInfo": "imgui_internal:831", "ImGuiDataTypeInfo": "imgui_internal:839",
"ImGuiDataTypePrivate_": "imgui_internal:840", "ImGuiDataTypePrivate_": "imgui_internal:848",
"ImGuiDataTypeStorage": "imgui_internal:825", "ImGuiDataTypeStorage": "imgui_internal:833",
"ImGuiDataType_": "imgui:1451", "ImGuiDataType_": "imgui:1454",
"ImGuiDataVarInfo": "imgui_internal:817", "ImGuiDataVarInfo": "imgui_internal:825",
"ImGuiDeactivatedItemData": "imgui_internal:1338", "ImGuiDeactivatedItemData": "imgui_internal:1346",
"ImGuiDebugAllocEntry": "imgui_internal:2152", "ImGuiDebugAllocEntry": "imgui_internal:2160",
"ImGuiDebugAllocInfo": "imgui_internal:2159", "ImGuiDebugAllocInfo": "imgui_internal:2167",
"ImGuiDebugLogFlags_": "imgui_internal:2130", "ImGuiDebugLogFlags_": "imgui_internal:2138",
"ImGuiDir": "imgui:1469", "ImGuiDir": "imgui:1472",
"ImGuiDockContext": "imgui_internal:1977", "ImGuiDockContext": "imgui_internal:1985",
"ImGuiDockNode": "imgui_internal:1891", "ImGuiDockNode": "imgui_internal:1899",
"ImGuiDockNodeFlagsPrivate_": "imgui_internal:1843", "ImGuiDockNodeFlagsPrivate_": "imgui_internal:1851",
"ImGuiDockNodeFlags_": "imgui:1404", "ImGuiDockNodeFlags_": "imgui:1407",
"ImGuiDockNodeState": "imgui_internal:1882", "ImGuiDockNodeState": "imgui_internal:1890",
"ImGuiDragDropFlags_": "imgui:1423", "ImGuiDragDropFlags_": "imgui:1426",
"ImGuiErrorRecoveryState": "imgui_internal:1295", "ImGuiErrorRecoveryState": "imgui_internal:1303",
"ImGuiFocusRequestFlags_": "imgui_internal:990", "ImGuiFocusRequestFlags_": "imgui_internal:998",
"ImGuiFocusScopeData": "imgui_internal:1659", "ImGuiFocusScopeData": "imgui_internal:1667",
"ImGuiFocusedFlags_": "imgui:1350", "ImGuiFocusedFlags_": "imgui:1353",
"ImGuiFreeTypeBuilderFlags": "imgui_freetype:26", "ImGuiFreeTypeBuilderFlags": "imgui_freetype:26",
"ImGuiGroupData": "imgui_internal:1074", "ImGuiGroupData": "imgui_internal:1082",
"ImGuiHoveredFlagsPrivate_": "imgui_internal:903", "ImGuiHoveredFlagsPrivate_": "imgui_internal:911",
"ImGuiHoveredFlags_": "imgui:1364", "ImGuiHoveredFlags_": "imgui:1367",
"ImGuiIDStackTool": "imgui_internal:2199", "ImGuiIDStackTool": "imgui_internal:2207",
"ImGuiIO": "imgui:2292", "ImGuiIO": "imgui:2305",
"ImGuiInputEvent": "imgui_internal:1433", "ImGuiInputEvent": "imgui_internal:1441",
"ImGuiInputEventAppFocused": "imgui_internal:1431", "ImGuiInputEventAppFocused": "imgui_internal:1439",
"ImGuiInputEventKey": "imgui_internal:1429", "ImGuiInputEventKey": "imgui_internal:1437",
"ImGuiInputEventMouseButton": "imgui_internal:1427", "ImGuiInputEventMouseButton": "imgui_internal:1435",
"ImGuiInputEventMousePos": "imgui_internal:1425", "ImGuiInputEventMousePos": "imgui_internal:1433",
"ImGuiInputEventMouseViewport": "imgui_internal:1428", "ImGuiInputEventMouseViewport": "imgui_internal:1436",
"ImGuiInputEventMouseWheel": "imgui_internal:1426", "ImGuiInputEventMouseWheel": "imgui_internal:1434",
"ImGuiInputEventText": "imgui_internal:1430", "ImGuiInputEventText": "imgui_internal:1438",
"ImGuiInputEventType": "imgui_internal:1401", "ImGuiInputEventType": "imgui_internal:1409",
"ImGuiInputFlagsPrivate_": "imgui_internal:1500", "ImGuiInputFlagsPrivate_": "imgui_internal:1508",
"ImGuiInputFlags_": "imgui:1620", "ImGuiInputFlags_": "imgui:1623",
"ImGuiInputSource": "imgui_internal:1414", "ImGuiInputSource": "imgui_internal:1422",
"ImGuiInputTextCallbackData": "imgui:2546", "ImGuiInputTextCallbackData": "imgui:2560",
"ImGuiInputTextDeactivatedState": "imgui_internal:1110", "ImGuiInputTextDeactivatedState": "imgui_internal:1118",
"ImGuiInputTextFlagsPrivate_": "imgui_internal:911", "ImGuiInputTextFlagsPrivate_": "imgui_internal:919",
"ImGuiInputTextFlags_": "imgui:1189", "ImGuiInputTextFlags_": "imgui:1192",
"ImGuiInputTextState": "imgui_internal:1132", "ImGuiInputTextState": "imgui_internal:1140",
"ImGuiItemFlagsPrivate_": "imgui_internal:853", "ImGuiItemFlagsPrivate_": "imgui_internal:861",
"ImGuiItemFlags_": "imgui:1176", "ImGuiItemFlags_": "imgui:1179",
"ImGuiItemStatusFlags_": "imgui_internal:877", "ImGuiItemStatusFlags_": "imgui_internal:885",
"ImGuiKey": "imgui:1493", "ImGuiKey": "imgui:1496",
"ImGuiKeyData": "imgui:2284", "ImGuiKeyData": "imgui:2297",
"ImGuiKeyOwnerData": "imgui_internal:1487", "ImGuiKeyOwnerData": "imgui_internal:1495",
"ImGuiKeyRoutingData": "imgui_internal:1461", "ImGuiKeyRoutingData": "imgui_internal:1469",
"ImGuiKeyRoutingTable": "imgui_internal:1475", "ImGuiKeyRoutingTable": "imgui_internal:1483",
"ImGuiLastItemData": "imgui_internal:1267", "ImGuiLastItemData": "imgui_internal:1275",
"ImGuiLayoutType_": "imgui_internal:1011", "ImGuiLayoutType_": "imgui_internal:1019",
"ImGuiListClipper": "imgui:2775", "ImGuiListClipper": "imgui:2789",
"ImGuiListClipperData": "imgui_internal:1557", "ImGuiListClipperData": "imgui_internal:1565",
"ImGuiListClipperRange": "imgui_internal:1544", "ImGuiListClipperRange": "imgui_internal:1552",
"ImGuiLocEntry": "imgui_internal:2103", "ImGuiLocEntry": "imgui_internal:2111",
"ImGuiLocKey": "imgui_internal:2085", "ImGuiLocKey": "imgui_internal:2093",
"ImGuiLogFlags_": "imgui_internal:1018", "ImGuiLogFlags_": "imgui_internal:1026",
"ImGuiMenuColumns": "imgui_internal:1092", "ImGuiMenuColumns": "imgui_internal:1100",
"ImGuiMetricsConfig": "imgui_internal:2169", "ImGuiMetricsConfig": "imgui_internal:2177",
"ImGuiMouseButton_": "imgui:1879", "ImGuiMouseButton_": "imgui:1892",
"ImGuiMouseCursor_": "imgui:1889", "ImGuiMouseCursor_": "imgui:1902",
"ImGuiMouseSource": "imgui:1908", "ImGuiMouseSource": "imgui:1921",
"ImGuiMultiSelectFlags_": "imgui:2927", "ImGuiMultiSelectFlags_": "imgui:2941",
"ImGuiMultiSelectIO": "imgui:2954", "ImGuiMultiSelectIO": "imgui:2968",
"ImGuiMultiSelectState": "imgui_internal:1819", "ImGuiMultiSelectState": "imgui_internal:1827",
"ImGuiMultiSelectTempData": "imgui_internal:1794", "ImGuiMultiSelectTempData": "imgui_internal:1802",
"ImGuiNavItemData": "imgui_internal:1642", "ImGuiNavItemData": "imgui_internal:1650",
"ImGuiNavLayer": "imgui_internal:1634", "ImGuiNavLayer": "imgui_internal:1642",
"ImGuiNavMoveFlags_": "imgui_internal:1612", "ImGuiNavMoveFlags_": "imgui_internal:1620",
"ImGuiNavRenderCursorFlags_": "imgui_internal:1598", "ImGuiNavRenderCursorFlags_": "imgui_internal:1606",
"ImGuiNextItemData": "imgui_internal:1247", "ImGuiNextItemData": "imgui_internal:1255",
"ImGuiNextItemDataFlags_": "imgui_internal:1237", "ImGuiNextItemDataFlags_": "imgui_internal:1245",
"ImGuiNextWindowData": "imgui_internal:1208", "ImGuiNextWindowData": "imgui_internal:1216",
"ImGuiNextWindowDataFlags_": "imgui_internal:1189", "ImGuiNextWindowDataFlags_": "imgui_internal:1197",
"ImGuiOldColumnData": "imgui_internal:1727", "ImGuiOldColumnData": "imgui_internal:1735",
"ImGuiOldColumnFlags_": "imgui_internal:1707", "ImGuiOldColumnFlags_": "imgui_internal:1715",
"ImGuiOldColumns": "imgui_internal:1737", "ImGuiOldColumns": "imgui_internal:1745",
"ImGuiOnceUponAFrame": "imgui:2646", "ImGuiOnceUponAFrame": "imgui:2660",
"ImGuiPayload": "imgui:2611", "ImGuiPayload": "imgui:2625",
"ImGuiPlatformIO": "imgui:3724", "ImGuiPlatformIO": "imgui:3738",
"ImGuiPlatformImeData": "imgui:3830", "ImGuiPlatformImeData": "imgui:3844",
"ImGuiPlatformMonitor": "imgui:3820", "ImGuiPlatformMonitor": "imgui:3834",
"ImGuiPlotType": "imgui_internal:1037", "ImGuiPlotType": "imgui_internal:1045",
"ImGuiPopupData": "imgui_internal:1358", "ImGuiPopupData": "imgui_internal:1366",
"ImGuiPopupFlags_": "imgui:1268", "ImGuiPopupFlags_": "imgui:1271",
"ImGuiPopupPositionPolicy": "imgui_internal:1350", "ImGuiPopupPositionPolicy": "imgui_internal:1358",
"ImGuiPtrOrIndex": "imgui_internal:1328", "ImGuiPtrOrIndex": "imgui_internal:1336",
"ImGuiScrollFlags_": "imgui_internal:1584", "ImGuiScrollFlags_": "imgui_internal:1592",
"ImGuiSelectableFlagsPrivate_": "imgui_internal:958", "ImGuiSelectableFlagsPrivate_": "imgui_internal:966",
"ImGuiSelectableFlags_": "imgui:1286", "ImGuiSelectableFlags_": "imgui:1289",
"ImGuiSelectionBasicStorage": "imgui:3000", "ImGuiSelectionBasicStorage": "imgui:3014",
"ImGuiSelectionExternalStorage": "imgui:3023", "ImGuiSelectionExternalStorage": "imgui:3037",
"ImGuiSelectionRequest": "imgui:2974", "ImGuiSelectionRequest": "imgui:2988",
"ImGuiSelectionRequestType": "imgui:2966", "ImGuiSelectionRequestType": "imgui:2980",
"ImGuiSeparatorFlags_": "imgui_internal:979", "ImGuiSeparatorFlags_": "imgui_internal:987",
"ImGuiSettingsHandler": "imgui_internal:2065", "ImGuiSettingsHandler": "imgui_internal:2073",
"ImGuiShrinkWidthItem": "imgui_internal:1321", "ImGuiShrinkWidthItem": "imgui_internal:1329",
"ImGuiSizeCallbackData": "imgui:2580", "ImGuiSizeCallbackData": "imgui:2594",
"ImGuiSliderFlagsPrivate_": "imgui_internal:951", "ImGuiSliderFlagsPrivate_": "imgui_internal:959",
"ImGuiSliderFlags_": "imgui:1863", "ImGuiSliderFlags_": "imgui:1876",
"ImGuiSortDirection": "imgui:1480", "ImGuiSortDirection": "imgui:1483",
"ImGuiStackLevelInfo": "imgui_internal:2187", "ImGuiStackLevelInfo": "imgui_internal:2195",
"ImGuiStorage": "imgui:2718", "ImGuiStorage": "imgui:2732",
"ImGuiStoragePair": "imgui:2701", "ImGuiStoragePair": "imgui:2715",
"ImGuiStyle": "imgui:2206", "ImGuiStyle": "imgui:2219",
"ImGuiStyleMod": "imgui_internal:1051", "ImGuiStyleMod": "imgui_internal:1059",
"ImGuiStyleVar_": "imgui:1765", "ImGuiStyleVar_": "imgui:1768",
"ImGuiTabBar": "imgui_internal:2862", "ImGuiTabBar": "imgui_internal:2877",
"ImGuiTabBarFlagsPrivate_": "imgui_internal:2825", "ImGuiTabBarFlagsPrivate_": "imgui_internal:2839",
"ImGuiTabBarFlags_": "imgui:1318", "ImGuiTabBarFlags_": "imgui:1321",
"ImGuiTabItem": "imgui_internal:2842", "ImGuiTabItem": "imgui_internal:2857",
"ImGuiTabItemFlagsPrivate_": "imgui_internal:2833", "ImGuiTabItemFlagsPrivate_": "imgui_internal:2847",
"ImGuiTabItemFlags_": "imgui:1335", "ImGuiTabItemFlags_": "imgui:1338",
"ImGuiTable": "imgui_internal:3009", "ImGuiTable": "imgui_internal:3024",
"ImGuiTableBgTarget_": "imgui:2060", "ImGuiTableBgTarget_": "imgui:2073",
"ImGuiTableCellData": "imgui_internal:2977", "ImGuiTableCellData": "imgui_internal:2992",
"ImGuiTableColumn": "imgui_internal:2917", "ImGuiTableColumn": "imgui_internal:2932",
"ImGuiTableColumnFlags_": "imgui:2007", "ImGuiTableColumnFlags_": "imgui:2020",
"ImGuiTableColumnSettings": "imgui_internal:3156", "ImGuiTableColumnSettings": "imgui_internal:3172",
"ImGuiTableColumnSortSpecs": "imgui:2082", "ImGuiTableColumnSortSpecs": "imgui:2095",
"ImGuiTableFlags_": "imgui:1954", "ImGuiTableFlags_": "imgui:1967",
"ImGuiTableHeaderData": "imgui_internal:2986", "ImGuiTableHeaderData": "imgui_internal:3001",
"ImGuiTableInstanceData": "imgui_internal:2996", "ImGuiTableInstanceData": "imgui_internal:3011",
"ImGuiTableRowFlags_": "imgui:2045", "ImGuiTableRowFlags_": "imgui:2058",
"ImGuiTableSettings": "imgui_internal:3180", "ImGuiTableSettings": "imgui_internal:3196",
"ImGuiTableSortSpecs": "imgui:2072", "ImGuiTableSortSpecs": "imgui:2085",
"ImGuiTableTempData": "imgui_internal:3133", "ImGuiTableTempData": "imgui_internal:3149",
"ImGuiTextBuffer": "imgui:2681", "ImGuiTextBuffer": "imgui:2695",
"ImGuiTextFilter": "imgui:2654", "ImGuiTextFilter": "imgui:2668",
"ImGuiTextFlags_": "imgui_internal:997", "ImGuiTextFlags_": "imgui_internal:1005",
"ImGuiTextIndex": "imgui_internal:736", "ImGuiTextIndex": "imgui_internal:743",
"ImGuiTextRange": "imgui:2664", "ImGuiTextRange": "imgui:2678",
"ImGuiTooltipFlags_": "imgui_internal:1003", "ImGuiTooltipFlags_": "imgui_internal:1011",
"ImGuiTreeNodeFlagsPrivate_": "imgui_internal:972", "ImGuiTreeNodeFlagsPrivate_": "imgui_internal:980",
"ImGuiTreeNodeFlags_": "imgui:1231", "ImGuiTreeNodeFlags_": "imgui:1234",
"ImGuiTreeNodeStackData": "imgui_internal:1286", "ImGuiTreeNodeStackData": "imgui_internal:1294",
"ImGuiTypingSelectFlags_": "imgui_internal:1670", "ImGuiTypingSelectFlags_": "imgui_internal:1678",
"ImGuiTypingSelectRequest": "imgui_internal:1678", "ImGuiTypingSelectRequest": "imgui_internal:1686",
"ImGuiTypingSelectState": "imgui_internal:1689", "ImGuiTypingSelectState": "imgui_internal:1697",
"ImGuiViewport": "imgui:3639", "ImGuiViewport": "imgui:3653",
"ImGuiViewportFlags_": "imgui:3611", "ImGuiViewportFlags_": "imgui:3625",
"ImGuiViewportP": "imgui_internal:1994", "ImGuiViewportP": "imgui_internal:2002",
"ImGuiWindow": "imgui_internal:2673", "ImGuiWindow": "imgui_internal:2687",
"ImGuiWindowClass": "imgui:2595", "ImGuiWindowClass": "imgui:2609",
"ImGuiWindowDockStyle": "imgui_internal:1972", "ImGuiWindowDockStyle": "imgui_internal:1980",
"ImGuiWindowDockStyleCol": "imgui_internal:1958", "ImGuiWindowDockStyleCol": "imgui_internal:1966",
"ImGuiWindowFlags_": "imgui:1104", "ImGuiWindowFlags_": "imgui:1107",
"ImGuiWindowRefreshFlags_": "imgui_internal:1180", "ImGuiWindowRefreshFlags_": "imgui_internal:1188",
"ImGuiWindowSettings": "imgui_internal:2046", "ImGuiWindowSettings": "imgui_internal:2054",
"ImGuiWindowStackData": "imgui_internal:1313", "ImGuiWindowStackData": "imgui_internal:1321",
"ImGuiWindowTempData": "imgui_internal:2623", "ImGuiWindowTempData": "imgui_internal:2631",
"ImRect": "imgui_internal:538", "ImRect": "imgui_internal:545",
"ImVec1": "imgui_internal:520", "ImVec1": "imgui_internal:527",
"ImVec2": "imgui:297", "ImVec2": "imgui:299",
"ImVec2ih": "imgui_internal:528", "ImVec2ih": "imgui_internal:535",
"ImVec4": "imgui:310" "ImVec4": "imgui:312"
}, },
"nonPOD": { "nonPOD": {
"ImBitArray": true, "ImBitArray": true,
@@ -5712,8 +5727,8 @@
}, },
{ {
"name": "IndexLookup", "name": "IndexLookup",
"template_type": "ImWchar", "template_type": "ImU16",
"type": "ImVector_ImWchar" "type": "ImVector_ImU16"
}, },
{ {
"name": "Glyphs", "name": "Glyphs",
@@ -5756,10 +5771,6 @@
"name": "EllipsisCharStep", "name": "EllipsisCharStep",
"type": "float" "type": "float"
}, },
{
"name": "DirtyLookupTables",
"type": "bool"
},
{ {
"name": "Scale", "name": "Scale",
"type": "float" "type": "float"
@@ -5777,8 +5788,12 @@
"type": "int" "type": "int"
}, },
{ {
"name": "Used4kPagesMap[(0xFFFF+1)/4096/8]", "name": "DirtyLookupTables",
"size": 2, "type": "bool"
},
{
"name": "Used8kPagesMap[(0xFFFF+1)/8192/8]",
"size": 1,
"type": "ImU8" "type": "ImU8"
} }
], ],
@@ -5799,14 +5814,14 @@
"name": "TexGlyphPadding", "name": "TexGlyphPadding",
"type": "int" "type": "int"
}, },
{
"name": "Locked",
"type": "bool"
},
{ {
"name": "UserData", "name": "UserData",
"type": "void*" "type": "void*"
}, },
{
"name": "Locked",
"type": "bool"
},
{ {
"name": "TexReady", "name": "TexReady",
"type": "bool" "type": "bool"
@@ -5855,8 +5870,8 @@
"type": "ImVector_ImFontConfig" "type": "ImVector_ImFontConfig"
}, },
{ {
"name": "TexUvLines[(63)+1]", "name": "TexUvLines[(32)+1]",
"size": 64, "size": 33,
"type": "ImVec4" "type": "ImVec4"
}, },
{ {
@@ -5936,12 +5951,16 @@
"type": "bool" "type": "bool"
}, },
{ {
"name": "FontNo", "name": "MergeMode",
"type": "int" "type": "bool"
}, },
{ {
"name": "SizePixels", "name": "PixelSnapH",
"type": "float" "type": "bool"
},
{
"name": "FontNo",
"type": "int"
}, },
{ {
"name": "OversampleH", "name": "OversampleH",
@@ -5952,8 +5971,8 @@
"type": "int" "type": "int"
}, },
{ {
"name": "PixelSnapH", "name": "SizePixels",
"type": "bool" "type": "float"
}, },
{ {
"name": "GlyphExtraSpacing", "name": "GlyphExtraSpacing",
@@ -5975,10 +5994,6 @@
"name": "GlyphMaxAdvanceX", "name": "GlyphMaxAdvanceX",
"type": "float" "type": "float"
}, },
{
"name": "MergeMode",
"type": "bool"
},
{ {
"name": "FontBuilderFlags", "name": "FontBuilderFlags",
"type": "unsigned int" "type": "unsigned int"
@@ -8301,6 +8316,11 @@
"size": 5, "size": 5,
"type": "bool" "type": "bool"
}, },
{
"name": "MouseReleasedTime[5]",
"size": 5,
"type": "double"
},
{ {
"name": "MouseDownOwned[5]", "name": "MouseDownOwned[5]",
"size": 5, "size": 5,
@@ -10521,6 +10541,10 @@
"name": "Bg2DrawChannelUnfrozen", "name": "Bg2DrawChannelUnfrozen",
"type": "ImGuiTableDrawChannelIdx" "type": "ImGuiTableDrawChannelIdx"
}, },
{
"name": "NavLayer",
"type": "ImS8"
},
{ {
"name": "IsLayoutLocked", "name": "IsLayoutLocked",
"type": "bool" "type": "bool"
@@ -11643,10 +11667,18 @@
"name": "FontWindowScale", "name": "FontWindowScale",
"type": "float" "type": "float"
}, },
{
"name": "FontWindowScaleParents",
"type": "float"
},
{ {
"name": "FontDpiScale", "name": "FontDpiScale",
"type": "float" "type": "float"
}, },
{
"name": "FontRefSize",
"type": "float"
},
{ {
"name": "SettingsOffset", "name": "SettingsOffset",
"type": "int" "type": "int"
@@ -11765,14 +11797,6 @@
{ {
"name": "DockId", "name": "DockId",
"type": "ImGuiID" "type": "ImGuiID"
},
{
"name": "DockTabItemStatusFlags",
"type": "ImGuiItemStatusFlags"
},
{
"name": "DockTabItemRect",
"type": "ImRect"
} }
], ],
"ImGuiWindowClass": [ "ImGuiWindowClass": [
@@ -12022,6 +12046,22 @@
"name": "ModalDimBgColor", "name": "ModalDimBgColor",
"type": "ImU32" "type": "ImU32"
}, },
{
"name": "WindowItemStatusFlags",
"type": "ImGuiItemStatusFlags"
},
{
"name": "ChildItemStatusFlags",
"type": "ImGuiItemStatusFlags"
},
{
"name": "DockTabItemStatusFlags",
"type": "ImGuiItemStatusFlags"
},
{
"name": "DockTabItemRect",
"type": "ImRect"
},
{ {
"name": "ItemWidth", "name": "ItemWidth",
"type": "float" "type": "float"
@@ -12242,6 +12282,7 @@
"ImGuiWindow*": true, "ImGuiWindow*": true,
"ImGuiWindowStackData": true, "ImGuiWindowStackData": true,
"ImTextureID": true, "ImTextureID": true,
"ImU16": true,
"ImU32": true, "ImU32": true,
"ImU8": true, "ImU8": true,
"ImVec2": true, "ImVec2": true,

File diff suppressed because it is too large Load Diff

2
imgui

Submodule imgui updated: c0ae3258f9...11b3a7c8ca