diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-09-30 03:25:41 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-09-30 03:25:41 +0000 |
| commit | eae448239986ef4cb2833b5c7c1313e86f28b233 (patch) | |
| tree | a18b8475b3489df6ed7719e7a810c76046a095f0 | |
| parent | Enabled ImGui on UWP (diff) | |
| download | DiligentTools-eae448239986ef4cb2833b5c7c1313e86f28b233.tar.gz DiligentTools-eae448239986ef4cb2833b5c7c1313e86f28b233.zip | |
ImGui UWP: fixed window resizing
| -rw-r--r-- | Imgui/interface/ImGuiImplUWP.h | 8 | ||||
| -rw-r--r-- | Imgui/src/ImGuiImplUWP.cpp | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/Imgui/interface/ImGuiImplUWP.h b/Imgui/interface/ImGuiImplUWP.h index f65cdeb..f41d468 100644 --- a/Imgui/interface/ImGuiImplUWP.h +++ b/Imgui/interface/ImGuiImplUWP.h @@ -46,9 +46,17 @@ public: virtual void NewFrame()override final; + void SetDisplaySize(Uint32 DisplayWidth, Uint32 DisplayHeight) + { + m_DisplayWidth = DisplayWidth; + m_DisplayHeight = DisplayHeight; + } + private: INT64 m_Time = 0; INT64 m_TicksPerSecond = 0; + Uint32 m_DisplayWidth = 0; + Uint32 m_DisplayHeight = 0; }; } diff --git a/Imgui/src/ImGuiImplUWP.cpp b/Imgui/src/ImGuiImplUWP.cpp index 4389785..16f1007 100644 --- a/Imgui/src/ImGuiImplUWP.cpp +++ b/Imgui/src/ImGuiImplUWP.cpp @@ -82,10 +82,7 @@ void ImGuiImplUWP::NewFrame() ImGuiIO& io = ImGui::GetIO(); IM_ASSERT(io.Fonts->IsBuilt() && "Font atlas not built! It is generally built by the renderer back-end. Missing call to renderer _NewFrame() function? e.g. ImGui_ImplOpenGL3_NewFrame()."); - // Setup display size (every frame to accommodate for window resizing) - RECT rect = {0, 0, 1280, 1024}; - //::GetClientRect(g_hWnd, &rect); - io.DisplaySize = ImVec2((float)(rect.right - rect.left), (float)(rect.bottom - rect.top)); + io.DisplaySize = ImVec2((float)m_DisplayWidth, (float)m_DisplayHeight); // Setup time step INT64 current_time; |
