Compare commits

...

71 Commits
1.79 ... 1.80

Author SHA1 Message Date
Victor Bombi
6791a95f79 Merge branch 'docking_inter' 2021-01-27 10:54:09 +01:00
Victor Bombi
86112e0b45 generation 2021-01-27 10:48:46 +01:00
Victor Bombi
c4d1f5423e generator: replace FLT_MIN in substring 2021-01-27 10:48:25 +01:00
Victor Bombi
36e0d7a41e generator: take care of FLT_MIN 2021-01-27 10:21:07 +01:00
Victor Bombi
1bdfc0964e pull submodule imgui master 2021-01-24 13:15:57 +01:00
Victor Bombi
7b9f0c7499 pull imgui master and generate 2021-01-24 11:34:52 +01:00
Victor Bombi
0d96f60b80 pull imgui 1.80 docking and generate 2021-01-22 11:09:18 +01:00
Victor Bombi
3eec69f133 generator.lua: correctly detect IMGUI_HAS_DOCK 2021-01-22 11:07:21 +01:00
Victor Bombi
ab67137994 gitmodules: set correct branch for docking 2021-01-10 20:01:54 +01:00
Victor Bombi
7d5f753a9d pull imgui docking and regenerate 2020-12-23 10:13:02 +01:00
Victor Bombi
3b563153fd readme: update readme cloning 2020-12-23 10:05:01 +01:00
Victor Bombi
7f4ca76e37 Merge branch 'docking_inter' 2020-12-17 13:07:25 +01:00
Victor Bombi
6047c638c4 cpp2ffi: take_lines drop spaces after line (needed by cl) fixes #171 2020-12-17 13:05:54 +01:00
Victor Bombi
414ad3f8f4 Merge branch 'docking_inter' 2020-12-15 11:41:00 +01:00
Victor Bombi
a21c31f123 generator: detect IMGUI_HAS_DOCK and keep it in cimgui.h 2020-12-15 11:33:30 +01:00
Victor Bombi
99611664b7 Merge branch 'docking_inter' 2020-12-14 18:00:16 +01:00
Victor Bombi
45aada6ecb preparation for 1.80 with imgui_tables.cpp addition and 8bytes enum values 2020-12-14 17:57:47 +01:00
Victor Bombi
98bfe43755 Merge branch 'docking_inter' 2020-12-05 14:06:52 +01:00
Victor Bombi
4a4c804ad9 add TODO.txt 2020-12-05 14:05:29 +01:00
Victor Bombi
48c97106cc Merge branch 'docking_inter' 2020-12-01 16:35:11 +01:00
Victor Bombi
e417e3500b cpp2ffi: only use ftemplate_list if ftemplate_list[ttype] is defined (needed by implot_internal) 2020-12-01 12:35:43 +01:00
Victor Bombi
ee5534d7cd Merge branch 'docking_inter' 2020-10-30 15:37:48 +01:00
Victor Bombi
54cfcabdde correct readme 2020-10-30 15:36:17 +01:00
Victor Bombi
e0279fa53d Merge branch 'docking_inter' 2020-10-30 15:34:38 +01:00
M. Frink ~ Lemur
43bfbe227d Fixed typo 2020-10-30 15:31:53 +01:00
M. Frink ~ Lemur
2a6970b50b Fixed typo 2020-10-30 15:31:53 +01:00
Micon Frink
507e19bc7e adding documentation 2020-10-30 15:31:53 +01:00
Micon Frink
3f2e6f40df added a ternary to check for cl so that we don't have problems with Linux absolute paths... 2020-10-30 15:31:53 +01:00
Micon Frink
be7bb9a72e forgot to add the CFLAGS to to the actual calls. Also realized that we really should process the cl calls so fixed that too. 2020-10-30 15:31:53 +01:00
Micon Frink
fc677cb849 adding flags to generator.lua 2020-10-30 15:31:53 +01:00
Victor Bombi
aa1b438f7f Merge pull request #165 from frink/flags
Adding CFLAGS to generator.lua
2020-10-29 20:37:34 +01:00
M. Frink ~ Lemur
9828871a89 Fixed typo 2020-10-29 12:28:40 -05:00
M. Frink ~ Lemur
236c296049 Fixed typo 2020-10-29 12:26:36 -05:00
Micon Frink
3b01e79d6d adding documentation 2020-10-29 16:31:38 +00:00
Victor Bombi
ebfa448e25 Merge branch 'docking_inter' 2020-10-28 17:52:30 +01:00
Victor Bombi
0704912579 cpp2ffi: get_parents_nameC correction 2020-10-28 17:51:16 +01:00
Micon Frink
06f3c006c3 added a ternary to check for cl so that we don't have problems with Linux absolute paths... 2020-10-28 06:31:32 +00:00
Micon Frink
5c469cca4e forgot to add the CFLAGS to to the actual calls. Also realized that we really should process the cl calls so fixed that too. 2020-10-28 06:19:41 +00:00
Micon Frink
7d6fdb66bb adding flags to generator.lua 2020-10-28 05:44:57 +00:00
Victor Bombi
e1ea75be6e Merge branch 'docking_inter' 2020-10-27 15:05:36 +01:00
Victor Bombi
c46a2eded6 cpp2ffi: parseFunction receives nested namespace name (ImNodes needs it) 2020-10-27 15:03:53 +01:00
Victor Bombi
756ce6330a Merge branch 'docking_inter' 2020-10-27 12:35:15 +01:00
Victor Bombi
4e5d12e86e cpp2ffi: take care of template different of typename, generator: ImSpan template generation 2020-10-27 12:32:44 +01:00
Victor Bombi
bb0cb8090a Merge branch 'docking_inter' 2020-10-24 16:46:33 +02:00
Victor Bombi
9cb4b4f63c detect backends folder in generator and backend_test 2020-10-24 16:41:57 +02:00
Oleh Prypin
a97c90ec4f Add crystal-imgui as an example binding 2020-10-19 18:21:53 +02:00
Victor Bombi
b50e8c0d85 Merge pull request #161 from oprypin/patch-1
Add crystal-imgui as an example binding
2020-10-19 18:19:45 +02:00
Oleh Prypin
ad5580b5d7 Add crystal-imgui as an example binding 2020-10-19 18:06:47 +02:00
Victor Bombi
a1f2cef9d3 readme: correct links 2020-10-19 17:42:32 +02:00
Victor Bombi
75a27d5e34 readme: correct links 2020-10-19 17:39:51 +02:00
Marcelo Silva Nascimento Mancini
59e4829b4b Add bindbc-cimgui as an example binding
DerelictImGui is too old for the state ImGui is right now, so I made  a binding which is -betterC switch compatible with D and it is updated to the 1.79 version which I'll be supporting for a great time
2020-10-19 17:36:51 +02:00
Victor Bombi
7aa18d11a1 Merge pull request #160 from MrcSnm/patch-1
Add bindbc-cimgui as an example binding
2020-10-19 17:35:22 +02:00
Marcelo Silva Nascimento Mancini
b26f477c20 Add bindbc-cimgui as an example binding
DerelictImGui is too old for the state ImGui is right now, so I made  a binding which is -betterC switch compatible with D and it is updated to the 1.79 version which I'll be supporting for a great time
2020-10-19 08:10:02 -07:00
Victor Bombi
33fb5eb309 readme: explain defaults of generator, change implementations by backends 2020-10-19 16:41:13 +02:00
Victor Bombi
3700abd326 readme: explain defaults of generator, change implementations by backends 2020-10-19 16:25:21 +02:00
Victor Bombi
16609ed627 Merge branch 'master' into docking_inter 2020-10-19 10:17:32 +02:00
Victor Bombi
87158fa6b4 Merge pull request #159 from MrcSnm/master
Added another check for null sdl include on backend_test
2020-10-19 10:14:05 +02:00
Hipreme
7ce241d5d8 Added another check for null sdl include 2020-10-18 15:31:43 -03:00
Victor Bombi
44af224530 repair docking branch (some merge commit broke it) 2020-10-18 19:46:25 +02:00
Victor Bombi
213086639f backend_test: make mingw with SDL have console output 2020-10-18 19:39:29 +02:00
Victor Bombi
5bd8981f19 backend_test: make mingw with SDL have console output 2020-10-18 19:32:26 +02:00
Victor Bombi
bd89e83f70 Merge branch 'docking_inter' 2020-10-18 15:14:30 +02:00
Victor Bombi
1f5590c0b0 backend_test/main: include windows.h for GL in MSVC 2020-10-18 13:51:37 +02:00
Victor Bombi
8eff25b5ee backend_test: main dont uses USE_DOCKING in master branch 2020-10-16 17:35:40 +02:00
Victor Bombi
31bc8389d3 Merge branch 'docking_inter' 2020-10-16 17:33:50 +02:00
Victor Bombi
64ed803093 backend_test: dont use glw3 loader on main, add USE_DOCKING define 2020-10-16 17:33:05 +02:00
Victor Bombi
e58ac87fba Merge branch 'docking_inter' 2020-10-16 16:30:42 +02:00
Victor Bombi
c1a4efeb10 README.md updated with backend_test info 2020-10-16 16:29:47 +02:00
Victor Bombi
9b6769e810 Merge branch 'docking_inter' 2020-10-16 16:17:35 +02:00
Victor Bombi
5a5ac45e55 add backend_test for sdl2 opengl3 2020-10-16 15:56:11 +02:00
Victor Bombi
c5a3820d02 pull imgui docking 1.79 and generate 2020-10-09 16:51:44 +02:00
25 changed files with 13389 additions and 3859 deletions

1
.gitmodules vendored
View File

@@ -1,3 +1,4 @@
[submodule "imgui"]
path = imgui
url = https://github.com/ocornut/imgui.git
branch = master

View File

