Branimir Karadžić 8 years ago
parent
commit
43fb2f6f4b

+ 1 - 1
examples/09-hdr/hdr.cpp

@@ -311,7 +311,7 @@ public:
 				  ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
 				  ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
 				, ImGuiSetCond_FirstUseEver
 				, ImGuiSetCond_FirstUseEver
 				);
 				);
-			ImGui::Begin("HDR Settings"
+			ImGui::Begin("Settings"
 				, NULL
 				, NULL
 				, ImVec2(m_width / 5.0f, m_height / 2.0f)
 				, ImVec2(m_width / 5.0f, m_height / 2.0f)
 				, ImGuiWindowFlags_AlwaysAutoResize
 				, ImGuiWindowFlags_AlwaysAutoResize

+ 7 - 9
examples/11-fontsdf/fontsdf.cpp

@@ -140,20 +140,18 @@ public:
 
 
 			bool restart = showExampleDialog(this);
 			bool restart = showExampleDialog(this);
 
 
-			const float guiPanelWidth  = 325.0f;
-			const float guiPanelHeight = 200.0f;
-
-			ImGui::SetNextWindowPos(ImVec2(m_width - guiPanelWidth - 10.0f, 10.0f) );
-			ImGui::Begin("Text Area"
+			ImGui::SetNextWindowPos(
+				  ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
+				, ImGuiSetCond_FirstUseEver
+				);
+			ImGui::Begin("Settings"
 				, NULL
 				, NULL
-				, ImVec2(guiPanelWidth, guiPanelHeight)
+				, ImVec2(m_width / 5.0f, m_height / 2.0f)
 				, ImGuiWindowFlags_AlwaysAutoResize
 				, ImGuiWindowFlags_AlwaysAutoResize
 				);
 				);
 
 
-			ImGui::Separator();
-
 			bool recomputeVisibleText = false;
 			bool recomputeVisibleText = false;
-			recomputeVisibleText |= ImGui::SliderFloat("Number of lines", &m_visibleLineCount, 1.0f, 177.0f);
+			recomputeVisibleText |= ImGui::SliderFloat("# of lines", &m_visibleLineCount, 1.0f, 177.0f);
 
 
 			if (ImGui::SliderFloat("Font size", &m_textSize, 6.0f, 64.0f) )
 			if (ImGui::SliderFloat("Font size", &m_textSize, 6.0f, 64.0f) )
 			{
 			{

+ 5 - 2
examples/12-lod/lod.cpp

@@ -142,8 +142,11 @@ public:
 
 
 			bool restart = showExampleDialog(this);
 			bool restart = showExampleDialog(this);
 
 
-			ImGui::SetNextWindowPos(ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) );
-			ImGui::Begin("LOD Settings"
+			ImGui::SetNextWindowPos(
+				  ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
+				, ImGuiSetCond_FirstUseEver
+				);
+			ImGui::Begin("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

+ 5 - 2
examples/13-stencil/stencil.cpp

@@ -924,8 +924,11 @@ public:
 
 
 			bool restart = showExampleDialog(this);
 			bool restart = showExampleDialog(this);
 
 
-			ImGui::SetNextWindowPos(ImVec2(m_viewState.m_width - m_viewState.m_width / 5.0f - 10.0f, 10.0f) );
-			ImGui::Begin("Stencil Settings"
+			ImGui::SetNextWindowPos(
+				  ImVec2(m_viewState.m_width - m_viewState.m_width / 5.0f - 10.0f, 10.0f)
+				, ImGuiSetCond_FirstUseEver
+				);
+			ImGui::Begin("Settings"
 				, NULL
 				, NULL
 				, ImVec2(m_viewState.m_width / 5.0f, m_viewState.m_height / 2.0f)
 				, ImVec2(m_viewState.m_width / 5.0f, m_viewState.m_height / 2.0f)
 				, ImGuiWindowFlags_AlwaysAutoResize
 				, ImGuiWindowFlags_AlwaysAutoResize

+ 16 - 10
examples/16-shadowmaps/shadowmaps.cpp

@@ -1980,12 +1980,15 @@ public:
 
 
 			bool restart = showExampleDialog(this);
 			bool restart = showExampleDialog(this);
 
 
-			ImGui::SetNextWindowPos(ImVec2(float(m_viewState.m_width) - 300.0f - 10.0f, 10.0f) );
+			ImGui::SetNextWindowPos(
+				  ImVec2(m_viewState.m_width - m_viewState.m_width / 5.0f - 10.0f, 10.0f)
+				, ImGuiSetCond_FirstUseEver
+				);
 			ImGui::Begin("Settings"
 			ImGui::Begin("Settings"
-						 , NULL
-						 , ImVec2(300.0f, 660.0f)
-						 , ImGuiWindowFlags_AlwaysAutoResize
-						 );
+				, NULL
+				, ImVec2(m_viewState.m_width / 5.0f, m_viewState.m_height - 20.0f)
+				, ImGuiWindowFlags_AlwaysAutoResize
+				);
 
 
 #define IMGUI_FLOAT_SLIDER(_name, _val) \
 #define IMGUI_FLOAT_SLIDER(_name, _val) \
 	ImGui::SliderFloat(_name            \
 	ImGui::SliderFloat(_name            \
@@ -2079,12 +2082,15 @@ public:
 			ImGui::End();
 			ImGui::End();
 #undef IMGUI_RADIO_BUTTON
 #undef IMGUI_RADIO_BUTTON
 
 
-			ImGui::SetNextWindowPos(ImVec2(10,70) );
+			ImGui::SetNextWindowPos(
+				  ImVec2(10.0f, 260.0f)
+				, ImGuiSetCond_FirstUseEver
+				);
 			ImGui::Begin("Light"
 			ImGui::Begin("Light"
-						 , NULL
-						 , ImVec2(330, 334)
-						 , ImGuiWindowFlags_AlwaysAutoResize
-						 );
+				, NULL
+				, ImVec2(m_viewState.m_width / 5.0f, 350.0f)
+				, ImGuiWindowFlags_AlwaysAutoResize
+				);
 			ImGui::PushItemWidth(185.0f);
 			ImGui::PushItemWidth(185.0f);
 
 
 			bool bLtChanged = false;
 			bool bLtChanged = false;

+ 5 - 3
examples/19-oit/oit.cpp

@@ -289,11 +289,13 @@ public:
 
 
 			bool restart = showExampleDialog(this);
 			bool restart = showExampleDialog(this);
 
 
-			ImGui::SetNextWindowPos(ImVec2((float)m_width - (float)m_width / 4.0f - 10.0f, 10.0f) );
-			ImGui::SetNextWindowSize(ImVec2((float)m_width / 4.0f, (float)m_height / 3.0f) );
+			ImGui::SetNextWindowPos(
+				  ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
+				, ImGuiSetCond_FirstUseEver
+				);
 			ImGui::Begin("Settings"
 			ImGui::Begin("Settings"
 				, NULL
 				, NULL
-				, ImVec2((float)m_width / 4.0f, (float)m_height / 3.0f)
+				, ImVec2(m_width / 5.0f, m_height / 3.0f)
 				, ImGuiWindowFlags_AlwaysAutoResize
 				, ImGuiWindowFlags_AlwaysAutoResize
 				);
 				);
 
 

+ 5 - 2
examples/21-deferred/deferred.cpp

@@ -434,8 +434,11 @@ public:
 					m_lightBuffer = bgfx::createFrameBuffer(uint16_t(m_width), uint16_t(m_height), bgfx::TextureFormat::BGRA8, samplerFlags);
 					m_lightBuffer = bgfx::createFrameBuffer(uint16_t(m_width), uint16_t(m_height), bgfx::TextureFormat::BGRA8, samplerFlags);
 				}
 				}
 
 
-				ImGui::SetNextWindowPos(ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) );
-				ImGui::Begin("Deferred Rendering Settings"
+				ImGui::SetNextWindowPos(
+					  ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
+					, ImGuiSetCond_FirstUseEver
+					);
+				ImGui::Begin("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

+ 7 - 5
examples/24-nbody/nbody.cpp

@@ -145,11 +145,10 @@ public:
 		const bool computeSupported  = !!(caps->supported & BGFX_CAPS_COMPUTE);
 		const bool computeSupported  = !!(caps->supported & BGFX_CAPS_COMPUTE);
 		const bool indirectSupported = !!(caps->supported & BGFX_CAPS_DRAW_INDIRECT);
 		const bool indirectSupported = !!(caps->supported & BGFX_CAPS_DRAW_INDIRECT);
 
 
+		imguiCreate();
+
 		if (computeSupported)
 		if (computeSupported)
 		{
 		{
-			// Imgui.
-			imguiCreate();
-
 			bgfx::VertexDecl quadVertexDecl;
 			bgfx::VertexDecl quadVertexDecl;
 			quadVertexDecl.begin()
 			quadVertexDecl.begin()
 				.add(bgfx::Attrib::Position, 2, bgfx::AttribType::Float)
 				.add(bgfx::Attrib::Position, 2, bgfx::AttribType::Float)
@@ -277,8 +276,11 @@ public:
 
 
 			if (computeSupported)
 			if (computeSupported)
 			{
 			{
-				ImGui::SetNextWindowPos(ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) );
-				ImGui::Begin("N-body Settings"
+				ImGui::SetNextWindowPos(
+					  ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
+					, ImGuiSetCond_FirstUseEver
+					);
+				ImGui::Begin("Settings"
 					, NULL
 					, NULL
 					, ImVec2(m_width / 5.0f, m_height / 1.5f)
 					, ImVec2(m_width / 5.0f, m_height / 1.5f)
 					, ImGuiWindowFlags_AlwaysAutoResize
 					, ImGuiWindowFlags_AlwaysAutoResize

+ 5 - 3
examples/27-terrain/terrain.cpp

@@ -404,11 +404,13 @@ public:
 
 
 			bool restart = showExampleDialog(this);
 			bool restart = showExampleDialog(this);
 
 
-			ImGui::SetNextWindowPos(ImVec2((float)m_width - (float)m_width / 5.0f - 10.0f, 10.0f) );
-			ImGui::SetNextWindowSize(ImVec2((float)m_width / 5.0f, (float)m_height / 3.0f) );
+			ImGui::SetNextWindowPos(
+				  ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
+				, ImGuiSetCond_FirstUseEver
+				);
 			ImGui::Begin("Settings"
 			ImGui::Begin("Settings"
 				, NULL
 				, NULL
-				, ImVec2((float)m_width / 5.0f, (float)m_height / 3.0f)
+				, ImVec2(m_width / 5.0f, m_height / 3.0f)
 				, ImGuiWindowFlags_AlwaysAutoResize
 				, ImGuiWindowFlags_AlwaysAutoResize
 				);
 				);
 
 

+ 5 - 3
examples/28-wireframe/wireframe.cpp

@@ -407,11 +407,13 @@ public:
 
 
 			bool restart = showExampleDialog(this);
 			bool restart = showExampleDialog(this);
 
 
-			ImGui::SetNextWindowPos(ImVec2((float)m_width - (float)m_width / 5.0f - 10.0f, 10.0f) );
-			ImGui::SetNextWindowSize(ImVec2((float)m_width / 5.0f, (float)m_height * 0.75f) );
+			ImGui::SetNextWindowPos(
+				  ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
+				, ImGuiSetCond_FirstUseEver
+				);
 			ImGui::Begin("Settings"
 			ImGui::Begin("Settings"
 				, NULL
 				, NULL
-				, ImVec2((float)m_width / 4.0f, (float)m_height * 0.75f)
+				, ImVec2(m_width / 5.0f, m_height * 0.75f)
 				, ImGuiWindowFlags_AlwaysAutoResize
 				, ImGuiWindowFlags_AlwaysAutoResize
 				);
 				);
 
 

+ 5 - 2
examples/30-picking/picking.cpp

@@ -367,8 +367,11 @@ public:
 
 
 			bool restart = showExampleDialog(this);
 			bool restart = showExampleDialog(this);
 
 
-			ImGui::SetNextWindowPos(ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) );
-			ImGui::Begin("Picking Render Target"
+			ImGui::SetNextWindowPos(
+				  ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
+				, ImGuiSetCond_FirstUseEver
+				);
+			ImGui::Begin("Settings"
 				, NULL
 				, NULL
 				, ImVec2(m_width / 5.0f, m_height / 2.0f)
 				, ImVec2(m_width / 5.0f, m_height / 2.0f)
 				, ImGuiWindowFlags_AlwaysAutoResize
 				, ImGuiWindowFlags_AlwaysAutoResize

+ 6 - 2
examples/31-rsm/reflectiveshadowmap.cpp

@@ -591,9 +591,13 @@ public:
 
 
 			bool restart = showExampleDialog(this);
 			bool restart = showExampleDialog(this);
 
 
-			ImGui::Begin("Reflective Shadow Map"
+			ImGui::SetNextWindowPos(
+				  ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
+				, ImGuiSetCond_FirstUseEver
+				);
+			ImGui::Begin("Settings"
 				, NULL
 				, NULL
-				, ImVec2(300.0f, 400.0f)
+				, ImVec2(m_width / 5.0f, m_height / 3.0f)
 				, ImGuiWindowFlags_AlwaysAutoResize
 				, ImGuiWindowFlags_AlwaysAutoResize
 				);
 				);
 
 

+ 1 - 1
examples/32-particles/particles.cpp

@@ -371,7 +371,7 @@ public:
 				  ImVec2(m_width - m_width / 4.0f - 10.0f, 10.0f)
 				  ImVec2(m_width - m_width / 4.0f - 10.0f, 10.0f)
 				, ImGuiSetCond_FirstUseEver
 				, ImGuiSetCond_FirstUseEver
 				);
 				);
-			ImGui::Begin("Properties"
+			ImGui::Begin("Settings"
 				, NULL
 				, NULL
 				, ImVec2(m_width / 4.0f, m_height - 20.0f)
 				, ImVec2(m_width / 4.0f, m_height - 20.0f)
 				, ImGuiWindowFlags_AlwaysAutoResize
 				, ImGuiWindowFlags_AlwaysAutoResize

+ 9 - 2
examples/33-pom/pom.cpp

@@ -263,8 +263,15 @@ public:
 
 
 			bool restart = showExampleDialog(this);
 			bool restart = showExampleDialog(this);
 
 
-			ImGui::SetNextWindowPos(ImVec2(m_width - 240.0f, 20.0f));
-			ImGui::Begin("Properties");
+			ImGui::SetNextWindowPos(
+				  ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
+				, ImGuiSetCond_FirstUseEver
+				);
+			ImGui::Begin("Settings"
+				, NULL
+				, ImVec2(m_width / 5.0f, m_height / 2.0f)
+				, ImGuiWindowFlags_AlwaysAutoResize
+				);
 
 
 			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);