mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-10 20:08:31 +01:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b936bb3369 | ||
![]() |
713d9f587c | ||
![]() |
59218e28d0 | ||
![]() |
32b310e31f |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -33,3 +33,5 @@ cimgui/cimgui.v12.suo
|
||||
cimgui/Release/
|
||||
.idea
|
||||
CMakeLists.txt
|
||||
cimgui/.vs/
|
||||
cimgui/cimgui.vcxproj.user
|
||||
|
@@ -8,7 +8,7 @@ Most of the functions have wrapper counterparts now, missing stuff is added on a
|
||||
This library is intended as a intermediate layer to be able to use imgui from other languages that can interface with C (like D - see [D-binding](https://github.com/Extrawurst/DerelictImgui))
|
||||
|
||||
Notes:
|
||||
* currently this wrapper is based on version [1.44 of imgui](https://github.com/ocornut/imgui/releases/tag/v1.44)
|
||||
* currently this wrapper is based on version [1.45 of imgui](https://github.com/ocornut/imgui/releases/tag/v1.45)
|
||||
* does not compile with pure C compiler yet (for writing bindings in languages that are able to use C-ABI it is enough though, see D-bindings)
|
||||
|
||||
# usage
|
||||
|
@@ -12,6 +12,11 @@ CIMGUI_API ImGuiStyle* igGetStyle()
|
||||
return &ImGui::GetStyle();
|
||||
}
|
||||
|
||||
CIMGUI_API ImDrawData* igGetDrawData()
|
||||
{
|
||||
return ImGui::GetDrawData();
|
||||
}
|
||||
|
||||
CIMGUI_API void igNewFrame()
|
||||
{
|
||||
ImGui::NewFrame();
|
||||
@@ -1285,9 +1290,9 @@ CIMGUI_API bool igIsMouseHoveringAnyWindow()
|
||||
return ImGui::IsMouseHoveringAnyWindow();
|
||||
}
|
||||
|
||||
CIMGUI_API bool igIsMouseHoveringRect(CONST ImVec2 pos_min, CONST ImVec2 pos_max)
|
||||
CIMGUI_API bool igIsMouseHoveringRect(CONST ImVec2 pos_min, CONST ImVec2 pos_max, bool clip)
|
||||
{
|
||||
return ImGui::IsMouseHoveringRect(pos_min,pos_max);
|
||||
return ImGui::IsMouseHoveringRect(pos_min,pos_max,clip);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igIsMouseDragging(int button, float lock_threshold)
|
||||
@@ -1329,6 +1334,36 @@ CIMGUI_API void igSetMouseCursor(ImGuiMouseCursor type)
|
||||
ImGui::SetMouseCursor(type);
|
||||
}
|
||||
|
||||
CIMGUI_API void igCaptureKeyboardFromApp()
|
||||
{
|
||||
return ImGui::CaptureKeyboardFromApp();
|
||||
}
|
||||
|
||||
CIMGUI_API void igCaptureMouseFromApp()
|
||||
{
|
||||
return ImGui::CaptureMouseFromApp();
|
||||
}
|
||||
|
||||
CIMGUI_API void* igMemAlloc(size_t sz)
|
||||
{
|
||||
return ImGui::MemAlloc(sz);
|
||||
}
|
||||
|
||||
CIMGUI_API void igMemFree(void* ptr)
|
||||
{
|
||||
return ImGui::MemFree(ptr);
|
||||
}
|
||||
|
||||
CIMGUI_API const char* igGetClipboardText()
|
||||
{
|
||||
return ImGui::GetClipboardText();
|
||||
}
|
||||
|
||||
CIMGUI_API void igSetClipboardText(const char* text)
|
||||
{
|
||||
return ImGui::SetClipboardText(text);
|
||||
}
|
||||
|
||||
CIMGUI_API float igGetTime()
|
||||
{
|
||||
return ImGui::GetTime();
|
||||
@@ -1359,9 +1394,9 @@ CIMGUI_API void igCalcListClipping(int items_count, float items_height, int*
|
||||
ImGui::CalcListClipping(items_count,items_height,out_items_display_start,out_items_display_end);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igBeginChildFrame(ImGuiID id, CONST ImVec2 size)
|
||||
CIMGUI_API bool igBeginChildFrame(ImGuiID id, CONST ImVec2 size, ImGuiWindowFlags extra_flags)
|
||||
{
|
||||
return ImGui::BeginChildFrame(id, size);
|
||||
return ImGui::BeginChildFrame(id, size, extra_flags);
|
||||
}
|
||||
|
||||
CIMGUI_API void igEndChildFrame()
|
||||
|
@@ -25,6 +25,7 @@ typedef int ImGuiColorEditMode;
|
||||
|
||||
CIMGUI_API ImGuiIO* igGetIO();
|
||||
CIMGUI_API ImGuiStyle* igGetStyle();
|
||||
CIMGUI_API ImDrawData* igGetDrawData();
|
||||
CIMGUI_API void igNewFrame();
|
||||
CIMGUI_API void igRender();
|
||||
CIMGUI_API void igShutdown();
|
||||
@@ -97,10 +98,10 @@ CIMGUI_API void igPopStyleVar(int count);
|
||||
CIMGUI_API void igPushItemWidth(float item_width);
|
||||
CIMGUI_API void igPopItemWidth();
|
||||
CIMGUI_API float igCalcItemWidth();
|
||||
CIMGUI_API void igPushAllowKeyboardFocus(bool v);
|
||||
CIMGUI_API void igPopAllowKeyboardFocus();
|
||||
CIMGUI_API void igPushTextWrapPos(float wrap_pos_x);
|
||||
CIMGUI_API void igPopTextWrapPos();
|
||||
CIMGUI_API void igPushAllowKeyboardFocus(bool v);
|
||||
CIMGUI_API void igPopAllowKeyboardFocus();
|
||||
CIMGUI_API void igPushButtonRepeat(bool repeat);
|
||||
CIMGUI_API void igPopButtonRepeat();
|
||||
|
||||
@@ -306,7 +307,7 @@ CIMGUI_API void igCalcItemRectClosestPoint(struct ImVec2* pOut, CONS
|
||||
CIMGUI_API void igCalcTextSize(struct ImVec2* pOut, CONST char* text, CONST char* text_end, bool hide_text_after_double_hash, float wrap_width);
|
||||
CIMGUI_API void igCalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end);
|
||||
|
||||
CIMGUI_API bool igBeginChildFrame(ImGuiID id, CONST struct ImVec2 size);
|
||||
CIMGUI_API bool igBeginChildFrame(ImGuiID id, CONST struct ImVec2 size, ImGuiWindowFlags extra_flags);
|
||||
CIMGUI_API void igEndChildFrame();
|
||||
|
||||
CIMGUI_API void igColorConvertU32ToFloat4(ImVec4* pOut, ImU32 in);
|
||||
@@ -323,7 +324,7 @@ CIMGUI_API bool igIsMouseDoubleClicked(int button);
|
||||
CIMGUI_API bool igIsMouseReleased(int button);
|
||||
CIMGUI_API bool igIsMouseHoveringWindow();
|
||||
CIMGUI_API bool igIsMouseHoveringAnyWindow();
|
||||
CIMGUI_API bool igIsMouseHoveringRect(CONST struct ImVec2 pos_min, CONST struct ImVec2 pos_max);
|
||||
CIMGUI_API bool igIsMouseHoveringRect(CONST struct ImVec2 pos_min, CONST struct ImVec2 pos_max, bool clip);
|
||||
CIMGUI_API bool igIsMouseDragging(int button, float lock_threshold);
|
||||
CIMGUI_API void igGetMousePos(struct ImVec2* pOut);
|
||||
CIMGUI_API void igGetMousePosOnOpeningCurrentPopup(ImVec2* pOut);
|
||||
@@ -331,6 +332,14 @@ CIMGUI_API void igGetMouseDragDelta(struct ImVec2* pOut, int button,
|
||||
CIMGUI_API void igResetMouseDragDelta(int button);
|
||||
CIMGUI_API ImGuiMouseCursor igGetMouseCursor();
|
||||
CIMGUI_API void igSetMouseCursor(ImGuiMouseCursor type);
|
||||
CIMGUI_API void igCaptureKeyboardFromApp();
|
||||
CIMGUI_API void igCaptureMouseFromApp();
|
||||
|
||||
// Helpers functions to access functions pointers in ImGui::GetIO()
|
||||
CIMGUI_API void* igMemAlloc(size_t sz);
|
||||
CIMGUI_API void igMemFree(void* ptr);
|
||||
CIMGUI_API const char* igGetClipboardText();
|
||||
CIMGUI_API void igSetClipboardText(const char* text);
|
||||
|
||||
// Internal state access - if you want to share ImGui state between modules (e.g. DLL) or allocate it yourself
|
||||
CIMGUI_API CONST char* igGetVersion();
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
@@ -19,13 +19,13 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
|
2
imgui
2
imgui
Submodule imgui updated: 77bcb7152b...72dde4d323
Reference in New Issue
Block a user