@@ -2,6 +2,13 @@ cmake_minimum_required(VERSION 3.1)
project(cimgui)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/imgui/imgui_tables.cpp)
set(TABLES_SOURCE "imgui/imgui_tables.cpp")
else()
set(TABLES_SOURCE "")
endif()
#general settings
file(GLOB IMGUI_SOURCES
cimgui.cpp
@@ -9,6 +16,7 @@ file(GLOB IMGUI_SOURCES
imgui/imgui_draw.cpp
imgui/imgui_demo.cpp
imgui/imgui_widgets.cpp
${TABLES_SOURCE}
)
set(IMGUI_STATIC "no" CACHE STRING "Build as a static library")

View File

@@ -11,9 +11,9 @@ History:
Initially cimgui was developed by Stephan Dilly as hand-written code but lately turned into an auto-generated version by sonoro1234 in order to keep up with imgui more easily (letting the user select the desired branch and commit)
Notes:
* currently this wrapper is based on version [1.79 of Dear ImGui with internal api]
* currently this wrapper is based on version [1.80 of Dear ImGui with internal api]
* only functions, structs and enums from imgui.h (an optionally imgui_internal.h) are wrapped.
* if you are interested in imgui implementations 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.
* Current overloaded function names can be found in (https://github.com/cimgui/cimgui/blob/master/generator/output/overloads.txt)
@@ -21,22 +21,27 @@ Notes:
* clone
* `git clone --recursive https://github.com/cimgui/cimgui.git`
* `git submodule update`
* `git submodule update --init --recursive` (If already cloned)
* compile
* using makefile on linux/macOS/mingw (Or use CMake to generate project)
* cmake options are IMGUI_STATIC (compiling as static library), IMGUI_FREETYPE (for using Freetype2) and FREETYPE_PATH (Freetype2 cmake install location)
* or as in https://github.com/sonoro1234/LuaJIT-ImGui/tree/master/build
For compiling with backends there is now an example with SDL2 and opengl3 in folder backend_test. It will generate a cimgui_sdl module and a test_sdl executable. You only need to provide SDL_PATH telling cmake where to look for SDL2 cmake installation.
# using generator
* this is only needed (before compilation) if you want an imgui version different from the one provided, otherwise generation is already done.
* you will need LuaJIT (https://github.com/LuaJIT/LuaJIT.git better 2.1 branch) or precompiled for linux/macOS/windows in https://luapower.com/luajit/download
* you need to use also a C++ compiler for doing preprocessing: gcc (In windows MinGW-W64-builds for example), clang or cl (MSVC). (this repo was done with gcc)
* update `imgui` folder to the version you desire.
* edit `generator/generator.bat` on windows, or `generator/generator.sh` on linux, to choose between gcc, clang, or cl and to choose desired implementations and whether imgui_internal is generated or not and Freetype2 is used or not.
* edit config_generator.lua for adding includes needed by your chosen implementations (vulkan needs that).
* edit `generator/generator.bat` on windows, or `generator/generator.sh` on linux, to choose between gcc, clang, or cl and to choose desired backends and whether imgui_internal is generated or not and Freetype2 is used or not.
* the defaults of generator are gcc as compiler, imgui_internal included and sdl, glfw, opengl2 and opengl3 as backends.
* edit config_generator.lua for adding includes needed by your chosen backends (vulkan needs that).
* Run generator.bat or generator.sh with gcc, clang or cl and LuaJIT on your PATH.
* as a result some files are generated: `cimgui.cpp` and `cimgui.h` for compiling and some lua/json files with information about the binding: `definitions.json` with function info, `structs_and_enums.json` with struct and enum info, `impl_definitions.json` with functions from the implementations info.
* as a result some files are generated: `cimgui.cpp`, `cimgui.h` and `cimgui_impl.h` for compiling and some lua/json files with information about the binding: `definitions.json` with function info, `structs_and_enums.json` with struct and enum info, `impl_definitions.json` with functions from the backends info.
* You can pass compiler flags to generator.sh or generator.bat at the end of the call to further specify the compiler behavior. (e.g. -DIMGUI_USER_CONFIG or -DIMGUI_USE_WCHAR32)
# generate binding
* C interface is exposed by cimgui.h when you define CIMGUI_DEFINE_ENUMS_AND_STRUCTS
@@ -86,6 +91,10 @@ Notes:
* functions that belong to a struct have an extra first argument with a pointer to the struct.
* where a function returns UDT (user defined type) by value some compilers complain so the function is generated accepting a pointer to the UDT type as the first argument (or second if belongs to a struct).
# usage with backends
* look at backend_test folder for a cmake module building with SDL and opengl3.
# example bindings based on cimgui
* [LuaJIT-ImGui](https://github.com/sonoro1234/LuaJIT-ImGui)
@@ -95,12 +104,14 @@ Notes:
* [CImGui.jl](https://github.com/Gnimuc/CImGui.jl)
* [odin-imgui](https://github.com/ThisDrunkDane/odin-imgui)
* [DerelictImgui](https://github.com/Extrawurst/DerelictImgui)
* [BindBC-CimGui](https://github.com/MrcSnm/bindbc-cimgui)
* [imgui-rs](https://github.com/Gekkio/imgui-rs)
* [imgui-pas](https://github.com/dpethes/imgui-pas)
* [crystal-imgui](https://github.com/oprypin/crystal-imgui)
# C examples based on cimgui
* [sdl2_opengl3](https://github.com/cimgui/cimgui/tree/docking_inter/backend_test)
* [sdl2-cimgui-demo](https://github.com/haxpor/sdl2-cimgui-demo)
* [cimgui_c_sdl2_example](https://github.com/canoi12/cimgui_c_sdl2_example/)
* [cimgui-c-example](https://github.com/peko/cimgui-c-example) with GLFW

5
TODO.txt Normal file
View File

@@ -0,0 +1,5 @@
- Being able to use a prefix for structs and enums. Could be a manual dictionary or an option to take parent namespace and struct (https://github.com/rokups/ImNodes/pull/20#issuecomment-719713982)
- Being able to generate separate headers for imgui and imgui_internal. (https://github.com/cimgui/cimgui/pull/126#issuecomment-735674105)

View File

@@ -0,0 +1,98 @@
Project(cimgui_sdl)
cmake_minimum_required(VERSION 2.8)
if(WIN32) #to mingw work as all the others
set(CMAKE_SHARED_LIBRARY_PREFIX "")
endif(WIN32)
#general settings
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../imgui/backends)
set(BAKENDS_FOLDER "../imgui/backends/")
else()
set(BAKENDS_FOLDER "../imgui/examples/")
endif()
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../imgui/imgui_tables.cpp)
set(TABLES_SOURCE "../imgui/imgui_tables.cpp")
else()
set(TABLES_SOURCE "")
endif()
include_directories(../imgui)
add_definitions("-DIMGUI_DISABLE_OBSOLETE_FUNCTIONS=1")
include_directories(../)
set(IMGUI_SOURCES ../cimgui.cpp
../imgui/imgui.cpp
../imgui/imgui_draw.cpp
../imgui/imgui_demo.cpp
../imgui/imgui_widgets.cpp
${TABLES_SOURCE}
)
set(IMGUI_SOURCES_sdl)
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")
#optional adding freetype
option(IMGUI_FREETYPE "add Freetype2" OFF)
if(IMGUI_FREETYPE)
FIND_PACKAGE(freetype REQUIRED PATHS ${FREETYPE_PATH})
list(APPEND IMGUI_LIBRARIES freetype)
list(APPEND IMGUI_SOURCES ../imgui/misc/freetype/imgui_freetype.cpp)
add_definitions("-DCIMGUI_FREETYPE=1")
endif(IMGUI_FREETYPE)
#opengl3
list(APPEND IMGUI_SOURCES ${BAKENDS_FOLDER}imgui_impl_opengl3.cpp ../imgui/examples/libs/gl3w/GL/gl3w.c)
list(APPEND IMGUI_SOURCES ./cimgui_extras.cpp)
include_directories(../imgui/examples/libs/gl3w)
if(WIN32)
list(APPEND IMGUI_LIBRARIES opengl32)
else(WIN32)#Unix
list(APPEND IMGUI_LIBRARIES GL)
endif(WIN32)
#sdl2
list(APPEND IMGUI_SOURCES ${BAKENDS_FOLDER}imgui_impl_sdl.cpp)
if(DEFINED SDL_PATH)
message(STATUS "SDL_PATH defined as " ${SDL_PATH})
FIND_PACKAGE(SDL2 REQUIRED PATHS ${SDL_PATH})
get_target_property(SDL_INCLUDE SDL2::SDL2 INTERFACE_INCLUDE_DIRECTORIES)
message(STATUS "sdlinclude is " ${SDL_INCLUDE})
if ("${SDL_INCLUDE}" STREQUAL "" OR "${SDL_INCLUDE}" STREQUAL "SDL_INCLUDE-NOTFOUND") #if not found latest SDL2 cmake config use older
message(STATUS "sdlinclude2 is " ${SDL2_INCLUDE_DIRS})
include_directories(${SDL2_INCLUDE_DIRS})
set(IMGUI_SDL_LIBRARY ${SDL2_LIBRARIES})
message(STATUS IMGUI_SDL_LIBRARY ${SDL2_LIBRARIES})
else()#use new one SDL2 config
include_directories(${SDL_INCLUDE})
set(IMGUI_SDL_LIBRARY SDL2::SDL2)
set(SDL_MAIN SDL2::SDL2main)
message(STATUS ${SDL_MAIN} ${IMGUI_SDL_LIBRARY})
endif()
else(DEFINED SDL_PATH)
message(STATUS "SDL_PATH not defined")
set(IMGUI_SDL_LIBRARY SDL2)
endif(DEFINED SDL_PATH)
add_library(cimgui_sdl SHARED ${IMGUI_SOURCES})
target_link_libraries(cimgui_sdl ${IMGUI_LIBRARIES} ${IMGUI_SDL_LIBRARY})
#using library
include_directories(../generator/output/)
add_executable(test_sdl main.c)
if (MINGW)
target_link_options(test_sdl PRIVATE "-mconsole")
endif()
target_link_libraries(test_sdl ${IMGUI_SDL_LIBRARY} cimgui_sdl)

View File

@@ -0,0 +1,11 @@
#include "../imgui/imgui.h"
// GL3W/GLFW
#include <GL/gl3w.h> // This example is using gl3w to access OpenGL functions (because it is small). You may use glew/glad/glLoadGen/etc. whatever already works for you.
//making it accesible for luajit
#ifdef _WIN32
extern "C" __declspec( dllexport ) int Do_gl3wInit(void){ return gl3wInit();};
#else
extern "C" int Do_gl3wInit(void){ return gl3wInit();};
#endif

View File

@@ -0,0 +1,8 @@
//making it accesible for main
#ifdef _WIN32
__declspec( dllexport ) int Do_gl3wInit(void);
#else
int Do_gl3wInit(void);
#endif

197
backend_test/main.c Normal file
View File

@@ -0,0 +1,197 @@
#define CIMGUI_DEFINE_ENUMS_AND_STRUCTS
#include "cimgui.h"
#include "cimgui_extras.h"
#include "cimgui_impl.h"
#include <stdio.h>
#define SDL_MAIN_HANDLED
#include <SDL.h>
#ifdef _MSC_VER
#include <windows.h>
#endif
#include <GL/gl.h>
#include <GL/glu.h>
SDL_Window *window = NULL;
int main(int argc, char* argv[])
{
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
SDL_Log("failed to init: %s", SDL_GetError());
return -1;
}
// Decide GL+GLSL versions
#if __APPLE__
// GL 3.2 Core + GLSL 150
const char* glsl_version = "#version 150";
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG); // Always required on Mac
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
#else
// GL 3.0 + GLSL 130
const char* glsl_version = "#version 130";
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, 0);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
#endif
// and prepare OpenGL stuff
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl");
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_DisplayMode current;
SDL_GetCurrentDisplayMode(0, &current);
window = SDL_CreateWindow(
"Hello", 0, 0, 1024, 768,
SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE
);
if (window == NULL) {
SDL_Log("Failed to create window: %s", SDL_GetError());
return -1;
}
SDL_GLContext gl_context = SDL_GL_CreateContext(window);
SDL_GL_SetSwapInterval(1); // enable vsync
// Initialize OpenGL loader for cimgui_sdl
bool err = Do_gl3wInit() != 0;
if (err)
{
SDL_Log("Failed to initialize OpenGL loader for cimgui_sdl!");
return 1;
}
// check opengl version sdl uses
SDL_Log("opengl version: %s", (char*)glGetString(GL_VERSION));
// setup imgui
igCreateContext(NULL);
//set docking
ImGuiIO* ioptr = igGetIO();
ioptr->ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
//ioptr->ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
#ifdef IMGUI_HAS_DOCK
ioptr->ConfigFlags |= ImGuiConfigFlags_DockingEnable; // Enable Docking
ioptr->ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; // Enable Multi-Viewport / Platform Windows
#endif
ImGui_ImplSDL2_InitForOpenGL(window, gl_context);
ImGui_ImplOpenGL3_Init(glsl_version);
igStyleColorsDark(NULL);
//ImFontAtlas_AddFontDefault(io.Fonts, NULL);
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;
// we need to call SDL_PollEvent to let window rendered, otherwise
// no window will be shown
while (SDL_PollEvent(&e) != 0)
{
ImGui_ImplSDL2_ProcessEvent(&e);
if (e.type == SDL_QUIT)
quit = true;
if (e.type == SDL_WINDOWEVENT && e.window.event == SDL_WINDOWEVENT_CLOSE && e.window.windowID == SDL_GetWindowID(window))
quit = true;
}
// start imgui frame
ImGui_ImplOpenGL3_NewFrame();
ImGui_ImplSDL2_NewFrame(window);
igNewFrame();
if (showDemoWindow)
igShowDemoWindow(&showDemoWindow);
// show a simple window that we created ourselves.
{
static float f = 0.0f;
static int counter = 0;
igBegin("Hello, world!", NULL, 0);
igText("This is some useful text");
igCheckbox("Demo window", &showDemoWindow);
igCheckbox("Another window", &showAnotherWindow);
igSliderFloat("Float", &f, 0.0f, 1.0f, "%.3f", 0);
igColorEdit3("clear color", (float*)&clearColor, 0);
ImVec2 buttonSize;
buttonSize.x = 0;
buttonSize.y = 0;
if (igButton("Button", buttonSize))
counter++;
igSameLine(0.0f, -1.0f);
igText("counter = %d", counter);
igText("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / igGetIO()->Framerate, igGetIO()->Framerate);
igEnd();
}
if (showAnotherWindow)
{
igBegin("imgui Another Window", &showAnotherWindow, 0);
igText("Hello from imgui");
ImVec2 buttonSize;
buttonSize.x = 0; buttonSize.y = 0;
if (igButton("Close me", buttonSize))
{
showAnotherWindow = false;
}
igEnd();
}
// render
igRender();
SDL_GL_MakeCurrent(window, gl_context);
glViewport(0, 0, (int)ioptr->DisplaySize.x, (int)ioptr->DisplaySize.y);
glClearColor(clearColor.x, clearColor.y, clearColor.z, clearColor.w);
glClear(GL_COLOR_BUFFER_BIT);
ImGui_ImplOpenGL3_RenderDrawData(igGetDrawData());
#ifdef IMGUI_HAS_DOCK
if (ioptr->ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
{
SDL_Window* backup_current_window = SDL_GL_GetCurrentWindow();
SDL_GLContext backup_current_context = SDL_GL_GetCurrentContext();
igUpdatePlatformWindows();
igRenderPlatformWindowsDefault(NULL,NULL);
SDL_GL_MakeCurrent(backup_current_window, backup_current_context);
}
#endif
SDL_GL_SwapWindow(window);
}
// clean up
ImGui_ImplOpenGL3_Shutdown();
ImGui_ImplSDL2_Shutdown();
igDestroyContext(NULL);
SDL_GL_DeleteContext(gl_context);
if (window != NULL)
{
SDL_DestroyWindow(window);
window = NULL;
}
SDL_Quit();
return 0;
}

View File

@@ -1,5 +1,5 @@
//This file is automatically generated by generator.lua from https://github.com/cimgui/cimgui
//based on imgui.h file version "1.79" from Dear ImGui https://github.com/ocornut/imgui
//based on imgui.h file version "1.80" from Dear ImGui https://github.com/ocornut/imgui
//with imgui_internal.h api
#include "./imgui/imgui.h"
@@ -79,14 +79,14 @@ CIMGUI_API void igShowDemoWindow(bool* p_open)
{
return ImGui::ShowDemoWindow(p_open);
}
CIMGUI_API void igShowAboutWindow(bool* p_open)
{
return ImGui::ShowAboutWindow(p_open);
}
CIMGUI_API void igShowMetricsWindow(bool* p_open)
{
return ImGui::ShowMetricsWindow(p_open);
}
CIMGUI_API void igShowAboutWindow(bool* p_open)
{
return ImGui::ShowAboutWindow(p_open);
}
CIMGUI_API void igShowStyleEditor(ImGuiStyle* ref)
{
return ImGui::ShowStyleEditor(ref);
@@ -111,14 +111,14 @@ CIMGUI_API void igStyleColorsDark(ImGuiStyle* dst)
{
return ImGui::StyleColorsDark(dst);
}
CIMGUI_API void igStyleColorsClassic(ImGuiStyle* dst)
{
return ImGui::StyleColorsClassic(dst);
}
CIMGUI_API void igStyleColorsLight(ImGuiStyle* dst)
{
return ImGui::StyleColorsLight(dst);
}
CIMGUI_API void igStyleColorsClassic(ImGuiStyle* dst)
{
return ImGui::StyleColorsClassic(dst);
}
CIMGUI_API bool igBegin(const char* name,bool* p_open,ImGuiWindowFlags flags)
{
return ImGui::Begin(name,p_open,flags);
@@ -239,14 +239,14 @@ CIMGUI_API void igSetWindowFocusStr(const char* name)
{
return ImGui::SetWindowFocus(name);
}
CIMGUI_API void igGetContentRegionMax(ImVec2 *pOut)
{
*pOut = ImGui::GetContentRegionMax();
}
CIMGUI_API void igGetContentRegionAvail(ImVec2 *pOut)
{
*pOut = ImGui::GetContentRegionAvail();
}
CIMGUI_API void igGetContentRegionMax(ImVec2 *pOut)
{
*pOut = ImGui::GetContentRegionMax();
}
CIMGUI_API void igGetWindowContentRegionMin(ImVec2 *pOut)
{
*pOut = ImGui::GetWindowContentRegionMin();
@@ -267,14 +267,6 @@ CIMGUI_API float igGetScrollY()
{
return ImGui::GetScrollY();
}
CIMGUI_API float igGetScrollMaxX()
{
return ImGui::GetScrollMaxX();
}
CIMGUI_API float igGetScrollMaxY()
{
return ImGui::GetScrollMaxY();
}
CIMGUI_API void igSetScrollXFloat(float scroll_x)
{
return ImGui::SetScrollX(scroll_x);
@@ -283,6 +275,14 @@ CIMGUI_API void igSetScrollYFloat(float scroll_y)
{
return ImGui::SetScrollY(scroll_y);
}
CIMGUI_API float igGetScrollMaxX()
{
return ImGui::GetScrollMaxX();
}
CIMGUI_API float igGetScrollMaxY()
{
return ImGui::GetScrollMaxY();
}
CIMGUI_API void igSetScrollHereX(float center_x_ratio)
{
return ImGui::SetScrollHereX(center_x_ratio);
@@ -331,33 +331,21 @@ CIMGUI_API void igPopStyleVar(int count)
{
return ImGui::PopStyleVar(count);
}
CIMGUI_API const ImVec4* igGetStyleColorVec4(ImGuiCol idx)
CIMGUI_API void igPushAllowKeyboardFocus(bool allow_keyboard_focus)
{
return &ImGui::GetStyleColorVec4(idx);
return ImGui::PushAllowKeyboardFocus(allow_keyboard_focus);
}
CIMGUI_API ImFont* igGetFont()
CIMGUI_API void igPopAllowKeyboardFocus()
{
return ImGui::GetFont();
return ImGui::PopAllowKeyboardFocus();
}
CIMGUI_API float igGetFontSize()
CIMGUI_API void igPushButtonRepeat(bool repeat)
{
return ImGui::GetFontSize();
return ImGui::PushButtonRepeat(repeat);
}
CIMGUI_API void igGetFontTexUvWhitePixel(ImVec2 *pOut)
CIMGUI_API void igPopButtonRepeat()
{
*pOut = ImGui::GetFontTexUvWhitePixel();
}
CIMGUI_API ImU32 igGetColorU32Col(ImGuiCol idx,float alpha_mul)
{
return ImGui::GetColorU32(idx,alpha_mul);
}
CIMGUI_API ImU32 igGetColorU32Vec4(const ImVec4 col)
{
return ImGui::GetColorU32(col);
}
CIMGUI_API ImU32 igGetColorU32U32(ImU32 col)
{
return ImGui::GetColorU32(col);
return ImGui::PopButtonRepeat();
}
CIMGUI_API void igPushItemWidth(float item_width)
{
@@ -383,21 +371,33 @@ CIMGUI_API void igPopTextWrapPos()
{
return ImGui::PopTextWrapPos();
}
CIMGUI_API void igPushAllowKeyboardFocus(bool allow_keyboard_focus)
CIMGUI_API ImFont* igGetFont()
{
return ImGui::PushAllowKeyboardFocus(allow_keyboard_focus);
return ImGui::GetFont();
}
CIMGUI_API void igPopAllowKeyboardFocus()
CIMGUI_API float igGetFontSize()
{
return ImGui::PopAllowKeyboardFocus();
return ImGui::GetFontSize();
}
CIMGUI_API void igPushButtonRepeat(bool repeat)
CIMGUI_API void igGetFontTexUvWhitePixel(ImVec2 *pOut)
{
return ImGui::PushButtonRepeat(repeat);
*pOut = ImGui::GetFontTexUvWhitePixel();
}
CIMGUI_API void igPopButtonRepeat()
CIMGUI_API ImU32 igGetColorU32Col(ImGuiCol idx,float alpha_mul)
{
return ImGui::PopButtonRepeat();
return ImGui::GetColorU32(idx,alpha_mul);
}
CIMGUI_API ImU32 igGetColorU32Vec4(const ImVec4 col)
{
return ImGui::GetColorU32(col);
}
CIMGUI_API ImU32 igGetColorU32U32(ImU32 col)
{
return ImGui::GetColorU32(col);
}
CIMGUI_API const ImVec4* igGetStyleColorVec4(ImGuiCol idx)
{
return &ImGui::GetStyleColorVec4(idx);
}
CIMGUI_API void igSeparator()
{
@@ -621,7 +621,11 @@ CIMGUI_API bool igCheckbox(const char* label,bool* v)
{
return ImGui::Checkbox(label,v);
}
CIMGUI_API bool igCheckboxFlags(const char* label,unsigned int* flags,unsigned int flags_value)
CIMGUI_API bool igCheckboxFlagsIntPtr(const char* label,int* flags,int flags_value)
{
return ImGui::CheckboxFlags(label,flags,flags_value);
}
CIMGUI_API bool igCheckboxFlagsUintPtr(const char* label,unsigned int* flags,unsigned int flags_value)
{
return ImGui::CheckboxFlags(label,flags,flags_value);
}
@@ -921,9 +925,9 @@ CIMGUI_API bool igCollapsingHeaderTreeNodeFlags(const char* label,ImGuiTreeNodeF
{
return ImGui::CollapsingHeader(label,flags);
}
CIMGUI_API bool igCollapsingHeaderBoolPtr(const char* label,bool* p_open,ImGuiTreeNodeFlags flags)
CIMGUI_API bool igCollapsingHeaderBoolPtr(const char* label,bool* p_visible,ImGuiTreeNodeFlags flags)
{
return ImGui::CollapsingHeader(label,p_open,flags);
return ImGui::CollapsingHeader(label,p_visible,flags);
}
CIMGUI_API void igSetNextItemOpen(bool is_open,ImGuiCond cond)
{
@@ -1080,6 +1084,70 @@ CIMGUI_API bool igIsPopupOpenStr(const char* str_id,ImGuiPopupFlags flags)
{
return ImGui::IsPopupOpen(str_id,flags);
}
CIMGUI_API bool igBeginTable(const char* str_id,int column,ImGuiTableFlags flags,const ImVec2 outer_size,float inner_width)
{
return ImGui::BeginTable(str_id,column,flags,outer_size,inner_width);
}
CIMGUI_API void igEndTable()
{
return ImGui::EndTable();
}
CIMGUI_API void igTableNextRow(ImGuiTableRowFlags row_flags,float min_row_height)
{
return ImGui::TableNextRow(row_flags,min_row_height);
}
CIMGUI_API bool igTableNextColumn()
{
return ImGui::TableNextColumn();
}
CIMGUI_API bool igTableSetColumnIndex(int column_n)
{
return ImGui::TableSetColumnIndex(column_n);
}
CIMGUI_API void igTableSetupColumn(const char* label,ImGuiTableColumnFlags flags,float init_width_or_weight,ImU32 user_id)
{
return ImGui::TableSetupColumn(label,flags,init_width_or_weight,user_id);
}
CIMGUI_API void igTableSetupScrollFreeze(int cols,int rows)
{
return ImGui::TableSetupScrollFreeze(cols,rows);
}
CIMGUI_API void igTableHeadersRow()
{
return ImGui::TableHeadersRow();
}
CIMGUI_API void igTableHeader(const char* label)
{
return ImGui::TableHeader(label);
}
CIMGUI_API ImGuiTableSortSpecs* igTableGetSortSpecs()
{
return ImGui::TableGetSortSpecs();
}
CIMGUI_API int igTableGetColumnCount()
{
return ImGui::TableGetColumnCount();
}
CIMGUI_API int igTableGetColumnIndex()
{
return ImGui::TableGetColumnIndex();
}
CIMGUI_API int igTableGetRowIndex()
{
return ImGui::TableGetRowIndex();
}
CIMGUI_API const char* igTableGetColumnNameInt(int column_n)
{
return ImGui::TableGetColumnName(column_n);
}
CIMGUI_API ImGuiTableColumnFlags igTableGetColumnFlags(int column_n)
{
return ImGui::TableGetColumnFlags(column_n);
}
CIMGUI_API void igTableSetBgColor(ImGuiTableBgTarget target,ImU32 color,int column_n)
{
return ImGui::TableSetBgColor(target,color,column_n);
}
CIMGUI_API void igColumns(int count,const char* id,bool border)
{
return ImGui::Columns(count,id,border);
@@ -1552,6 +1620,22 @@ CIMGUI_API bool ImGuiPayload_IsDelivery(ImGuiPayload* self)
{
return self->IsDelivery();
}
CIMGUI_API ImGuiTableColumnSortSpecs* ImGuiTableColumnSortSpecs_ImGuiTableColumnSortSpecs(void)
{
return IM_NEW(ImGuiTableColumnSortSpecs)();
}
CIMGUI_API void ImGuiTableColumnSortSpecs_destroy(ImGuiTableColumnSortSpecs* self)
{
IM_DELETE(self);
}
CIMGUI_API ImGuiTableSortSpecs* ImGuiTableSortSpecs_ImGuiTableSortSpecs(void)
{
return IM_NEW(ImGuiTableSortSpecs)();
}
CIMGUI_API void ImGuiTableSortSpecs_destroy(ImGuiTableSortSpecs* self)
{
IM_DELETE(self);
}
CIMGUI_API ImGuiOnceUponAFrame* ImGuiOnceUponAFrame_ImGuiOnceUponAFrame(void)
{
return IM_NEW(ImGuiOnceUponAFrame)();
@@ -1916,9 +2000,13 @@ CIMGUI_API void ImDrawList_AddConvexPolyFilled(ImDrawList* self,const ImVec2* po
{
return self->AddConvexPolyFilled(points,num_points,col);
}
CIMGUI_API void ImDrawList_AddBezierCurve(ImDrawList* self,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,ImU32 col,float thickness,int num_segments)
CIMGUI_API void ImDrawList_AddBezierCubic(ImDrawList* self,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,ImU32 col,float thickness,int num_segments)
{
return self->AddBezierCurve(p1,p2,p3,p4,col,thickness,num_segments);
return self->AddBezierCubic(p1,p2,p3,p4,col,thickness,num_segments);
}
CIMGUI_API void ImDrawList_AddBezierQuadratic(ImDrawList* self,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,ImU32 col,float thickness,int num_segments)
{
return self->AddBezierQuadratic(p1,p2,p3,col,thickness,num_segments);
}
CIMGUI_API void ImDrawList_AddImage(ImDrawList* self,ImTextureID user_texture_id,const ImVec2 p_min,const ImVec2 p_max,const ImVec2 uv_min,const ImVec2 uv_max,ImU32 col)
{
@@ -1960,9 +2048,13 @@ CIMGUI_API void ImDrawList_PathArcToFast(ImDrawList* self,const ImVec2 center,fl
{
return self->PathArcToFast(center,radius,a_min_of_12,a_max_of_12);
}
CIMGUI_API void ImDrawList_PathBezierCurveTo(ImDrawList* self,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,int num_segments)
CIMGUI_API void ImDrawList_PathBezierCubicCurveTo(ImDrawList* self,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,int num_segments)
{
return self->PathBezierCurveTo(p2,p3,p4,num_segments);
return self->PathBezierCubicCurveTo(p2,p3,p4,num_segments);
}
CIMGUI_API void ImDrawList_PathBezierQuadraticCurveTo(ImDrawList* self,const ImVec2 p2,const ImVec2 p3,int num_segments)
{
return self->PathBezierQuadraticCurveTo(p2,p3,num_segments);
}
CIMGUI_API void ImDrawList_PathRect(ImDrawList* self,const ImVec2 rect_min,const ImVec2 rect_max,float rounding,ImDrawCornerFlags rounding_corners)
{
@@ -2320,11 +2412,11 @@ CIMGUI_API bool ImFont_IsGlyphRangeUnused(ImFont* self,unsigned int c_begin,unsi
{
return self->IsGlyphRangeUnused(c_begin,c_last);
}
CIMGUI_API ImU32 igImHashData(const void* data,size_t data_size,ImU32 seed)
CIMGUI_API ImGuiID igImHashData(const void* data,size_t data_size,ImU32 seed)
{
return ImHashData(data,data_size,seed);
}
CIMGUI_API ImU32 igImHashStr(const char* data,size_t data_size,ImU32 seed)
CIMGUI_API ImGuiID igImHashStr(const char* data,size_t data_size,ImU32 seed)
{
return ImHashStr(data,data_size,seed);
}
@@ -2332,7 +2424,11 @@ CIMGUI_API ImU32 igImAlphaBlendColors(ImU32 col_a,ImU32 col_b)
{
return ImAlphaBlendColors(col_a,col_b);
}
CIMGUI_API bool igImIsPowerOfTwo(int v)
CIMGUI_API bool igImIsPowerOfTwoInt(int v)
{
return ImIsPowerOfTwo(v);
}
CIMGUI_API bool igImIsPowerOfTwoU64(ImU64 v)
{
return ImIsPowerOfTwo(v);
}
@@ -2572,17 +2668,21 @@ CIMGUI_API void igImMul(ImVec2 *pOut,const ImVec2 lhs,const ImVec2 rhs)
{
*pOut = ImMul(lhs,rhs);
}
CIMGUI_API void igImBezierCalc(ImVec2 *pOut,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,float t)
CIMGUI_API void igImBezierCubicCalc(ImVec2 *pOut,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,float t)
{
*pOut = ImBezierCalc(p1,p2,p3,p4,t);
*pOut = ImBezierCubicCalc(p1,p2,p3,p4,t);
}
CIMGUI_API void igImBezierClosestPoint(ImVec2 *pOut,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,const ImVec2 p,int num_segments)
CIMGUI_API void igImBezierCubicClosestPoint(ImVec2 *pOut,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,const ImVec2 p,int num_segments)
{
*pOut = ImBezierClosestPoint(p1,p2,p3,p4,p,num_segments);
*pOut = ImBezierCubicClosestPoint(p1,p2,p3,p4,p,num_segments);
}
CIMGUI_API void igImBezierClosestPointCasteljau(ImVec2 *pOut,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,const ImVec2 p,float tess_tol)
CIMGUI_API void igImBezierCubicClosestPointCasteljau(ImVec2 *pOut,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,const ImVec2 p,float tess_tol)
{
*pOut = ImBezierClosestPointCasteljau(p1,p2,p3,p4,p,tess_tol);
*pOut = ImBezierCubicClosestPointCasteljau(p1,p2,p3,p4,p,tess_tol);
}
CIMGUI_API void igImBezierQuadraticCalc(ImVec2 *pOut,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,float t)
{
*pOut = ImBezierQuadraticCalc(p1,p2,p3,t);
}
CIMGUI_API void igImLineClosestPoint(ImVec2 *pOut,const ImVec2 a,const ImVec2 b,const ImVec2 p)
{
@@ -2948,26 +3048,22 @@ CIMGUI_API ImGuiPtrOrIndex* ImGuiPtrOrIndex_ImGuiPtrOrIndexInt(int index)
{
return IM_NEW(ImGuiPtrOrIndex)(index);
}
CIMGUI_API ImGuiColumnData* ImGuiColumnData_ImGuiColumnData(void)
CIMGUI_API ImGuiOldColumnData* ImGuiOldColumnData_ImGuiOldColumnData(void)
{
return IM_NEW(ImGuiColumnData)();
return IM_NEW(ImGuiOldColumnData)();
}
CIMGUI_API void ImGuiColumnData_destroy(ImGuiColumnData* self)
CIMGUI_API void ImGuiOldColumnData_destroy(ImGuiOldColumnData* self)
{
IM_DELETE(self);
}
CIMGUI_API ImGuiColumns* ImGuiColumns_ImGuiColumns(void)
CIMGUI_API ImGuiOldColumns* ImGuiOldColumns_ImGuiOldColumns(void)
{
return IM_NEW(ImGuiColumns)();
return IM_NEW(ImGuiOldColumns)();
}
CIMGUI_API void ImGuiColumns_destroy(ImGuiColumns* self)
CIMGUI_API void ImGuiOldColumns_destroy(ImGuiOldColumns* self)
{
IM_DELETE(self);
}
CIMGUI_API void ImGuiColumns_Clear(ImGuiColumns* self)
{
return self->Clear();
}
CIMGUI_API ImGuiWindowSettings* ImGuiWindowSettings_ImGuiWindowSettings(void)
{
return IM_NEW(ImGuiWindowSettings)();
@@ -2988,6 +3084,38 @@ CIMGUI_API void ImGuiSettingsHandler_destroy(ImGuiSettingsHandler* self)
{
IM_DELETE(self);
}
CIMGUI_API ImGuiMetricsConfig* ImGuiMetricsConfig_ImGuiMetricsConfig(void)
{
return IM_NEW(ImGuiMetricsConfig)();
}
CIMGUI_API void ImGuiMetricsConfig_destroy(ImGuiMetricsConfig* self)
{
IM_DELETE(self);
}
CIMGUI_API ImGuiStackSizes* ImGuiStackSizes_ImGuiStackSizes(void)
{
return IM_NEW(ImGuiStackSizes)();
}
CIMGUI_API void ImGuiStackSizes_destroy(ImGuiStackSizes* self)
{
IM_DELETE(self);
}
CIMGUI_API void ImGuiStackSizes_SetToCurrentState(ImGuiStackSizes* self)
{
return self->SetToCurrentState();
}
CIMGUI_API void ImGuiStackSizes_CompareWithCurrentState(ImGuiStackSizes* self)
{
return self->CompareWithCurrentState();
}
CIMGUI_API ImGuiContextHook* ImGuiContextHook_ImGuiContextHook(void)
{
return IM_NEW(ImGuiContextHook)();
}
CIMGUI_API void ImGuiContextHook_destroy(ImGuiContextHook* self)
{
IM_DELETE(self);
}
CIMGUI_API ImGuiContext* ImGuiContext_ImGuiContext(ImFontAtlas* shared_font_atlas)
{
return IM_NEW(ImGuiContext)(shared_font_atlas);
@@ -2996,14 +3124,6 @@ CIMGUI_API void ImGuiContext_destroy(ImGuiContext* self)
{
IM_DELETE(self);
}
CIMGUI_API ImGuiWindowTempData* ImGuiWindowTempData_ImGuiWindowTempData(void)
{
return IM_NEW(ImGuiWindowTempData)();
}
CIMGUI_API void ImGuiWindowTempData_destroy(ImGuiWindowTempData* self)
{
IM_DELETE(self);
}
CIMGUI_API ImGuiWindow* ImGuiWindow_ImGuiWindow(ImGuiContext* context,const char* name)
{
return IM_NEW(ImGuiWindow)(context,name);
@@ -3104,6 +3224,42 @@ CIMGUI_API const char* ImGuiTabBar_GetTabName(ImGuiTabBar* self,const ImGuiTabIt
{
return self->GetTabName(tab);
}
CIMGUI_API ImGuiTableColumn* ImGuiTableColumn_ImGuiTableColumn(void)
{
return IM_NEW(ImGuiTableColumn)();
}
CIMGUI_API void ImGuiTableColumn_destroy(ImGuiTableColumn* self)
{
IM_DELETE(self);
}
CIMGUI_API ImGuiTable* ImGuiTable_ImGuiTable(void)
{
return IM_NEW(ImGuiTable)();
}
CIMGUI_API void ImGuiTable_destroy(ImGuiTable* self)
{
IM_DELETE(self);
}
CIMGUI_API ImGuiTableColumnSettings* ImGuiTableColumnSettings_ImGuiTableColumnSettings(void)
{
return IM_NEW(ImGuiTableColumnSettings)();
}
CIMGUI_API void ImGuiTableColumnSettings_destroy(ImGuiTableColumnSettings* self)
{
IM_DELETE(self);
}
CIMGUI_API ImGuiTableSettings* ImGuiTableSettings_ImGuiTableSettings(void)
{
return IM_NEW(ImGuiTableSettings)();
}
CIMGUI_API void ImGuiTableSettings_destroy(ImGuiTableSettings* self)
{
IM_DELETE(self);
}
CIMGUI_API ImGuiTableColumnSettings* ImGuiTableSettings_GetColumnSettings(ImGuiTableSettings* self)
{
return self->GetColumnSettings();
}
CIMGUI_API ImGuiWindow* igGetCurrentWindowRead()
{
return ImGui::GetCurrentWindowRead();
@@ -3124,14 +3280,18 @@ CIMGUI_API void igUpdateWindowParentAndRootLinks(ImGuiWindow* window,ImGuiWindow
{
return ImGui::UpdateWindowParentAndRootLinks(window,flags,parent_window);
}
CIMGUI_API void igCalcWindowExpectedSize(ImVec2 *pOut,ImGuiWindow* window)
CIMGUI_API void igCalcWindowNextAutoFitSize(ImVec2 *pOut,ImGuiWindow* window)
{
*pOut = ImGui::CalcWindowExpectedSize(window);
*pOut = ImGui::CalcWindowNextAutoFitSize(window);
}
CIMGUI_API bool igIsWindowChildOf(ImGuiWindow* window,ImGuiWindow* potential_parent)
{
return ImGui::IsWindowChildOf(window,potential_parent);
}
CIMGUI_API bool igIsWindowAbove(ImGuiWindow* potential_above,ImGuiWindow* potential_below)
{
return ImGui::IsWindowAbove(potential_above,potential_below);
}
CIMGUI_API bool igIsWindowNavFocusable(ImGuiWindow* window)
{
return ImGui::IsWindowNavFocusable(window);
@@ -3212,6 +3372,14 @@ CIMGUI_API void igUpdateMouseMovingWindowEndFrame()
{
return ImGui::UpdateMouseMovingWindowEndFrame();
}
CIMGUI_API void igAddContextHook(ImGuiContext* context,const ImGuiContextHook* hook)
{
return ImGui::AddContextHook(context,hook);
}
CIMGUI_API void igCallContextHooks(ImGuiContext* context,ImGuiContextHookType type)
{
return ImGui::CallContextHooks(context,type);
}
CIMGUI_API void igMarkIniSettingsDirtyNil()
{
return ImGui::MarkIniSettingsDirty();
@@ -3280,6 +3448,10 @@ CIMGUI_API ImGuiID igGetFocusID()
{
return ImGui::GetFocusID();
}
CIMGUI_API ImGuiItemFlags igGetItemsFlags()
{
return ImGui::GetItemsFlags();
}
CIMGUI_API void igSetActiveID(ImGuiID id,ImGuiWindow* window)
{
return ImGui::SetActiveID(id,window);
@@ -3480,9 +3652,17 @@ CIMGUI_API void igPopFocusScope()
{
return ImGui::PopFocusScope();
}
CIMGUI_API ImGuiID igGetFocusScopeID()
CIMGUI_API ImGuiID igGetFocusedFocusScope()
{
return ImGui::GetFocusScopeID();
return ImGui::GetFocusedFocusScope();
}
CIMGUI_API ImGuiID igGetFocusScope()
{
return ImGui::GetFocusScope();
}
CIMGUI_API void igSetItemUsingMouseWheel()
{
return ImGui::SetItemUsingMouseWheel();
}
CIMGUI_API bool igIsActiveIdUsingNavDir(ImGuiDir dir)
{
@@ -3532,7 +3712,7 @@ CIMGUI_API void igSetWindowClipRectBeforeSetChannel(ImGuiWindow* window,const Im
{
return ImGui::SetWindowClipRectBeforeSetChannel(window,clip_rect);
}
CIMGUI_API void igBeginColumns(const char* str_id,int count,ImGuiColumnsFlags flags)
CIMGUI_API void igBeginColumns(const char* str_id,int count,ImGuiOldColumnFlags flags)
{
return ImGui::BeginColumns(str_id,count,flags);
}
@@ -3556,18 +3736,190 @@ CIMGUI_API ImGuiID igGetColumnsID(const char* str_id,int count)
{
return ImGui::GetColumnsID(str_id,count);
}
CIMGUI_API ImGuiColumns* igFindOrCreateColumns(ImGuiWindow* window,ImGuiID id)
CIMGUI_API ImGuiOldColumns* igFindOrCreateColumns(ImGuiWindow* window,ImGuiID id)
{
return ImGui::FindOrCreateColumns(window,id);
}
CIMGUI_API float igGetColumnOffsetFromNorm(const ImGuiColumns* columns,float offset_norm)
CIMGUI_API float igGetColumnOffsetFromNorm(const ImGuiOldColumns* columns,float offset_norm)
{
return ImGui::GetColumnOffsetFromNorm(columns,offset_norm);
}
CIMGUI_API float igGetColumnNormFromOffset(const ImGuiColumns* columns,float offset)
CIMGUI_API float igGetColumnNormFromOffset(const ImGuiOldColumns* columns,float offset)
{
return ImGui::GetColumnNormFromOffset(columns,offset);
}
CIMGUI_API void igTableOpenContextMenu(int column_n)
{
return ImGui::TableOpenContextMenu(column_n);
}
CIMGUI_API void igTableSetColumnWidth(int column_n,float width)
{
return ImGui::TableSetColumnWidth(column_n,width);
}
CIMGUI_API void igTableSetColumnSortDirection(int column_n,ImGuiSortDirection sort_direction,bool append_to_sort_specs)
{
return ImGui::TableSetColumnSortDirection(column_n,sort_direction,append_to_sort_specs);
}
CIMGUI_API int igTableGetHoveredColumn()
{
return ImGui::TableGetHoveredColumn();
}
CIMGUI_API float igTableGetHeaderRowHeight()
{
return ImGui::TableGetHeaderRowHeight();
}
CIMGUI_API void igTablePushBackgroundChannel()
{
return ImGui::TablePushBackgroundChannel();
}
CIMGUI_API void igTablePopBackgroundChannel()
{
return ImGui::TablePopBackgroundChannel();
}
CIMGUI_API ImGuiTable* igTableFindByID(ImGuiID id)
{
return ImGui::TableFindByID(id);
}
CIMGUI_API bool igBeginTableEx(const char* name,ImGuiID id,int columns_count,ImGuiTableFlags flags,const ImVec2 outer_size,float inner_width)
{
return ImGui::BeginTableEx(name,id,columns_count,flags,outer_size,inner_width);
}
CIMGUI_API void igTableBeginInitMemory(ImGuiTable* table,int columns_count)
{
return ImGui::TableBeginInitMemory(table,columns_count);
}
CIMGUI_API void igTableBeginApplyRequests(ImGuiTable* table)
{
return ImGui::TableBeginApplyRequests(table);
}
CIMGUI_API void igTableSetupDrawChannels(ImGuiTable* table)
{
return ImGui::TableSetupDrawChannels(table);
}
CIMGUI_API void igTableUpdateLayout(ImGuiTable* table)
{
return ImGui::TableUpdateLayout(table);
}
CIMGUI_API void igTableUpdateBorders(ImGuiTable* table)
{
return ImGui::TableUpdateBorders(table);
}
CIMGUI_API void igTableUpdateColumnsWeightFromWidth(ImGuiTable* table)
{
return ImGui::TableUpdateColumnsWeightFromWidth(table);
}
CIMGUI_API void igTableDrawBorders(ImGuiTable* table)
{
return ImGui::TableDrawBorders(table);
}
CIMGUI_API void igTableDrawContextMenu(ImGuiTable* table)
{
return ImGui::TableDrawContextMenu(table);
}
CIMGUI_API void igTableMergeDrawChannels(ImGuiTable* table)
{
return ImGui::TableMergeDrawChannels(table);
}
CIMGUI_API void igTableSortSpecsSanitize(ImGuiTable* table)
{
return ImGui::TableSortSpecsSanitize(table);
}
CIMGUI_API void igTableSortSpecsBuild(ImGuiTable* table)
{
return ImGui::TableSortSpecsBuild(table);
}
CIMGUI_API ImGuiSortDirection igTableGetColumnNextSortDirection(ImGuiTableColumn* column)
{
return ImGui::TableGetColumnNextSortDirection(column);
}
CIMGUI_API void igTableFixColumnSortDirection(ImGuiTable* table,ImGuiTableColumn* column)
{
return ImGui::TableFixColumnSortDirection(table,column);
}
CIMGUI_API float igTableGetColumnWidthAuto(ImGuiTable* table,ImGuiTableColumn* column)
{
return ImGui::TableGetColumnWidthAuto(table,column);
}
CIMGUI_API void igTableBeginRow(ImGuiTable* table)
{
return ImGui::TableBeginRow(table);
}
CIMGUI_API void igTableEndRow(ImGuiTable* table)
{
return ImGui::TableEndRow(table);
}
CIMGUI_API void igTableBeginCell(ImGuiTable* table,int column_n)
{
return ImGui::TableBeginCell(table,column_n);
}
CIMGUI_API void igTableEndCell(ImGuiTable* table)
{
return ImGui::TableEndCell(table);
}
CIMGUI_API void igTableGetCellBgRect(ImRect *pOut,const ImGuiTable* table,int column_n)
{
*pOut = ImGui::TableGetCellBgRect(table,column_n);
}
CIMGUI_API const char* igTableGetColumnNameTablePtr(const ImGuiTable* table,int column_n)
{
return ImGui::TableGetColumnName(table,column_n);
}
CIMGUI_API ImGuiID igTableGetColumnResizeID(const ImGuiTable* table,int column_n,int instance_no)
{
return ImGui::TableGetColumnResizeID(table,column_n,instance_no);
}
CIMGUI_API float igTableGetMaxColumnWidth(const ImGuiTable* table,int column_n)
{
return ImGui::TableGetMaxColumnWidth(table,column_n);
}
CIMGUI_API void igTableSetColumnWidthAutoSingle(ImGuiTable* table,int column_n)
{
return ImGui::TableSetColumnWidthAutoSingle(table,column_n);
}
CIMGUI_API void igTableSetColumnWidthAutoAll(ImGuiTable* table)
{
return ImGui::TableSetColumnWidthAutoAll(table);
}
CIMGUI_API void igTableRemove(ImGuiTable* table)
{
return ImGui::TableRemove(table);
}
CIMGUI_API void igTableGcCompactTransientBuffers(ImGuiTable* table)
{
return ImGui::TableGcCompactTransientBuffers(table);
}
CIMGUI_API void igTableGcCompactSettings()
{
return ImGui::TableGcCompactSettings();
}
CIMGUI_API void igTableLoadSettings(ImGuiTable* table)
{
return ImGui::TableLoadSettings(table);
}
CIMGUI_API void igTableSaveSettings(ImGuiTable* table)
{
return ImGui::TableSaveSettings(table);
}
CIMGUI_API void igTableResetSettings(ImGuiTable* table)
{
return ImGui::TableResetSettings(table);
}
CIMGUI_API ImGuiTableSettings* igTableGetBoundSettings(ImGuiTable* table)
{
return ImGui::TableGetBoundSettings(table);
}
CIMGUI_API void igTableSettingsInstallHandler(ImGuiContext* context)
{
return ImGui::TableSettingsInstallHandler(context);
}
CIMGUI_API ImGuiTableSettings* igTableSettingsCreate(ImGuiID id,int columns_count)
{
return ImGui::TableSettingsCreate(id,columns_count);
}
CIMGUI_API ImGuiTableSettings* igTableSettingsFindByID(ImGuiID id)
{
return ImGui::TableSettingsFindByID(id);
}
CIMGUI_API bool igBeginTabBarEx(ImGuiTabBar* tab_bar,const ImRect bb,ImGuiTabBarFlags flags)
{
return ImGui::BeginTabBarEx(tab_bar,bb,flags);
@@ -3604,9 +3956,9 @@ CIMGUI_API void igTabItemBackground(ImDrawList* draw_list,const ImRect bb,ImGuiT
{
return ImGui::TabItemBackground(draw_list,bb,flags,col);
}
CIMGUI_API bool igTabItemLabelAndCloseButton(ImDrawList* draw_list,const ImRect bb,ImGuiTabItemFlags flags,ImVec2 frame_padding,const char* label,ImGuiID tab_id,ImGuiID close_button_id,bool is_contents_visible)
CIMGUI_API void igTabItemLabelAndCloseButton(ImDrawList* draw_list,const ImRect bb,ImGuiTabItemFlags flags,ImVec2 frame_padding,const char* label,ImGuiID tab_id,ImGuiID close_button_id,bool is_contents_visible,bool* out_just_closed,bool* out_text_clipped)
{
return ImGui::TabItemLabelAndCloseButton(draw_list,bb,flags,frame_padding,label,tab_id,close_button_id,is_contents_visible);
return ImGui::TabItemLabelAndCloseButton(draw_list,bb,flags,frame_padding,label,tab_id,close_button_id,is_contents_visible,out_just_closed,out_text_clipped);
}
CIMGUI_API void igRenderText(ImVec2 pos,const char* text,const char* text_end,bool hide_text_after_hash)
{
@@ -3728,6 +4080,14 @@ CIMGUI_API void igSeparatorEx(ImGuiSeparatorFlags flags)
{
return ImGui::SeparatorEx(flags);
}
CIMGUI_API bool igCheckboxFlagsS64Ptr(const char* label,ImS64* flags,ImS64 flags_value)
{
return ImGui::CheckboxFlags(label,flags,flags_value);
}
CIMGUI_API bool igCheckboxFlagsU64Ptr(const char* label,ImU64* flags,ImU64 flags_value)
{
return ImGui::CheckboxFlags(label,flags,flags_value);
}
CIMGUI_API bool igButtonBehavior(const ImRect bb,ImGuiID id,bool* out_hovered,bool* out_held,ImGuiButtonFlags flags)
{
return ImGui::ButtonBehavior(bb,id,out_hovered,out_held,flags);
@@ -3824,6 +4184,10 @@ CIMGUI_API void igShadeVertsLinearUV(ImDrawList* draw_list,int vert_start_idx,in
{
return ImGui::ShadeVertsLinearUV(draw_list,vert_start_idx,vert_end_idx,a,b,uv_a,uv_b,clamp);
}
CIMGUI_API void igGcCompactTransientMiscBuffers()
{
return ImGui::GcCompactTransientMiscBuffers();
}
CIMGUI_API void igGcCompactTransientWindowBuffers(ImGuiWindow* window)
{
return ImGui::GcCompactTransientWindowBuffers(window);
@@ -3832,6 +4196,10 @@ CIMGUI_API void igGcAwakeTransientWindowBuffers(ImGuiWindow* window)
{
return ImGui::GcAwakeTransientWindowBuffers(window);
}
CIMGUI_API void igErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback,void* user_data)
{
return ImGui::ErrorCheckEndFrameRecover(log_callback,user_data);
}
CIMGUI_API void igDebugDrawItemRect(ImU32 col)
{
return ImGui::DebugDrawItemRect(col);
@@ -3840,6 +4208,46 @@ CIMGUI_API void igDebugStartItemPicker()
{
return ImGui::DebugStartItemPicker();
}
CIMGUI_API void igDebugNodeColumns(ImGuiOldColumns* columns)
{
return ImGui::DebugNodeColumns(columns);
}
CIMGUI_API void igDebugNodeDrawList(ImGuiWindow* window,const ImDrawList* draw_list,const char* label)
{
return ImGui::DebugNodeDrawList(window,draw_list,label);
}
CIMGUI_API void igDebugNodeDrawCmdShowMeshAndBoundingBox(ImGuiWindow* window,const ImDrawList* draw_list,const ImDrawCmd* draw_cmd,bool show_mesh,bool show_aabb)
{
return ImGui::DebugNodeDrawCmdShowMeshAndBoundingBox(window,draw_list,draw_cmd,show_mesh,show_aabb);
}
CIMGUI_API void igDebugNodeStorage(ImGuiStorage* storage,const char* label)
{
return ImGui::DebugNodeStorage(storage,label);
}
CIMGUI_API void igDebugNodeTabBar(ImGuiTabBar* tab_bar,const char* label)
{
return ImGui::DebugNodeTabBar(tab_bar,label);
}
CIMGUI_API void igDebugNodeTable(ImGuiTable* table)
{
return ImGui::DebugNodeTable(table);
}
CIMGUI_API void igDebugNodeTableSettings(ImGuiTableSettings* settings)
{
return ImGui::DebugNodeTableSettings(settings);
}
CIMGUI_API void igDebugNodeWindow(ImGuiWindow* window,const char* label)
{
return ImGui::DebugNodeWindow(window,label);
}
CIMGUI_API void igDebugNodeWindowSettings(ImGuiWindowSettings* settings)
{
return ImGui::DebugNodeWindowSettings(settings);
}
CIMGUI_API void igDebugNodeWindowsList(ImVector_ImGuiWindowPtr* windows,const char* label)
{
return ImGui::DebugNodeWindowsList(windows,label);
}
CIMGUI_API bool igImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
{
return ImFontAtlasBuildWithStbTruetype(atlas);
@@ -3899,6 +4307,11 @@ CIMGUI_API float igGET_FLT_MAX()
return FLT_MAX;
}
CIMGUI_API float igGET_FLT_MIN()
{
return FLT_MIN;
}
CIMGUI_API ImVector_ImWchar* ImVector_ImWchar_create()
{

661
cimgui.h

File diff suppressed because it is too large Load Diff

View File

@@ -35,6 +35,11 @@ CIMGUI_API float igGET_FLT_MAX()
return FLT_MAX;
}
CIMGUI_API float igGET_FLT_MIN()
{
return FLT_MIN;
}
CIMGUI_API ImVector_ImWchar* ImVector_ImWchar_create()
{

View File

@@ -55,6 +55,8 @@ CIMGUI_API void igLogText(CONST char *fmt, ...);
CIMGUI_API void ImGuiTextBuffer_appendf(struct ImGuiTextBuffer *buffer, const char *fmt, ...);
//for getting FLT_MAX in bindings
CIMGUI_API float igGET_FLT_MAX();
//for getting FLT_MIN in bindings
CIMGUI_API float igGET_FLT_MIN();
CIMGUI_API ImVector_ImWchar* ImVector_ImWchar_create();

View File

@@ -182,6 +182,9 @@ local function parse_enum_value(value, allenums,dontpost)
local val2 = clean(several[i+1])
if allenums[val1] then val1 = allenums[val1] end
if allenums[val2] then val2 = allenums[val2] end
--for getting numbers from "1ULL"
if type(val1)=="string" then val1 = loadstring("return "..val1)() end
if type(val2)=="string" then val2 = loadstring("return "..val2)() end
if v=="~" then
assert(several[i]==" " or several[i]=="")
several[i] = bit.bnot(val2)
@@ -214,12 +217,14 @@ local function parse_enum_value(value, allenums,dontpost)
end
if #seps>0 or type(several[1])~="number" and not dontpost then
--M.prtable("enline",enline)
print("parse_enum_value WARNING",value)
print("parse_enum_value WARNING",value,several[1])
--M.prtable(several,seps)
--M.prtable("allenums",allenums)
end
assert(#seps==0)
assert(type(several[1])=="number")
assert(type(several[1])=="number" or type(several[1])=="cdata")
--converst 1ULL to "1ULL"
if type(several[1])=="cdata" then several[1] = tostring(several[1]) end
return several[1]
end
end
@@ -273,7 +278,7 @@ local function getRE()
structenum_re = "^([^;{}]-%b{}[%s%w_%(%)]*;)",
namespace_re = "^([^;{}]-namespace[^;{}]-%b{})",
class_re = "^([^;{}]-class[^;{}]-%b{}%s*;)",
typedef_re = "^\n*(typedef[^;]+;)",
typedef_re = "^\n*%s*(typedef[^;]+;)",
typedef_st_re = "^\n*(typedef%s+struct%s*%b{}.-;)",
functypedef_re = "^\n*%s*(typedef[%w%s%*_]+%(%s*%*%s*[%w_]+%s*%)%s*%b()%s*;)",
functypedef_re = "^\n*%s*(typedef[%w%s%*_]+%([^*]*%*%s*[%w_]+%s*%)%s*%b()%s*;)",
@@ -365,7 +370,12 @@ local function parseItems(txt,linenumdict, itparent, dumpit)
loca = table.remove(loca,1)
end
if not loca then
print(itemold)
print(string.format("%q , %q ",itemold,itemfirstline),#itemfirstline)
for k,v in pairs(linenumdict) do
if k:match(itemfirstline) then
print(string.format("%q",k),#k)
end
end
error"no entry in linenumdict"
end
else
@@ -935,7 +945,9 @@ function M.Parser()
par.UDTs = {}
function par:insert(line,loca)
table.insert(cdefs,{line,loca})
--table.insert(cdefs,{line,loca})
--table.insert(cdefs,{line:gsub("^%s*(.-)%s*$", "%1"),loca})
table.insert(cdefs,{line:gsub("^(%s*.-)%s*$", "%1"),loca})
end
function par.getCname(stname,funcname, namespace)
if #stname == 0 then return funcname end --top level
@@ -967,6 +979,7 @@ function M.Parser()
end
function par:do_parse()
self:parseItems()
self:gen_structs_and_enums_table()
self:gen_structs_and_enums()
self:compute_overloads()
--self:compute_templated()
@@ -1017,12 +1030,16 @@ function M.Parser()
child.parent = it
end
if it.re_name == "struct_re" then
local typename = it.item:match("%s*template%s*<%s*typename%s*(%S+)%s*>")
local typename = it.item:match("^%s*template%s*<%s*typename%s*(%S+)%s*>")
local stname = it.item:match("struct%s+(%S+)")
it.name = stname
if typename then -- it is a struct template
local templa1,templa2 = it.item:match("^%s*template%s*<%s*(%S+)%s*(%S+)%s*>")
if templa1 or templa2 then print("template found",stname,templa1,templa2,"typename",typename) end
if typename or templa2 then -- it is a struct template
self.typenames = self.typenames or {}
self.typenames[stname] = typename
self.typenames[stname] = typename or templa2
end
elseif it.re_name == "namespace_re" then
it.name = it.item:match("namespace%s+(%S+)")
@@ -1144,7 +1161,7 @@ function M.Parser()
elseif it.re_name == "enum_re" then
--nop
elseif it.re_name ~= "functionD_re" and it.re_name ~= "function_re" then
print(it.re_name,"not processed clean_struct",it.item:sub(1,12))
print(it.re_name,"not processed clean_struct in",stname,it.item:sub(1,24))
--M.prtable(it)
end
end
@@ -1160,6 +1177,15 @@ function M.Parser()
end
return parnam
end
local function get_parents_nameC(it)
local parnam = ""
while it.parent do
parnam = it.parent.name.."::"..parnam
it = it.parent
end
if parnam~="" then parnam = parnam:sub(1,-3) end
return parnam
end
function par:gen_structs_and_enums()
local outtab = {}
local outtabpre = {}
@@ -1182,10 +1208,28 @@ function M.Parser()
end
end
elseif it.re_name == "enum_re" then
local enumname, enumbody = it.item:match"^%s*enum%s+([^%s;{}]+)[%s\n\r]*(%b{})"
--local enumname, enumbody = it.item:match"^%s*enum%s+([^%s;{}]+)[%s\n\r]*(%b{})"
local enumname = it.item:match"^%s*enum%s+([^%s;{}]+)"
if enumname then
enumbody = clean_comments(enumbody)
table.insert(outtab,"\ntypedef enum ".. enumbody..enumname..";")
--if it's an enum with int type changed
if self.structs_and_enums_table.enumtypes[enumname] then
local enumtype = self.structs_and_enums_table.enumtypes[enumname]
local enumbody = ""
local extraenums = ""
for i,v in ipairs(self.structs_and_enums_table.enums[enumname]) do
if type(v.calc_value)=="string" then
extraenums = extraenums .."\nstatic const "..enumtype.." "..v.name.." = "..v.calc_value..";"
else
enumbody = enumbody .. "\n" ..v.name .."="..v.value..","
end
end
enumbody = "{"..enumbody.."\n}"
table.insert(outtab,"\ntypedef enum ".. enumbody..enumname..";"..extraenums)
else
local enumbody = it.item:match"(%b{})"
enumbody = clean_comments(enumbody)
table.insert(outtab,"\ntypedef enum ".. enumbody..enumname..";")
end
if it.parent then
if it.parent.re_name == "namespace_re" then
local namespace = it.parent.item:match("namespace%s+(%S+)")
@@ -1195,6 +1239,7 @@ function M.Parser()
else --unamed enum just repeat declaration
local cl_item = clean_comments(it.item)
table.insert(outtab,cl_item)
print("unnamed enum",cl_item)
end
elseif it.re_name == "struct_re" or it.re_name == "typedef_st_re" then
local cleanst,structname,strtab,comstab,predec = self:clean_structR1(it)
@@ -1224,12 +1269,12 @@ function M.Parser()
if it.parent.re_name == "struct_re" or it.parent.re_name == "typedef_st_re" then
stname = it.parent.name
elseif it.parent.re_name == "namespace_re" then
namespace = it.parent.name
namespace = get_parents_nameC(it) --it.parent.name
end
end
if it.item:match"^%s*template%s+<" then
local ttype,fun = it.item:match"^%s*template%s+<%s*typename%s+([^>]+)%s*>%s*(.+)$"
if self.ftemplate_list then
if self.ftemplate_list and self.ftemplate_list[ttype] then
for iT,vT in ipairs(self.ftemplate_list[ttype]) do
local funT = fun:gsub(ttype,vT)
self:parseFunction(stname,{item=funT},namespace,it.locat)
@@ -1306,6 +1351,11 @@ function M.Parser()
enumname = "unnamed"..unnamed_enum_counter
print("unamed enum",enumname,it.parent and ("parent:"..it.parent.name) or "no parent")
end
local enumtype = it.item:match"^%s*enum%s+[^%s;{}:]+%s*:%s*([^{%s]+)"
if enumtype then
print("enumtype",enumtype)
outtab.enumtypes[enumname] = enumtype
end
outtab.enums[enumname] = {}
table.insert(enumsordered,enumname)
local inner = strip_end(it.item:match("%b{}"):sub(2,-2))
@@ -1353,7 +1403,7 @@ function M.Parser()
end
par.enums_for_table = enums_for_table
function par:gen_structs_and_enums_table()
local outtab = {enums={},structs={},locations={}}
local outtab = {enums={},structs={},locations={},enumtypes={}}
self.typedefs_table = {}
local enumsordered = {}
unnamed_enum_counter = 0
@@ -1377,6 +1427,8 @@ function M.Parser()
for j=3,#strtab-1 do
self:parse_struct_line(strtab[j],outtab.structs[structname],comstab[j])
end
else
print("skipped unnamed or templated struct",structname)
end
elseif it.re_name == "namespace_re" or it.re_name == "union_re" or it.re_name == "functype_re" then
--nop
@@ -1414,10 +1466,15 @@ function M.Parser()
f()
t.size = estevalor
end
assert(t.size,val)
--assert(t.size,val)
if not t.size then
print("not t.size for",val,"in",t.name)
error"not t.size"
end
end
end
end
self.structs_and_enums_table = outtab
return outtab
end
par.alltypes = {}

View File

@@ -17,7 +17,7 @@ set PATH=%PATH%;C:\anima;C:\mingws\i686-7.2.0-release-posix-dwarf-rt_v5-rev1\min
:: arg[1] compiler name gcc, clang or cl
:: arg[2] options as words in one string: internal for imgui_internal generation, freetype for freetype generation
:: examples: "" "internal" "internal freetype"
:: arg[3..n] name of implementations to generate
:: arg[3..n] name of implementations to generate and/or CFLAGS (e.g. -DIMGUI_USER_CONFIG or -DIMGUI_USE_WCHAR32)
luajit ./generator.lua gcc "internal" glfw opengl3 opengl2 sdl
::leave console open

View File

@@ -8,12 +8,28 @@ local script_args = {...}
local COMPILER = script_args[1]
local INTERNAL_GENERATION = script_args[2]:match("internal") and true or false
local FREETYPE_GENERATION = script_args[2]:match("freetype") and true or false
local CFLAGS = ""
local CPRE,CTEST
--get implementations
local implementations = {}
for i=3,#script_args do
if script_args[i]:match(COMPILER == cl and "^/" or "^%-") then
local key, value = script_args[i]:match("^(.+)=(.+)$")
if key and value then
CFLAGS = CFLAGS .. " " .. key .. "=\"" .. value:gsub("\"", "\\\"") .. "\"";
else
CFLAGS = CFLAGS .. " " .. script_args[i]
end
else
table.insert(implementations,script_args[i])
end
end
if COMPILER == "gcc" or COMPILER == "clang" then
CPRE = COMPILER..[[ -E -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS -DIMGUI_API="" -DIMGUI_IMPL_API="" ]]
CPRE = COMPILER..[[ -E -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS -DIMGUI_API="" -DIMGUI_IMPL_API="" ]] .. CFLAGS
CTEST = COMPILER.." --version"
elseif COMPILER == "cl" then
CPRE = COMPILER..[[ /E /DIMGUI_DISABLE_OBSOLETE_FUNCTIONS /DIMGUI_API="" /DIMGUI_IMPL_API="" ]]
CPRE = COMPILER..[[ /E /DIMGUI_DISABLE_OBSOLETE_FUNCTIONS /DIMGUI_API="" /DIMGUI_IMPL_API="" ]] .. CFLAGS
CTEST = COMPILER
else
print("Working without compiler ")
@@ -42,10 +58,6 @@ assert(HAVE_COMPILER,"gcc, clang or cl needed to run script")
print("HAVE_COMPILER",HAVE_COMPILER)
print("INTERNAL_GENERATION",INTERNAL_GENERATION)
print("FREETYPE_GENERATION",FREETYPE_GENERATION)
--get implementations
local implementations = {}
for i=3,#script_args do table.insert(implementations,script_args[i]) end
--------------------------------------------------------------------------
--this table has the functions to be skipped in generation
--------------------------------------------------------------------------
@@ -124,16 +136,17 @@ local func_implementation = cpp2ffi.func_implementation
-------------------functions for getting and setting defines
local function get_defines(t)
if COMPILER == "cl" then print"can't get defines with cl compiler"; return {} end
local pipe,err = io.popen(COMPILER..[[ -E -dM -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS -DIMGUI_API="" -DIMGUI_IMPL_API="" ../imgui/imgui.h]],"r")
print(COMPILER..[[ -E -dM -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS -DIMGUI_API="" -DIMGUI_IMPL_API="" ../imgui/imgui.h]] .. CFLAGS)
local pipe,err = io.popen(COMPILER..[[ -E -dM -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS -DIMGUI_API="" -DIMGUI_IMPL_API="" ../imgui/imgui.h]] .. CFLAGS,"r")
local defines = {}
while true do
local line = pipe:read"*l"
if not line then break end
local key,value = line:match([[#define%s+(%S+)%s+(.+)]])
if not key or not value then
local key,value = line:match([[#define%s+(%S+)%s*(.*)]])
if not key then --or not value then
--print(line)
else
defines[key]=value
defines[key]=value or ""
end
end
pipe:close()
@@ -155,13 +168,16 @@ local function get_defines(t)
end
return ret
end
--subtitution of FLT_MAX value for FLT_MAX
--subtitution of FLT_MAX value for FLT_MAX or FLT_MIN
local function set_defines(fdefs)
local FLT_MINpat = gdefines.FLT_MIN:gsub("([%.%-])","%%%1")
for k,defT in pairs(fdefs) do
for i,def in ipairs(defT) do
for name,default in pairs(def.defaults) do
if default == gdefines.FLT_MAX then
def.defaults[name] = "FLT_MAX"
elseif default:match(FLT_MINpat) then
def.defaults[name] = default:gsub(FLT_MINpat,"FLT_MIN")
end
end
end
@@ -244,6 +260,13 @@ local function generate_templates(code,codeimpool,templates)
table.insert(code,"typedef struct ImVector_"..newte.." {int Size;int Capacity;"..te.."* Data;} ImVector_"..newte..";\n")
table.insert(code,"typedef struct ImChunkStream_"..newte.." {ImVector_"..te.." Buf;} ImChunkStream_"..newte..";\n")
end)
elseif ttype == "ImSpan" then
table_do_sorted(v, function(te,newte)
table.insert(code,"typedef struct ImSpan_"..newte.." {"..te.."* Data;" ..te.."* DataEnd;} ImSpan_"..newte..";\n")
end)
else
print("generate_templates ttype not done",ttype)
error"generate templates"
end
end)
end
@@ -286,7 +309,11 @@ local function cimgui_generation(parser)
outpost = outpost1..table.concat(outtabpool)..outpost2
local cstructsstr = outpre..table.concat(outtab,"")..outpost --..(extra or "")
if gdefines.IMGUI_HAS_DOCK then
cstructsstr = cstructsstr.."\n#define IMGUI_HAS_DOCK 1\n"
end
hstrfile = hstrfile:gsub([[#include "imgui_structs%.h"]],cstructsstr)
local cfuncsstr = func_header_generate(parser)
hstrfile = hstrfile:gsub([[#include "auto_funcs%.h"]],cfuncsstr)
@@ -304,18 +331,30 @@ end
--------------------------------------------------------
-----------------------------do it----------------------
--------------------------------------------------------
--get imgui.h version--------------------------
--get imgui.h version and IMGUI_HAS_DOCK--------------------------
--get some defines wont work for cl ----------------
gdefines = get_defines{"IMGUI_VERSION","FLT_MAX","FLT_MIN","IMGUI_HAS_DOCK"}
--this will work for cl
local pipe,err = io.open("../imgui/imgui.h","r")
if not pipe then
error("could not open file:"..err)
end
local imgui_version
local imgui_version,has_dock
while true do
local line = pipe:read"*l"
imgui_version = line:match([[#define%s+IMGUI_VERSION%s+(".+")]])
if imgui_version then break end
if not line then break end
if not imgui_version then
imgui_version = line:match([[#define%s+IMGUI_VERSION%s+(".+")]])
end
if not has_dock then
has_dock = line:match([[#define%s+IMGUI_HAS_DOCK]])--%s*(".+")]])
end
if imgui_version and has_dock then break end
end
pipe:close()
if has_dock then gdefines.IMGUI_HAS_DOCK = true end
cimgui_header = cimgui_header:gsub("XXX",imgui_version)
if INTERNAL_GENERATION then
cimgui_header = cimgui_header..[[//with imgui_internal.h api
@@ -325,10 +364,14 @@ if FREETYPE_GENERATION then
cimgui_header = cimgui_header..[[//with imgui_freetype.h api
]]
end
if gdefines.IMGUI_HAS_DOCK then
cimgui_header = cimgui_header..[[//docking branch
]]
end
print("IMGUI_HAS_DOCK",gdefines.IMGUI_HAS_DOCK)
print("IMGUI_VERSION",imgui_version)
--get some defines----------------------------
gdefines = get_defines{"IMGUI_VERSION","FLT_MAX"}
--funtion for parsing imgui headers
local function parseImGuiHeader(header,names)
@@ -377,7 +420,7 @@ cimgui_generation(parser1)
----------save struct and enums lua table in structs_and_enums.lua for using in bindings
local structs_and_enums_table = parser1:gen_structs_and_enums_table()
local structs_and_enums_table = parser1.structs_and_enums_table
save_data("./output/structs_and_enums.lua",serializeTableF(structs_and_enums_table))
save_data("./output/typedefs_dict.lua",serializeTableF(parser1.typedefs_dict))
@@ -395,7 +438,15 @@ save_data("./output/definitions.lua",serializeTableF(parser1.defsT))
-- end
--=================================Now implementations
local backends_folder
local ff,err = io.open ("../imgui/examples/imgui_impl_glfw.h" ,"r")
if ff then
backends_folder = "../imgui/examples/"
ff:close()
else
backends_folder = "../imgui/backends/"
end
local parser2
if #implementations > 0 then
@@ -405,7 +456,7 @@ if #implementations > 0 then
local config = require"config_generator"
for i,impl in ipairs(implementations) do
local source = [[../imgui/examples/imgui_impl_]].. impl .. ".h "
local source = backends_folder .. [[imgui_impl_]].. impl .. ".h "
local locati = [[imgui_impl_]].. impl
local define_cmd = COMPILER=="cl" and [[ /E /D]] or [[ -E -D]]

View File

@@ -15,5 +15,5 @@
# arg[1] compiler name gcc, clang, or cl
# arg[2] options as words in one string: internal for imgui_internal generation, freetype for freetype generation
# examples: "" "internal" "internal freetype"
# arg[3..n] name of implementations to generate
# arg[3..n] name of implementations to generate and/or CLFLAGS (e.g. -DIMGUI_USER_CONFIG or -DIMGUI_USE_WCHAR32)
luajit ./generator.lua gcc "internal" glfw opengl3 opengl2 sdl

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -47,6 +47,19 @@ ImRect_ImRect 4
2 nil ImRect_ImRectVec2 (const ImVec2,const ImVec2)
3 nil ImRect_ImRectVec4 (const ImVec4)
4 nil ImRect_ImRectFloat (float,float,float,float)
ImSpan_ImSpan 3
1 nil ImSpan_ImSpanNil ()
2 nil ImSpan_ImSpanTPtrInt (T*,int)
3 nil ImSpan_ImSpanTPtrTPtr (T*,T*)
ImSpan_begin 2
1 T* ImSpan_beginNil ()
2 const T* ImSpan_begin_const ()const
ImSpan_end 2
1 T* ImSpan_endNil ()
2 const T* ImSpan_end_const ()const
ImSpan_set 2
1 void ImSpan_setInt (T*,int)
2 void ImSpan_setTPtr (T*,T*)
ImVec1_ImVec1 2
1 nil ImVec1_ImVec1Nil ()
2 nil ImVec1_ImVec1Float (float)
@@ -87,6 +100,11 @@ ImVector_resize 2
igBeginChild 2
1 bool igBeginChildStr (const char*,const ImVec2,bool,ImGuiWindowFlags)
2 bool igBeginChildID (ImGuiID,const ImVec2,bool,ImGuiWindowFlags)
igCheckboxFlags 4
1 bool igCheckboxFlagsIntPtr (const char*,int*,int)
2 bool igCheckboxFlagsUintPtr (const char*,unsigned int*,unsigned int)
3 bool igCheckboxFlagsS64Ptr (const char*,ImS64*,ImS64)
4 bool igCheckboxFlagsU64Ptr (const char*,ImU64*,ImU64)
igCollapsingHeader 2
1 bool igCollapsingHeaderTreeNodeFlags (const char*,ImGuiTreeNodeFlags)
2 bool igCollapsingHeaderBoolPtr (const char*,bool*,ImGuiTreeNodeFlags)
@@ -111,6 +129,9 @@ igImAbs 2
igImFloor 2
1 float igImFloorFloat (float)
2 ImVec2 igImFloorVec2 (const ImVec2)
igImIsPowerOfTwo 2
1 bool igImIsPowerOfTwoInt (int)
2 bool igImIsPowerOfTwoU64 (ImU64)
igImLengthSqr 2
1 float igImLengthSqrVec2 (const ImVec2)
2 float igImLengthSqrVec4 (const ImVec4)
@@ -198,6 +219,9 @@ igSetWindowSize 3
1 void igSetWindowSizeVec2 (const ImVec2,ImGuiCond)
2 void igSetWindowSizeStr (const char*,const ImVec2,ImGuiCond)
3 void igSetWindowSizeWindowPtr (ImGuiWindow*,const ImVec2,ImGuiCond)
igTableGetColumnName 2
1 const char* igTableGetColumnNameInt (int)
2 const char* igTableGetColumnNameTablePtr (const ImGuiTable*,int)
igTreeNode 3
1 bool igTreeNodeStr (const char*)
2 bool igTreeNodeStrStr (const char*,const char*,...)
@@ -220,4 +244,4 @@ igValue 4
2 void igValueInt (const char*,int)
3 void igValueUint (const char*,unsigned int)
4 void igValueFloat (const char*,float,const char*)
155 overloaded
172 overloaded

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -4,6 +4,7 @@
"ImDrawCallback": "void(*)(const ImDrawList* parent_list,const ImDrawCmd* cmd);",
"ImDrawChannel": "struct ImDrawChannel",
"ImDrawCmd": "struct ImDrawCmd",
"ImDrawCmdHeader": "struct ImDrawCmdHeader",
"ImDrawCornerFlags": "int",
"ImDrawData": "struct ImDrawData",
"ImDrawDataBuilder": "struct ImDrawDataBuilder",
@@ -26,18 +27,18 @@
"ImGuiCol": "int",
"ImGuiColorEditFlags": "int",
"ImGuiColorMod": "struct ImGuiColorMod",
"ImGuiColumnData": "struct ImGuiColumnData",
"ImGuiColumns": "struct ImGuiColumns",
"ImGuiColumnsFlags": "int",
"ImGuiComboFlags": "int",
"ImGuiCond": "int",
"ImGuiConfigFlags": "int",
"ImGuiContext": "struct ImGuiContext",
"ImGuiContextHook": "struct ImGuiContextHook",
"ImGuiContextHookCallback": "void(*)(ImGuiContext* ctx,ImGuiContextHook* hook);",
"ImGuiDataType": "int",
"ImGuiDataTypeInfo": "struct ImGuiDataTypeInfo",
"ImGuiDataTypeTempStorage": "struct ImGuiDataTypeTempStorage",
"ImGuiDir": "int",
"ImGuiDragDropFlags": "int",
"ImGuiErrorLogCallback": "void(*)(void* user_data,const char* fmt,...);",
"ImGuiFocusedFlags": "int",
"ImGuiGroupData": "struct ImGuiGroupData",
"ImGuiHoveredFlags": "int",
@@ -55,6 +56,7 @@
"ImGuiLayoutType": "int",
"ImGuiListClipper": "struct ImGuiListClipper",
"ImGuiMenuColumns": "struct ImGuiMenuColumns",
"ImGuiMetricsConfig": "struct ImGuiMetricsConfig",
"ImGuiMouseButton": "int",
"ImGuiMouseCursor": "int",
"ImGuiNavDirSourceFlags": "int",
@@ -66,6 +68,9 @@
"ImGuiNextItemDataFlags": "int",
"ImGuiNextWindowData": "struct ImGuiNextWindowData",
"ImGuiNextWindowDataFlags": "int",
"ImGuiOldColumnData": "struct ImGuiOldColumnData",
"ImGuiOldColumnFlags": "int",
"ImGuiOldColumns": "struct ImGuiOldColumns",
"ImGuiOnceUponAFrame": "struct ImGuiOnceUponAFrame",
"ImGuiPayload": "struct ImGuiPayload",
"ImGuiPopupData": "struct ImGuiPopupData",
@@ -78,6 +83,8 @@
"ImGuiSizeCallback": "void(*)(ImGuiSizeCallbackData* data);",
"ImGuiSizeCallbackData": "struct ImGuiSizeCallbackData",
"ImGuiSliderFlags": "int",
"ImGuiSortDirection": "int",
"ImGuiStackSizes": "struct ImGuiStackSizes",
"ImGuiStorage": "struct ImGuiStorage",
"ImGuiStoragePair": "struct ImGuiStoragePair",
"ImGuiStyle": "struct ImGuiStyle",
@@ -87,6 +94,20 @@
"ImGuiTabBarFlags": "int",
"ImGuiTabItem": "struct ImGuiTabItem",
"ImGuiTabItemFlags": "int",
"ImGuiTable": "struct ImGuiTable",
"ImGuiTableBgTarget": "int",
"ImGuiTableCellData": "struct ImGuiTableCellData",
"ImGuiTableColumn": "struct ImGuiTableColumn",
"ImGuiTableColumnFlags": "int",
"ImGuiTableColumnIdx": "ImS8",
"ImGuiTableColumnSettings": "struct ImGuiTableColumnSettings",
"ImGuiTableColumnSortSpecs": "struct ImGuiTableColumnSortSpecs",
"ImGuiTableColumnsSettings": "struct ImGuiTableColumnsSettings",
"ImGuiTableDrawChannelIdx": "ImU8",
"ImGuiTableFlags": "int",
"ImGuiTableRowFlags": "int",
"ImGuiTableSettings": "struct ImGuiTableSettings",
"ImGuiTableSortSpecs": "struct ImGuiTableSortSpecs",
"ImGuiTextBuffer": "struct ImGuiTextBuffer",
"ImGuiTextFilter": "struct ImGuiTextFilter",
"ImGuiTextFlags": "int",

View File

@@ -4,6 +4,7 @@ defs["ImColor"] = "struct ImColor"
defs["ImDrawCallback"] = "void(*)(const ImDrawList* parent_list,const ImDrawCmd* cmd);"
defs["ImDrawChannel"] = "struct ImDrawChannel"
defs["ImDrawCmd"] = "struct ImDrawCmd"
defs["ImDrawCmdHeader"] = "struct ImDrawCmdHeader"
defs["ImDrawCornerFlags"] = "int"
defs["ImDrawData"] = "struct ImDrawData"
defs["ImDrawDataBuilder"] = "struct ImDrawDataBuilder"
@@ -26,18 +27,18 @@ defs["ImGuiButtonFlags"] = "int"
defs["ImGuiCol"] = "int"
defs["ImGuiColorEditFlags"] = "int"
defs["ImGuiColorMod"] = "struct ImGuiColorMod"
defs["ImGuiColumnData"] = "struct ImGuiColumnData"
defs["ImGuiColumns"] = "struct ImGuiColumns"
defs["ImGuiColumnsFlags"] = "int"
defs["ImGuiComboFlags"] = "int"
defs["ImGuiCond"] = "int"
defs["ImGuiConfigFlags"] = "int"
defs["ImGuiContext"] = "struct ImGuiContext"
defs["ImGuiContextHook"] = "struct ImGuiContextHook"
defs["ImGuiContextHookCallback"] = "void(*)(ImGuiContext* ctx,ImGuiContextHook* hook);"
defs["ImGuiDataType"] = "int"
defs["ImGuiDataTypeInfo"] = "struct ImGuiDataTypeInfo"
defs["ImGuiDataTypeTempStorage"] = "struct ImGuiDataTypeTempStorage"
defs["ImGuiDir"] = "int"
defs["ImGuiDragDropFlags"] = "int"
defs["ImGuiErrorLogCallback"] = "void(*)(void* user_data,const char* fmt,...);"
defs["ImGuiFocusedFlags"] = "int"
defs["ImGuiGroupData"] = "struct ImGuiGroupData"
defs["ImGuiHoveredFlags"] = "int"
@@ -55,6 +56,7 @@ defs["ImGuiLastItemDataBackup"] = "struct ImGuiLastItemDataBackup"
defs["ImGuiLayoutType"] = "int"
defs["ImGuiListClipper"] = "struct ImGuiListClipper"
defs["ImGuiMenuColumns"] = "struct ImGuiMenuColumns"
defs["ImGuiMetricsConfig"] = "struct ImGuiMetricsConfig"
defs["ImGuiMouseButton"] = "int"
defs["ImGuiMouseCursor"] = "int"
defs["ImGuiNavDirSourceFlags"] = "int"
@@ -66,6 +68,9 @@ defs["ImGuiNextItemData"] = "struct ImGuiNextItemData"
defs["ImGuiNextItemDataFlags"] = "int"
defs["ImGuiNextWindowData"] = "struct ImGuiNextWindowData"
defs["ImGuiNextWindowDataFlags"] = "int"
defs["ImGuiOldColumnData"] = "struct ImGuiOldColumnData"
defs["ImGuiOldColumnFlags"] = "int"
defs["ImGuiOldColumns"] = "struct ImGuiOldColumns"
defs["ImGuiOnceUponAFrame"] = "struct ImGuiOnceUponAFrame"
defs["ImGuiPayload"] = "struct ImGuiPayload"
defs["ImGuiPopupData"] = "struct ImGuiPopupData"
@@ -78,6 +83,8 @@ defs["ImGuiShrinkWidthItem"] = "struct ImGuiShrinkWidthItem"
defs["ImGuiSizeCallback"] = "void(*)(ImGuiSizeCallbackData* data);"
defs["ImGuiSizeCallbackData"] = "struct ImGuiSizeCallbackData"
defs["ImGuiSliderFlags"] = "int"
defs["ImGuiSortDirection"] = "int"
defs["ImGuiStackSizes"] = "struct ImGuiStackSizes"
defs["ImGuiStorage"] = "struct ImGuiStorage"
defs["ImGuiStoragePair"] = "struct ImGuiStoragePair"
defs["ImGuiStyle"] = "struct ImGuiStyle"
@@ -87,6 +94,20 @@ defs["ImGuiTabBar"] = "struct ImGuiTabBar"
defs["ImGuiTabBarFlags"] = "int"
defs["ImGuiTabItem"] = "struct ImGuiTabItem"
defs["ImGuiTabItemFlags"] = "int"
defs["ImGuiTable"] = "struct ImGuiTable"
defs["ImGuiTableBgTarget"] = "int"
defs["ImGuiTableCellData"] = "struct ImGuiTableCellData"
defs["ImGuiTableColumn"] = "struct ImGuiTableColumn"
defs["ImGuiTableColumnFlags"] = "int"
defs["ImGuiTableColumnIdx"] = "ImS8"
defs["ImGuiTableColumnSettings"] = "struct ImGuiTableColumnSettings"
defs["ImGuiTableColumnSortSpecs"] = "struct ImGuiTableColumnSortSpecs"
defs["ImGuiTableColumnsSettings"] = "struct ImGuiTableColumnsSettings"
defs["ImGuiTableDrawChannelIdx"] = "ImU8"
defs["ImGuiTableFlags"] = "int"
defs["ImGuiTableRowFlags"] = "int"
defs["ImGuiTableSettings"] = "struct ImGuiTableSettings"
defs["ImGuiTableSortSpecs"] = "struct ImGuiTableSortSpecs"
defs["ImGuiTextBuffer"] = "struct ImGuiTextBuffer"
defs["ImGuiTextFilter"] = "struct ImGuiTextFilter"
defs["ImGuiTextFlags"] = "int"

2
imgui

Submodule imgui updated: e5cb04b132...58075c4414

View File

@@ -24,16 +24,19 @@ int main(void)
io->DisplaySize = display_size;
io->DeltaTime = 1.0f / 60.0f;
igNewFrame();
igBegin("mainwindow",NULL,ImGuiWindowFlags_NoTitleBar);
static float f = 0.0f;
igText("Hello World!");
igSliderFloat("float", &f, 0.0f, 1.0f, "%.3f", 1.0f);
igSliderFloat("float", &f, 0.0f, 1.0f, "%.3f", 0);
igText("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io->Framerate, io->Framerate);
igEnd();
igShowDemoWindow(NULL);
igRender();
}
printf("%llu\n",ImGuiWindowFlags_NoTitleBar);
printf("size: %d\n",sizeof(ImGuiWindowFlags_NoTitleBar));
printf("DestroyContext()\n");
igDestroyContext(NULL);