Compare commits

...

8 Commits
v1.43 ... v1.45

Author SHA1 Message Date
Stephan Dilly
5fe328beae upgrade to imgui 1.45 2015-09-07 01:48:05 +02:00
Stephan Dilly
5d061e7db7 Merge pull request #8 from yannick/master
Fix Makefile: link ../imgui/imgui_draw.o ../imgui/imgui_demo.o
2015-08-13 15:41:45 +02:00
Yannick Koechlin
d02ce16125 Fix Makefile: link ../imgui/imgui_draw.o ../imgui/imgui_demo.o 2015-08-13 15:08:15 +02:00
unknown
7d8b0cbf36 update readme 2015-08-12 21:27:25 +02:00
unknown
fb80cc0cfe update to imgui cleanup release 1.44 2015-08-12 21:12:57 +02:00
Stephan Dilly
4db3562350 Update README.md 2015-07-25 20:44:44 +02:00
Stephan Dilly
56b5017b50 Update README.md 2015-07-25 20:20:33 +02:00
Stephan Dilly
1cc171ce4c Update README.md 2015-07-25 20:19:59 +02:00
8 changed files with 100 additions and 14 deletions

View File

@@ -8,12 +8,12 @@ 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.42 of imgui](https://github.com/ocornut/imgui/releases/tag/v1.42)
* currently this wrapper is based on version [1.44 of imgui](https://github.com/ocornut/imgui/releases/tag/v1.44)
* 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
* clone
* make using makefile on linux/osx (linux makefile not tested)
* use whatever method is in ImGui c++ namespace in the original [imgui.h](https://github.com/ocornut/imgui/blob/master/imgui.h) by prepending `ig_`
* make using makefile on linux/osx
* use whatever method is in ImGui c++ namespace in the original [imgui.h](https://github.com/ocornut/imgui/blob/master/imgui.h) by prepending `ig`
* methods have the same parameter list and return values (where possible)

View File

@@ -7,6 +7,8 @@ OBJS += fontAtlas.o
OBJS += drawList.o
#OBJS += test.o
OBJS += ../imgui/imgui.o
OBJS += ../imgui/imgui_draw.o
OBJS += ../imgui/imgui_demo.o
UNAME_S := $(shell uname -s)
@@ -40,4 +42,4 @@ imgui_example:$(OBJS)
$(CXX) -o $(OUTPUTNAME) $(OBJS) $(CXXFLAGS) $(LINKFLAGS)
clean:
rm $(OBJS)
rm $(OBJS)

View File

@@ -84,6 +84,16 @@ CIMGUI_API void igGetContentRegionMax(ImVec2* out)
*out = ImGui::GetContentRegionMax();
}
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();
@@ -94,6 +104,11 @@ CIMGUI_API void igGetWindowContentRegionMax(ImVec2* out)
*out = ImGui::GetWindowContentRegionMax();
}
CIMGUI_API float igGetWindowContentRegionWidth()
{
return ImGui::GetWindowContentRegionWidth();
}
CIMGUI_API ImDrawList* igGetWindowDrawList()
{
return ImGui::GetWindowDrawList();
@@ -129,6 +144,11 @@ CIMGUI_API float igGetWindowWidth()
return ImGui::GetWindowWidth();
}
CIMGUI_API float igGetWindowHeight()
{
return ImGui::GetWindowHeight();
}
CIMGUI_API bool igIsWindowCollapsed()
{
return ImGui::IsWindowCollapsed();
@@ -149,6 +169,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);
@@ -199,16 +229,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);
@@ -402,9 +447,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()
@@ -477,9 +522,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)
@@ -1240,9 +1285,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)
{
return ImGui::IsMouseHoveringRect(rect_min,rect_max);
return ImGui::IsMouseHoveringRect(pos_min,pos_max);
}
CIMGUI_API bool igIsMouseDragging(int button, float lock_threshold)
@@ -1259,6 +1304,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);
@@ -1319,6 +1369,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

@@ -41,8 +41,11 @@ CIMGUI_API bool igBeginChild(CONST char* str_id, CONST struct ImVec2
CIMGUI_API bool igBeginChildEx(ImGuiID id, CONST struct ImVec2 size, bool border, ImGuiWindowFlags extra_flags);
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();
@@ -50,11 +53,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);
@@ -66,8 +72,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);
@@ -99,7 +108,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();
@@ -114,7 +123,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);
@@ -300,6 +309,7 @@ CIMGUI_API void igCalcListClipping(int items_count, float items_heig
CIMGUI_API bool igBeginChildFrame(ImGuiID id, CONST struct ImVec2 size);
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);
@@ -313,9 +323,10 @@ 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);
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();
@@ -335,6 +346,7 @@ CIMGUI_API ImFont* ImFontAtlas_AddFontDefault(ImFontAtlas* atlas, CONST
CIMGUI_API ImFont* ImFontAtlas_AddFontFromFileTTF(ImFontAtlas* atlas, CONST char* filename, float size_pixels, CONST ImFontConfig* font_cfg, CONST ImWchar* glyph_ranges);
CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryTTF(ImFontAtlas* atlas, void* ttf_data, int ttf_size, float size_pixels, CONST ImFontConfig* font_cfg, CONST ImWchar* glyph_ranges);
CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedTTF(ImFontAtlas* atlas, CONST void* compressed_ttf_data, int compressed_ttf_size, float size_pixels, CONST ImFontConfig* font_cfg, CONST ImWchar* glyph_ranges);
CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(ImFontAtlas* atlas, CONST char* compressed_ttf_data_base85, float size_pixels, CONST ImFontConfig* font_cfg, CONST ImWchar* glyph_ranges);
CIMGUI_API void ImFontAtlas_ClearTexData(ImFontAtlas* atlas);
CIMGUI_API void ImFontAtlas_Clear(ImFontAtlas* atlas);

View File

@@ -77,11 +77,14 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\imgui\imgui.cpp" />
<ClCompile Include="..\imgui\imgui_demo.cpp" />
<ClCompile Include="..\imgui\imgui_draw.cpp" />
<ClCompile Include="cimgui.cpp" />
<ClCompile Include="drawList.cpp" />
<ClCompile Include="fontAtlas.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\imgui\imgui_internal.h" />
<ClInclude Include="cimgui.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View File

@@ -27,10 +27,19 @@
<ClCompile Include="drawList.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\imgui\imgui_draw.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\imgui\imgui_demo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="cimgui.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\imgui\imgui_internal.h">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -42,6 +42,11 @@ CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedTTF(ImFontAtlas* atlas
return atlas->AddFontFromMemoryCompressedTTF(compressed_ttf_data, compressed_ttf_size, size_pixels, font_cfg, glyph_ranges);
}
CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(ImFontAtlas* atlas, CONST char* compressed_ttf_data_base85, float size_pixels, CONST ImFontConfig* font_cfg, CONST ImWchar* glyph_ranges)
{
return atlas->AddFontFromMemoryCompressedBase85TTF(compressed_ttf_data_base85, size_pixels, font_cfg, glyph_ranges);
}
CIMGUI_API void ImFontAtlas_ClearTexData(ImFontAtlas* atlas)
{
return atlas->ClearTexData();

2
imgui

Submodule imgui updated: e8cb874afe...77bcb7152b