From c40c83d337b3e7125ad9f75a617cfbf648145d4a Mon Sep 17 00:00:00 2001 From: attilaz Date: Sun, 11 Jun 2017 01:01:42 +0200 Subject: [PATCH] fixed imgui window position (#1151) With SetWindowPos there was a strange flickering of the window when the user tried to grab the window. This is fixed with SetNextWindowPos. --- examples/12-lod/lod.cpp | 2 +- examples/21-deferred/deferred.cpp | 2 +- examples/33-pom/pom.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/12-lod/lod.cpp b/examples/12-lod/lod.cpp index f7f947a9f..88cd59768 100644 --- a/examples/12-lod/lod.cpp +++ b/examples/12-lod/lod.cpp @@ -131,12 +131,12 @@ class ExampleLod : public entry::AppI , uint16_t(m_height) ); + ImGui::SetNextWindowPos(ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) ); ImGui::Begin("LOD Settings" , NULL , ImVec2(m_width / 5.0f, m_height / 6.0f) , ImGuiWindowFlags_AlwaysAutoResize ); - ImGui::SetWindowPos(ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) ); ImGui::Checkbox("Transition", &m_transitions); diff --git a/examples/21-deferred/deferred.cpp b/examples/21-deferred/deferred.cpp index 6d0616f49..26751e252 100644 --- a/examples/21-deferred/deferred.cpp +++ b/examples/21-deferred/deferred.cpp @@ -430,12 +430,12 @@ class ExampleDeferred : public entry::AppI , uint16_t(m_height) ); + ImGui::SetNextWindowPos(ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) ); ImGui::Begin("Deferred Rendering Settings" , NULL , ImVec2(m_width / 5.0f, m_height / 3.0f) , ImGuiWindowFlags_AlwaysAutoResize ); - ImGui::SetWindowPos(ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) ); ImGui::SliderInt("Num lights", &m_numLights, 1, 2048); ImGui::Checkbox("Show G-Buffer.", &m_showGBuffer); diff --git a/examples/33-pom/pom.cpp b/examples/33-pom/pom.cpp index dddebfc7b..9ddc283fe 100644 --- a/examples/33-pom/pom.cpp +++ b/examples/33-pom/pom.cpp @@ -262,8 +262,8 @@ class ExamplePom : public entry::AppI , uint16_t(m_height) ); + ImGui::SetNextWindowPos(ImVec2(m_width - 240.0f, 20.0f)); ImGui::Begin("Properties"); - ImGui::SetWindowPos(ImVec2(m_width - 240.0f, 20.0f)); ImGui::RadioButton("No bump mapping", &m_shading_type, 0); ImGui::RadioButton("Normal mapping", &m_shading_type, 1);