Skip to content

Commit

Permalink
update imgui
Browse files Browse the repository at this point in the history
  • Loading branch information
actboy168 committed Aug 7, 2024
1 parent efdba12 commit d67f76b
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 86 deletions.
2 changes: 1 addition & 1 deletion 3rd/imgui
Submodule imgui updated 51 files
+1 −0 backends/imgui_impl_allegro5.h
+1 −0 backends/imgui_impl_android.h
+1 −0 backends/imgui_impl_dx10.h
+1 −0 backends/imgui_impl_dx11.h
+2 −0 backends/imgui_impl_dx12.h
+1 −0 backends/imgui_impl_dx9.h
+14 −0 backends/imgui_impl_glfw.cpp
+4 −0 backends/imgui_impl_glfw.h
+1 −0 backends/imgui_impl_glut.h
+2 −0 backends/imgui_impl_metal.h
+1 −0 backends/imgui_impl_opengl2.h
+1 −0 backends/imgui_impl_opengl3.cpp
+1 −1 backends/imgui_impl_opengl3.h
+2 −0 backends/imgui_impl_osx.h
+1 −1 backends/imgui_impl_osx.mm
+1 −0 backends/imgui_impl_sdl2.h
+4 −4 backends/imgui_impl_sdl3.cpp
+1 −0 backends/imgui_impl_sdl3.h
+1 −0 backends/imgui_impl_sdlrenderer2.h
+1 −0 backends/imgui_impl_sdlrenderer3.h
+6 −2 backends/imgui_impl_vulkan.cpp
+1 −1 backends/imgui_impl_vulkan.h
+1 −0 backends/imgui_impl_wgpu.h
+1 −0 backends/imgui_impl_win32.h
+19 −19 docs/BACKENDS.md
+105 −45 docs/CHANGELOG.txt
+6 −39 docs/EXAMPLES.md
+3 −3 docs/README.md
+1 −1 examples/example_android_opengl3/android/app/src/main/AndroidManifest.xml
+5 −0 examples/example_glfw_opengl2/main.cpp
+5 −0 examples/example_glfw_opengl3/main.cpp
+5 −0 examples/example_glfw_vulkan/main.cpp
+5 −0 examples/example_glfw_wgpu/main.cpp
+5 −0 examples/example_sdl2_directx11/main.cpp
+5 −0 examples/example_sdl2_opengl2/main.cpp
+5 −0 examples/example_sdl2_opengl3/main.cpp
+5 −0 examples/example_sdl2_sdlrenderer2/main.cpp
+5 −0 examples/example_sdl2_vulkan/main.cpp
+3 −3 examples/example_sdl3_opengl3/README.md
+5 −0 examples/example_sdl3_opengl3/main.cpp
+8 −0 examples/example_sdl3_sdlrenderer3/main.cpp
+5 −0 examples/example_win32_opengl3/main.cpp
+4 −3 examples/libs/emscripten/emscripten_mainloop_stub.h
+5 −4 imconfig.h
+100 −82 imgui.cpp
+38 −33 imgui.h
+374 −132 imgui_demo.cpp
+1 −1 imgui_draw.cpp
+29 −22 imgui_internal.h
+25 −22 imgui_tables.cpp
+179 −125 imgui_widgets.cpp
73 changes: 41 additions & 32 deletions clibs/imgui/imgui_lua_funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ static util::TableInteger SelectableFlags[] = {
ENUM(ImGuiSelectableFlags, AllowDoubleClick),
ENUM(ImGuiSelectableFlags, Disabled),
ENUM(ImGuiSelectableFlags, AllowOverlap),
ENUM(ImGuiSelectableFlags, Highlight),
};

