From 96dea0ebfaa51bd9479c425eac37118635508a4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 10 Sep 2015 10:59:19 -0700 Subject: [PATCH] Cleanup. --- 3rdparty/ocornut-imgui/imgui.cpp | 1 + examples/common/imgui/imgui.h | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/3rdparty/ocornut-imgui/imgui.cpp b/3rdparty/ocornut-imgui/imgui.cpp index 8bfd19c98..66a354a57 100644 --- a/3rdparty/ocornut-imgui/imgui.cpp +++ b/3rdparty/ocornut-imgui/imgui.cpp @@ -2197,6 +2197,7 @@ static void AddDrawListToRenderList(ImVector& out_render_list, ImDr // If this assert triggers because you are drawing lots of stuff manually, A) workaround by calling BeginChild()/EndChild() to put your draw commands in multiple draw lists, B) #define ImDrawIdx to a 'unsigned int' in imconfig.h and render accordingly. const unsigned long long int max_vtx_idx = (unsigned long long int)1L << (sizeof(ImDrawIdx)*8); IM_ASSERT((unsigned long long int)draw_list->_VtxCurrentIdx <= max_vtx_idx); + (void)max_vtx_idx; GImGui->IO.MetricsRenderVertices += draw_list->VtxBuffer.Size; GImGui->IO.MetricsRenderIndices += draw_list->IdxBuffer.Size; diff --git a/examples/common/imgui/imgui.h b/examples/common/imgui/imgui.h index bbf9362fb..acd6e6daf 100644 --- a/examples/common/imgui/imgui.h +++ b/examples/common/imgui/imgui.h @@ -215,6 +215,14 @@ namespace ImGui Image(texture.ptr, _size, _uv0, _uv1, _tint_col, _border_col); } + // Helper function for passing bgfx::TextureHandle to ImGui::ImageButton. + inline bool ImageButton(bgfx::TextureHandle _handle, const ImVec2& _size, const ImVec2& _uv0 = ImVec2(0,0), const ImVec2& _uv1 = ImVec2(1,1), int _frame_padding = -1, const ImVec4& _bg_col = ImVec4(0,0,0,0), const ImVec4& _tint_col = ImVec4(1,1,1,1)) + { + union { bgfx::TextureHandle handle; ImTextureID ptr; } texture; + texture.handle = _handle; + return ImageButton(texture.ptr, _size, _uv0, _uv1, _frame_padding, _bg_col, _tint_col); + } + } // namespace ImGui #endif // IMGUI_H_HEADER_GUARD