Compare commits

...

5 Commits
v1.44 ... v1.46

Author SHA1 Message Date
Stephan Dilly
b936bb3369 add missing methods from a previous release 2015-10-19 13:04:19 +02:00
Stephan Dilly
713d9f587c update to imgui 1.46 2015-10-19 13:01:52 +02:00
Stephan Dilly
59218e28d0 update visual studio project (VS2015) and imgui to version where version number is correctly set 2015-09-07 15:28:06 +02:00
Stephan Dilly
32b310e31f Update README.md 2015-09-07 01:49:39 +02:00
Stephan Dilly
5fe328beae upgrade to imgui 1.45 2015-09-07 01:48:05 +02:00
6 changed files with 125 additions and 19 deletions

2
.gitignore vendored
View File

@@ -33,3 +33,5 @@ cimgui/cimgui.v12.suo
cimgui/Release/
.idea
CMakeLists.txt
cimgui/.vs/
cimgui/cimgui.vcxproj.user

View File

@@ -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

View File

@@ -12,6 +12,11 @@ CIMGUI_API ImGuiStyle* igGetStyle()
return &ImGui::GetStyle();
}
CIMGUI_API ImDrawData* igGetDrawData()
{
return ImGui::GetDrawData();
}
CIMGUI_API void igNewFrame()
{
ImGui::NewFrame();
@@ -89,6 +94,11 @@ CIMGUI_API void igGetContentRegionAvail(struct ImVec2* out)
*out = ImGui::GetContentRegionAvail();
}
CIMGUI_API float igGetContentRegionAvailWidth()
{
return ImGui::GetContentRegionAvailWidth();
}
CIMGUI_API void igGetWindowContentRegionMin(ImVec2* out)
{
*out = ImGui::GetWindowContentRegionMin();
@@ -99,6 +109,11 @@ CIMGUI_API void igGetWindowContentRegionMax(ImVec2* out)
*out = ImGui::GetWindowContentRegionMax();
}
CIMGUI_API float igGetWindowContentRegionWidth()
{
return ImGui::GetWindowContentRegionWidth();
}
CIMGUI_API ImDrawList* igGetWindowDrawList()
{
return ImGui::GetWindowDrawList();
@@ -134,6 +149,11 @@ CIMGUI_API float igGetWindowWidth()
return ImGui::GetWindowWidth();
}
CIMGUI_API float igGetWindowHeight()
{
return ImGui::GetWindowHeight();
}
CIMGUI_API bool igIsWindowCollapsed()
{
return ImGui::IsWindowCollapsed();
@@ -154,6 +174,16 @@ CIMGUI_API void igSetNextWindowSize(CONST ImVec2 size, ImGuiSetCond cond)
ImGui::SetNextWindowSize(size, cond);
}
CIMGUI_API void igSetNextWindowContentSize(CONST ImVec2 size)
{
ImGui::SetNextWindowContentSize(size);
}
CIMGUI_API void igSetNextWindowContentWidth(float width)
{
ImGui::SetNextWindowContentWidth(width);
}
CIMGUI_API void igSetNextWindowCollapsed(bool collapsed, ImGuiSetCond cond)
{
ImGui::SetNextWindowCollapsed(collapsed,cond);
@@ -204,16 +234,31 @@ CIMGUI_API void igSetWindowFocus2(CONST char* name)
ImGui::SetWindowFocus(name);
}
CIMGUI_API float igGetScrollX()
{
return ImGui::GetScrollX();
}
CIMGUI_API float igGetScrollY()
{
return ImGui::GetScrollY();
}
CIMGUI_API float igGetScrollMaxX()
{
return ImGui::GetScrollMaxX();
}
CIMGUI_API float igGetScrollMaxY()
{
return ImGui::GetScrollMaxY();
}
CIMGUI_API void igSetScrollX(float scroll_x)
{
return ImGui::SetScrollX(scroll_x);
}
CIMGUI_API void igSetScrollY(float scroll_y)
{
return ImGui::SetScrollY(scroll_y);
@@ -407,9 +452,9 @@ CIMGUI_API void igSeparator()
return ImGui::Separator();
}
CIMGUI_API void igSameLine(float pos_x, float spacing_w)
CIMGUI_API void igSameLine(float local_pos_x, float spacing_w)
{
return ImGui::SameLine(pos_x, spacing_w);
return ImGui::SameLine(local_pos_x, spacing_w);
}
CIMGUI_API void igSpacing()
@@ -482,9 +527,9 @@ CIMGUI_API float igGetCursorPosY()
return ImGui::GetCursorPosY();
}
CIMGUI_API void igSetCursorPos(CONST ImVec2 pos)
CIMGUI_API void igSetCursorPos(CONST ImVec2 local_pos)
{
return ImGui::SetCursorPos(pos);
return ImGui::SetCursorPos(local_pos);
}
CIMGUI_API void igSetCursorPosX(float x)
@@ -1245,9 +1290,9 @@ CIMGUI_API bool igIsMouseHoveringAnyWindow()
return ImGui::IsMouseHoveringAnyWindow();
}
CIMGUI_API bool igIsMouseHoveringRect(CONST ImVec2 rect_min, CONST ImVec2 rect_max)
CIMGUI_API bool igIsMouseHoveringRect(CONST ImVec2 pos_min, CONST ImVec2 pos_max, bool clip)
{
return ImGui::IsMouseHoveringRect(rect_min,rect_max);
return ImGui::IsMouseHoveringRect(pos_min,pos_max,clip);
}
CIMGUI_API bool igIsMouseDragging(int button, float lock_threshold)
@@ -1264,6 +1309,11 @@ CIMGUI_API void igGetMousePos(ImVec2* pOut)
*pOut = ImGui::GetMousePos();
}
CIMGUI_API void igGetMousePosOnOpeningCurrentPopup(ImVec2* pOut)
{
*pOut = ImGui::GetMousePosOnOpeningCurrentPopup();
}
CIMGUI_API void igGetMouseDragDelta(ImVec2* pOut, int button, float lock_threshold)
{
*pOut = ImGui::GetMouseDragDelta(button,lock_threshold);
@@ -1284,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();
@@ -1314,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()
@@ -1324,6 +1404,11 @@ CIMGUI_API void igEndChildFrame()
ImGui::EndChildFrame();
}
CIMGUI_API void igColorConvertU32ToFloat4(ImVec4* pOut, ImU32 in)
{
*pOut = ImGui::ColorConvertU32ToFloat4(in);
}
CIMGUI_API ImU32 igColorConvertFloat4ToU32(CONST ImVec4 in)
{
return ImGui::ColorConvertFloat4ToU32(in);

View File

@@ -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();
@@ -42,8 +43,10 @@ CIMGUI_API bool igBeginChildEx(ImGuiID id, CONST struct ImVec2 size,
CIMGUI_API void igEndChild();
CIMGUI_API void igGetContentRegionMax(struct ImVec2* out);
CIMGUI_API void igGetContentRegionAvail(struct ImVec2* out);
CIMGUI_API float igGetContentRegionAvailWidth(); //
CIMGUI_API void igGetWindowContentRegionMin(struct ImVec2* out);
CIMGUI_API void igGetWindowContentRegionMax(struct ImVec2* out);
CIMGUI_API float igGetWindowContentRegionWidth(); //
CIMGUI_API ImDrawList* igGetWindowDrawList();
CIMGUI_API ImFont* igGetWindowFont();
CIMGUI_API float igGetWindowFontSize();
@@ -51,11 +54,14 @@ CIMGUI_API void igSetWindowFontScale(float scale);
CIMGUI_API void igGetWindowPos(struct ImVec2* out);
CIMGUI_API void igGetWindowSize(struct ImVec2* out);
CIMGUI_API float igGetWindowWidth();
CIMGUI_API float igGetWindowHeight();
CIMGUI_API bool igIsWindowCollapsed();
CIMGUI_API void igSetNextWindowPos(CONST struct ImVec2 pos, ImGuiSetCond cond);
CIMGUI_API void igSetNextWindowPosCenter(ImGuiSetCond cond);
CIMGUI_API void igSetNextWindowSize(CONST struct ImVec2 size, ImGuiSetCond cond);
CIMGUI_API void igSetNextWindowContentSize(CONST ImVec2 size);
CIMGUI_API void igSetNextWindowContentWidth(float width);
CIMGUI_API void igSetNextWindowCollapsed(bool collapsed, ImGuiSetCond cond);
CIMGUI_API void igSetNextWindowFocus();
CIMGUI_API void igSetWindowPos(CONST struct ImVec2 pos, ImGuiSetCond cond);
@@ -67,8 +73,11 @@ CIMGUI_API void igSetWindowSize2(CONST char* name, CONST struct ImVe
CIMGUI_API void igSetWindowCollapsed2(CONST char* name, bool collapsed, ImGuiSetCond cond);
CIMGUI_API void igSetWindowFocus2(CONST char* name);
CIMGUI_API float igGetScrollX();
CIMGUI_API float igGetScrollY();
CIMGUI_API float igGetScrollMaxX();
CIMGUI_API float igGetScrollMaxY();
CIMGUI_API void igSetScrollX(float scroll_x);
CIMGUI_API void igSetScrollY(float scroll_y);
CIMGUI_API void igSetScrollHere(float center_y_ratio = 0.5f);
CIMGUI_API void igSetScrollFromPosY(float pos_y, float center_y_ratio = 0.5f);
@@ -89,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();
@@ -100,7 +109,7 @@ CIMGUI_API void igPopButtonRepeat();
CIMGUI_API void igBeginGroup();
CIMGUI_API void igEndGroup();
CIMGUI_API void igSeparator();
CIMGUI_API void igSameLine(float pos_x, float spacing_w);
CIMGUI_API void igSameLine(float local_pos_x, float spacing_w);
CIMGUI_API void igSpacing();
CIMGUI_API void igDummy(CONST ImVec2* size);
CIMGUI_API void igIndent();
@@ -115,7 +124,7 @@ CIMGUI_API int igGetColumnsCount();
CIMGUI_API void igGetCursorPos(struct ImVec2* pOut);
CIMGUI_API float igGetCursorPosX();
CIMGUI_API float igGetCursorPosY();
CIMGUI_API void igSetCursorPos(CONST struct ImVec2 pos);
CIMGUI_API void igSetCursorPos(CONST struct ImVec2 local_pos);
CIMGUI_API void igSetCursorPosX(float x);
CIMGUI_API void igSetCursorPosY(float y);
CIMGUI_API void igGetCursorStartPos(struct ImVec2* pOut);
@@ -298,9 +307,10 @@ 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);
CIMGUI_API ImU32 igColorConvertFloat4ToU32(CONST struct ImVec4 in);
CIMGUI_API void igColorConvertRGBtoHSV(float r, float g, float b, float* out_h, float* out_s, float* out_v);
CIMGUI_API void igColorConvertHSVtoRGB(float h, float s, float v, float* out_r, float* out_g, float* out_b);
@@ -314,13 +324,22 @@ 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 rect_min, CONST struct ImVec2 rect_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);
CIMGUI_API void igGetMouseDragDelta(struct ImVec2* pOut, int button, float lock_threshold);
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();

View File

@@ -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

Submodule imgui updated: a99ba42a39...72dde4d323