static util::TableInteger ComboFlags[] = {
Expand Down Expand Up @@ -728,6 +729,7 @@ static util::TableInteger StyleVar[] = {
ENUM(ImGuiStyleVar, TabRounding),
ENUM(ImGuiStyleVar, TabBorderSize),
ENUM(ImGuiStyleVar, TabBarBorderSize),
ENUM(ImGuiStyleVar, TabBarOverlineSize),
ENUM(ImGuiStyleVar, TableAngledHeadersAngle),
ENUM(ImGuiStyleVar, TableAngledHeadersTextAlign),
ENUM(ImGuiStyleVar, ButtonTextAlign),
Expand Down Expand Up @@ -1220,34 +1222,6 @@ static int SetWindowFocusStr(lua_State* L) {
return 0;
}

static int GetContentRegionAvail(lua_State* L) {
auto&& _retval = ImGui::GetContentRegionAvail();
lua_pushnumber(L, _retval.x);
lua_pushnumber(L, _retval.y);
return 2;
}

static int GetContentRegionMax(lua_State* L) {
auto&& _retval = ImGui::GetContentRegionMax();
lua_pushnumber(L, _retval.x);
lua_pushnumber(L, _retval.y);
return 2;
}

static int GetWindowContentRegionMin(lua_State* L) {
auto&& _retval = ImGui::GetWindowContentRegionMin();
lua_pushnumber(L, _retval.x);
lua_pushnumber(L, _retval.y);
return 2;
}

static int GetWindowContentRegionMax(lua_State* L) {
auto&& _retval = ImGui::GetWindowContentRegionMax();
lua_pushnumber(L, _retval.x);
lua_pushnumber(L, _retval.y);
return 2;
}

static int GetScrollX(lua_State* L) {
auto&& _retval = ImGui::GetScrollX();
lua_pushnumber(L, _retval);
Expand Down Expand Up @@ -1512,6 +1486,13 @@ static int SetCursorScreenPos(lua_State* L) {
return 0;
}

static int GetContentRegionAvail(lua_State* L) {
auto&& _retval = ImGui::GetContentRegionAvail();
lua_pushnumber(L, _retval.x);
lua_pushnumber(L, _retval.y);
return 2;
}

static int GetCursorPos(lua_State* L) {
auto&& _retval = ImGui::GetCursorPos();
lua_pushnumber(L, _retval.x);
Expand Down Expand Up @@ -1708,6 +1689,13 @@ static int GetIDPtr(lua_State* L) {
return 1;
}

static int GetIDInt(lua_State* L) {
auto int_id = (int)luaL_checkinteger(L, 1);
auto&& _retval = ImGui::GetID(int_id);
lua_pushinteger(L, _retval);
return 1;
}

static int Text(lua_State* L) {
const char* fmt = util::format(L, 1);
ImGui::Text("%s", fmt);
Expand Down Expand Up @@ -3635,6 +3623,12 @@ static int SetNextItemOpen(lua_State* L) {
return 0;
}

static int SetNextItemStorageID(lua_State* L) {
auto storage_id = (ImGuiID)luaL_checkinteger(L, 1);
ImGui::SetNextItemStorageID(storage_id);
return 0;
}

static int Selectable(lua_State* L) {
auto label = luaL_checkstring(L, 1);
auto&& _retval = ImGui::Selectable(label);
Expand Down Expand Up @@ -5219,6 +5213,20 @@ struct ConfigMacOSXBehaviors {
}
};

struct ConfigNavSwapGamepadButtons {
static int getter(lua_State* L) {
auto& OBJ = **(ImGuiIO**)lua_touserdata(L, lua_upvalueindex(1));
lua_pushboolean(L, OBJ.ConfigNavSwapGamepadButtons);
return 1;
}

static int setter(lua_State* L) {
auto& OBJ = **(ImGuiIO**)lua_touserdata(L, lua_upvalueindex(1));
OBJ.ConfigNavSwapGamepadButtons = (bool)!!lua_toboolean(L, 1);
return 0;
}
};

struct ConfigInputTrickleEventQueue {
static int getter(lua_State* L) {
auto& OBJ = **(ImGuiIO**)lua_touserdata(L, lua_upvalueindex(1));
Expand Down Expand Up @@ -6048,6 +6056,7 @@ static luaL_Reg setters[] = {
{ "ConfigViewportsNoDefaultParent", ConfigViewportsNoDefaultParent::setter },
{ "MouseDrawCursor", MouseDrawCursor::setter },
{ "ConfigMacOSXBehaviors", ConfigMacOSXBehaviors::setter },
{ "ConfigNavSwapGamepadButtons", ConfigNavSwapGamepadButtons::setter },
{ "ConfigInputTrickleEventQueue", ConfigInputTrickleEventQueue::setter },
{ "ConfigInputTextCursorBlink", ConfigInputTextCursorBlink::setter },
{ "ConfigInputTextEnterKeepActive", ConfigInputTextEnterKeepActive::setter },
Expand Down Expand Up @@ -6124,6 +6133,7 @@ static luaL_Reg getters[] = {
{ "ConfigViewportsNoDefaultParent", ConfigViewportsNoDefaultParent::getter },
{ "MouseDrawCursor", MouseDrawCursor::getter },
{ "ConfigMacOSXBehaviors", ConfigMacOSXBehaviors::getter },
{ "ConfigNavSwapGamepadButtons", ConfigNavSwapGamepadButtons::getter },
{ "ConfigInputTrickleEventQueue", ConfigInputTrickleEventQueue::getter },
{ "ConfigInputTextCursorBlink", ConfigInputTextCursorBlink::getter },
{ "ConfigInputTextEnterKeepActive", ConfigInputTextEnterKeepActive::getter },
Expand Down Expand Up @@ -7891,10 +7901,6 @@ static void init(lua_State* L) {
{ "SetWindowSizeStr", SetWindowSizeStr },
{ "SetWindowCollapsedStr", SetWindowCollapsedStr },
{ "SetWindowFocusStr", SetWindowFocusStr },
{ "GetContentRegionAvail", GetContentRegionAvail },
{ "GetContentRegionMax", GetContentRegionMax },
{ "GetWindowContentRegionMin", GetWindowContentRegionMin },
{ "GetWindowContentRegionMax", GetWindowContentRegionMax },
{ "GetScrollX", GetScrollX },
{ "GetScrollY", GetScrollY },
{ "SetScrollX", SetScrollX },
Expand Down Expand Up @@ -7934,6 +7940,7 @@ static void init(lua_State* L) {
{ "GetStyleColorVec4", GetStyleColorVec4 },
{ "GetCursorScreenPos", GetCursorScreenPos },
{ "SetCursorScreenPos", SetCursorScreenPos },
{ "GetContentRegionAvail", GetContentRegionAvail },
{ "GetCursorPos", GetCursorPos },
{ "GetCursorPosX", GetCursorPosX },
{ "GetCursorPosY", GetCursorPosY },
Expand Down Expand Up @@ -7966,6 +7973,7 @@ static void init(lua_State* L) {
{ "GetID", GetID },
{ "GetIDStr", GetIDStr },
{ "GetIDPtr", GetIDPtr },
{ "GetIDInt", GetIDInt },
{ "Text", Text },
{ "TextColored", TextColored },
{ "TextDisabled", TextDisabled },
Expand Down Expand Up @@ -8078,6 +8086,7 @@ static void init(lua_State* L) {
{ "CollapsingHeader", CollapsingHeader },
{ "CollapsingHeaderBoolPtr", CollapsingHeaderBoolPtr },
{ "SetNextItemOpen", SetNextItemOpen },
{ "SetNextItemStorageID", SetNextItemStorageID },
{ "Selectable", Selectable },
{ "SelectableEx", SelectableEx },
{ "SelectableBoolPtr", SelectableBoolPtr },
Expand Down
Loading

0 comments on commit d67f76b

Please sign in to comment.