diff --git a/examples/09-hdr/hdr.cpp b/examples/09-hdr/hdr.cpp index 6d611a258..27e653775 100644 --- a/examples/09-hdr/hdr.cpp +++ b/examples/09-hdr/hdr.cpp @@ -311,7 +311,7 @@ public: ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) , ImGuiSetCond_FirstUseEver ); - ImGui::Begin("HDR Settings" + ImGui::Begin("Settings" , NULL , ImVec2(m_width / 5.0f, m_height / 2.0f) , ImGuiWindowFlags_AlwaysAutoResize diff --git a/examples/11-fontsdf/fontsdf.cpp b/examples/11-fontsdf/fontsdf.cpp index dbb126993..b15e23c0c 100644 --- a/examples/11-fontsdf/fontsdf.cpp +++ b/examples/11-fontsdf/fontsdf.cpp @@ -140,20 +140,18 @@ public: 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 - , ImVec2(guiPanelWidth, guiPanelHeight) + , ImVec2(m_width / 5.0f, m_height / 2.0f) , ImGuiWindowFlags_AlwaysAutoResize ); - ImGui::Separator(); - 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) ) { diff --git a/examples/12-lod/lod.cpp b/examples/12-lod/lod.cpp index 6ebaba68e..3f9a15226 100644 --- a/examples/12-lod/lod.cpp +++ b/examples/12-lod/lod.cpp @@ -142,8 +142,11 @@ public: 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 , ImVec2(m_width / 5.0f, m_height / 6.0f) , ImGuiWindowFlags_AlwaysAutoResize diff --git a/examples/13-stencil/stencil.cpp b/examples/13-stencil/stencil.cpp index 096b057cb..2bfc8968f 100644 --- a/examples/13-stencil/stencil.cpp +++ b/examples/13-stencil/stencil.cpp @@ -924,8 +924,11 @@ public: 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 , ImVec2(m_viewState.m_width / 5.0f, m_viewState.m_height / 2.0f) , ImGuiWindowFlags_AlwaysAutoResize diff --git a/examples/16-shadowmaps/shadowmaps.cpp b/examples/16-shadowmaps/shadowmaps.cpp index effc44131..427db8811 100644 --- a/examples/16-shadowmaps/shadowmaps.cpp +++ b/examples/16-shadowmaps/shadowmaps.cpp @@ -1980,12 +1980,15 @@ public: 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" - , 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) \ ImGui::SliderFloat(_name \ @@ -2079,12 +2082,15 @@ public: ImGui::End(); #undef IMGUI_RADIO_BUTTON - ImGui::SetNextWindowPos(ImVec2(10,70) ); + ImGui::SetNextWindowPos( + ImVec2(10.0f, 260.0f) + , ImGuiSetCond_FirstUseEver + ); 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); bool bLtChanged = false; diff --git a/examples/19-oit/oit.cpp b/examples/19-oit/oit.cpp index 5dbd23fd0..a992af032 100644 --- a/examples/19-oit/oit.cpp +++ b/examples/19-oit/oit.cpp @@ -289,11 +289,13 @@ public: 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" , NULL - , ImVec2((float)m_width / 4.0f, (float)m_height / 3.0f) + , ImVec2(m_width / 5.0f, m_height / 3.0f) , ImGuiWindowFlags_AlwaysAutoResize ); diff --git a/examples/21-deferred/deferred.cpp b/examples/21-deferred/deferred.cpp index bac81f835..833ad9b27 100644 --- a/examples/21-deferred/deferred.cpp +++ b/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); } - 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 , ImVec2(m_width / 5.0f, m_height / 3.0f) , ImGuiWindowFlags_AlwaysAutoResize diff --git a/examples/24-nbody/nbody.cpp b/examples/24-nbody/nbody.cpp index d00b801be..65b641043 100644 --- a/examples/24-nbody/nbody.cpp +++ b/examples/24-nbody/nbody.cpp @@ -145,11 +145,10 @@ public: const bool computeSupported = !!(caps->supported & BGFX_CAPS_COMPUTE); const bool indirectSupported = !!(caps->supported & BGFX_CAPS_DRAW_INDIRECT); + imguiCreate(); + if (computeSupported) { - // Imgui. - imguiCreate(); - bgfx::VertexDecl quadVertexDecl; quadVertexDecl.begin() .add(bgfx::Attrib::Position, 2, bgfx::AttribType::Float) @@ -277,8 +276,11 @@ public: 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 , ImVec2(m_width / 5.0f, m_height / 1.5f) , ImGuiWindowFlags_AlwaysAutoResize diff --git a/examples/27-terrain/terrain.cpp b/examples/27-terrain/terrain.cpp index b5f2d7ec7..bd90cd022 100644 --- a/examples/27-terrain/terrain.cpp +++ b/examples/27-terrain/terrain.cpp @@ -404,11 +404,13 @@ public: 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" , NULL - , ImVec2((float)m_width / 5.0f, (float)m_height / 3.0f) + , ImVec2(m_width / 5.0f, m_height / 3.0f) , ImGuiWindowFlags_AlwaysAutoResize ); diff --git a/examples/28-wireframe/wireframe.cpp b/examples/28-wireframe/wireframe.cpp index 2fd6dd580..f9ac0eb89 100644 --- a/examples/28-wireframe/wireframe.cpp +++ b/examples/28-wireframe/wireframe.cpp @@ -407,11 +407,13 @@ public: 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" , NULL - , ImVec2((float)m_width / 4.0f, (float)m_height * 0.75f) + , ImVec2(m_width / 5.0f, m_height * 0.75f) , ImGuiWindowFlags_AlwaysAutoResize ); diff --git a/examples/30-picking/picking.cpp b/examples/30-picking/picking.cpp index 17ab19bc0..36876a052 100644 --- a/examples/30-picking/picking.cpp +++ b/examples/30-picking/picking.cpp @@ -367,8 +367,11 @@ public: 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 , ImVec2(m_width / 5.0f, m_height / 2.0f) , ImGuiWindowFlags_AlwaysAutoResize diff --git a/examples/31-rsm/reflectiveshadowmap.cpp b/examples/31-rsm/reflectiveshadowmap.cpp index b544a662b..2d7706d9f 100644 --- a/examples/31-rsm/reflectiveshadowmap.cpp +++ b/examples/31-rsm/reflectiveshadowmap.cpp @@ -591,9 +591,13 @@ public: 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 - , ImVec2(300.0f, 400.0f) + , ImVec2(m_width / 5.0f, m_height / 3.0f) , ImGuiWindowFlags_AlwaysAutoResize ); diff --git a/examples/32-particles/particles.cpp b/examples/32-particles/particles.cpp index 0eb5a8813..4d9ccbe55 100644 --- a/examples/32-particles/particles.cpp +++ b/examples/32-particles/particles.cpp @@ -371,7 +371,7 @@ public: ImVec2(m_width - m_width / 4.0f - 10.0f, 10.0f) , ImGuiSetCond_FirstUseEver ); - ImGui::Begin("Properties" + ImGui::Begin("Settings" , NULL , ImVec2(m_width / 4.0f, m_height - 20.0f) , ImGuiWindowFlags_AlwaysAutoResize diff --git a/examples/33-pom/pom.cpp b/examples/33-pom/pom.cpp index 0cfa2e7b3..8fcd5f952 100644 --- a/examples/33-pom/pom.cpp +++ b/examples/33-pom/pom.cpp @@ -263,8 +263,15 @@ public: 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("Normal mapping", &m_shading_type, 1);