Browse Source

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.
attilaz 8 years ago
parent
commit
c40c83d337
3 changed files with 3 additions and 3 deletions
  1. 1 1
      examples/12-lod/lod.cpp
  2. 1 1
      examples/21-deferred/deferred.cpp
  3. 1 1
      examples/33-pom/pom.cpp

+ 1 - 1
examples/12-lod/lod.cpp

@@ -131,12 +131,12 @@ class ExampleLod : public entry::AppI
 				, uint16_t(m_height)
 				, uint16_t(m_height)
 			);
 			);
 
 
+			ImGui::SetNextWindowPos(ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) );
 			ImGui::Begin("LOD Settings"
 			ImGui::Begin("LOD Settings"
 				, NULL
 				, NULL
 				, ImVec2(m_width / 5.0f, m_height / 6.0f)
 				, ImVec2(m_width / 5.0f, m_height / 6.0f)
 				, ImGuiWindowFlags_AlwaysAutoResize
 				, ImGuiWindowFlags_AlwaysAutoResize
 				);
 				);
-			ImGui::SetWindowPos(ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) );
 
 
 			ImGui::Checkbox("Transition", &m_transitions);
 			ImGui::Checkbox("Transition", &m_transitions);
 
 

+ 1 - 1
examples/21-deferred/deferred.cpp

@@ -430,12 +430,12 @@ class ExampleDeferred : public entry::AppI
 						, uint16_t(m_height)
 						, uint16_t(m_height)
 						);
 						);
 
 
+				ImGui::SetNextWindowPos(ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) );
 				ImGui::Begin("Deferred Rendering Settings"
 				ImGui::Begin("Deferred Rendering Settings"
 					, NULL
 					, NULL
 					, ImVec2(m_width / 5.0f, m_height / 3.0f)
 					, ImVec2(m_width / 5.0f, m_height / 3.0f)
 					, ImGuiWindowFlags_AlwaysAutoResize
 					, ImGuiWindowFlags_AlwaysAutoResize
 					);
 					);
-				ImGui::SetWindowPos(ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) );
 
 
 				ImGui::SliderInt("Num lights", &m_numLights, 1, 2048);
 				ImGui::SliderInt("Num lights", &m_numLights, 1, 2048);
 				ImGui::Checkbox("Show G-Buffer.", &m_showGBuffer);
 				ImGui::Checkbox("Show G-Buffer.", &m_showGBuffer);

+ 1 - 1
examples/33-pom/pom.cpp

@@ -262,8 +262,8 @@ class ExamplePom : public entry::AppI
 				, uint16_t(m_height)
 				, uint16_t(m_height)
 				);
 				);
 
 
+			ImGui::SetNextWindowPos(ImVec2(m_width - 240.0f, 20.0f));
 			ImGui::Begin("Properties");
 			ImGui::Begin("Properties");
-			ImGui::SetWindowPos(ImVec2(m_width - 240.0f, 20.0f));
 
 
 			ImGui::RadioButton("No bump mapping", &m_shading_type, 0);
 			ImGui::RadioButton("No bump mapping", &m_shading_type, 0);
 			ImGui::RadioButton("Normal mapping", &m_shading_type, 1);
 			ImGui::RadioButton("Normal mapping", &m_shading_type, 1);