From 0fad5390782b6b5554fef7be8cc50f64d9d4feab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 29 Jun 2017 23:19:20 -0700 Subject: [PATCH] Cleanup. --- examples/00-helloworld/helloworld.cpp | 4 ++-- examples/01-cubes/cubes.cpp | 4 ++-- examples/02-metaballs/metaballs.cpp | 4 ++-- examples/03-raymarch/raymarch.cpp | 4 ++-- examples/04-mesh/mesh.cpp | 4 ++-- examples/05-instancing/instancing.cpp | 4 ++-- examples/06-bump/bump.cpp | 4 ++-- examples/08-update/update.cpp | 4 ++-- examples/09-hdr/hdr.cpp | 4 ++-- examples/10-font/font.cpp | 4 ++-- examples/11-fontsdf/fontsdf.cpp | 4 ++-- examples/12-lod/lod.cpp | 4 ++-- examples/13-stencil/stencil.cpp | 4 ++-- examples/14-shadowvolumes/shadowvolumes.cpp | 4 ++-- examples/15-shadowmaps-simple/shadowmaps_simple.cpp | 4 ++-- examples/16-shadowmaps/shadowmaps.cpp | 4 ++-- examples/17-drawstress/drawstress.cpp | 4 ++-- examples/18-ibl/ibl.cpp | 4 ++-- examples/19-oit/oit.cpp | 4 ++-- examples/20-nanovg/nanovg.cpp | 4 ++-- examples/21-deferred/deferred.cpp | 4 ++-- examples/22-windows/windows.cpp | 4 ++-- examples/23-vectordisplay/main.cpp | 4 ++-- examples/24-nbody/nbody.cpp | 4 ++-- examples/26-occlusion/occlusion.cpp | 4 ++-- examples/27-terrain/terrain.cpp | 4 ++-- examples/28-wireframe/wireframe.cpp | 4 ++-- examples/29-debugdraw/debugdraw.cpp | 4 ++-- examples/30-picking/picking.cpp | 4 ++-- examples/31-rsm/reflectiveshadowmap.cpp | 4 ++-- examples/32-particles/particles.cpp | 4 ++-- examples/33-pom/pom.cpp | 4 ++-- examples/common/example-glue.cpp | 6 +----- examples/common/imgui/imgui.h | 2 +- 34 files changed, 66 insertions(+), 70 deletions(-) diff --git a/examples/00-helloworld/helloworld.cpp b/examples/00-helloworld/helloworld.cpp index 539599953..eca76181b 100644 --- a/examples/00-helloworld/helloworld.cpp +++ b/examples/00-helloworld/helloworld.cpp @@ -70,7 +70,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); imguiEndFrame(); @@ -105,7 +105,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/01-cubes/cubes.cpp b/examples/01-cubes/cubes.cpp index f222697cd..c048b8096 100644 --- a/examples/01-cubes/cubes.cpp +++ b/examples/01-cubes/cubes.cpp @@ -161,7 +161,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); imguiEndFrame(); @@ -234,7 +234,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/02-metaballs/metaballs.cpp b/examples/02-metaballs/metaballs.cpp index 12f51ac02..391b99c55 100644 --- a/examples/02-metaballs/metaballs.cpp +++ b/examples/02-metaballs/metaballs.cpp @@ -557,7 +557,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); imguiEndFrame(); @@ -768,7 +768,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/03-raymarch/raymarch.cpp b/examples/03-raymarch/raymarch.cpp index a3ac68345..c2712d3fd 100644 --- a/examples/03-raymarch/raymarch.cpp +++ b/examples/03-raymarch/raymarch.cpp @@ -174,7 +174,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); imguiEndFrame(); // Set view 0 default viewport. @@ -240,7 +240,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/04-mesh/mesh.cpp b/examples/04-mesh/mesh.cpp index ad466f7ed..96a8bd3bb 100644 --- a/examples/04-mesh/mesh.cpp +++ b/examples/04-mesh/mesh.cpp @@ -84,7 +84,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); imguiEndFrame(); @@ -140,7 +140,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/05-instancing/instancing.cpp b/examples/05-instancing/instancing.cpp index 144386483..82e4ce59f 100644 --- a/examples/05-instancing/instancing.cpp +++ b/examples/05-instancing/instancing.cpp @@ -141,7 +141,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); imguiEndFrame(); @@ -243,7 +243,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/06-bump/bump.cpp b/examples/06-bump/bump.cpp index 443211122..492dc224b 100644 --- a/examples/06-bump/bump.cpp +++ b/examples/06-bump/bump.cpp @@ -193,7 +193,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); imguiEndFrame(); @@ -348,7 +348,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/08-update/update.cpp b/examples/08-update/update.cpp index debb312cc..8b1da19a6 100644 --- a/examples/08-update/update.cpp +++ b/examples/08-update/update.cpp @@ -360,7 +360,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); imguiEndFrame(); @@ -593,7 +593,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/09-hdr/hdr.cpp b/examples/09-hdr/hdr.cpp index 456a74c42..d1368a6e1 100644 --- a/examples/09-hdr/hdr.cpp +++ b/examples/09-hdr/hdr.cpp @@ -305,7 +305,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); ImGui::SetNextWindowPos( ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) @@ -533,7 +533,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/10-font/font.cpp b/examples/10-font/font.cpp index cabd8a844..3b8e338e6 100644 --- a/examples/10-font/font.cpp +++ b/examples/10-font/font.cpp @@ -228,7 +228,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); imguiEndFrame(); @@ -332,7 +332,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/11-fontsdf/fontsdf.cpp b/examples/11-fontsdf/fontsdf.cpp index da4adcc2c..c6478d248 100644 --- a/examples/11-fontsdf/fontsdf.cpp +++ b/examples/11-fontsdf/fontsdf.cpp @@ -138,7 +138,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); ImGui::SetNextWindowPos( ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) @@ -256,7 +256,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/12-lod/lod.cpp b/examples/12-lod/lod.cpp index 4331e45f0..32bb2f21c 100644 --- a/examples/12-lod/lod.cpp +++ b/examples/12-lod/lod.cpp @@ -140,7 +140,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); ImGui::SetNextWindowPos( ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) @@ -284,7 +284,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/13-stencil/stencil.cpp b/examples/13-stencil/stencil.cpp index f7328bc70..34200e2f0 100644 --- a/examples/13-stencil/stencil.cpp +++ b/examples/13-stencil/stencil.cpp @@ -922,7 +922,7 @@ public: , uint16_t(m_viewState.m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); ImGui::SetNextWindowPos( ImVec2(m_viewState.m_width - m_viewState.m_width / 5.0f - 10.0f, 10.0f) @@ -1354,7 +1354,7 @@ public: clearViewMask(s_clearMask, BGFX_CLEAR_NONE, m_clearValues); s_clearMask = 0; - return !restart; + return true; } return false; diff --git a/examples/14-shadowvolumes/shadowvolumes.cpp b/examples/14-shadowvolumes/shadowvolumes.cpp index 3f9b28fc6..9bcd55ff7 100644 --- a/examples/14-shadowvolumes/shadowvolumes.cpp +++ b/examples/14-shadowvolumes/shadowvolumes.cpp @@ -2162,7 +2162,7 @@ public: , uint16_t(m_viewState.m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); ImGui::SetNextWindowPos(ImVec2(m_viewState.m_width - 256.0f, 10.0f) ); ImGui::Begin("Settings" @@ -2860,7 +2860,7 @@ public: , m_clearValues.m_clearStencil ); - return !restart; + return true; } return false; diff --git a/examples/15-shadowmaps-simple/shadowmaps_simple.cpp b/examples/15-shadowmaps-simple/shadowmaps_simple.cpp index 32b584483..b1442f329 100644 --- a/examples/15-shadowmaps-simple/shadowmaps_simple.cpp +++ b/examples/15-shadowmaps-simple/shadowmaps_simple.cpp @@ -265,7 +265,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); imguiEndFrame(); @@ -409,7 +409,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/16-shadowmaps/shadowmaps.cpp b/examples/16-shadowmaps/shadowmaps.cpp index e7c6b4e02..561e1a498 100644 --- a/examples/16-shadowmaps/shadowmaps.cpp +++ b/examples/16-shadowmaps/shadowmaps.cpp @@ -1980,7 +1980,7 @@ public: , m_viewState.m_height ); - bool restart = showExampleDialog(this); + showExampleDialog(this); ImGui::SetNextWindowPos( ImVec2(m_viewState.m_width - m_viewState.m_width / 5.0f - 10.0f, 10.0f) @@ -3203,7 +3203,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/17-drawstress/drawstress.cpp b/examples/17-drawstress/drawstress.cpp index 79d13c80d..fb7561924 100644 --- a/examples/17-drawstress/drawstress.cpp +++ b/examples/17-drawstress/drawstress.cpp @@ -218,7 +218,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + 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 / 2.0f) ); @@ -315,7 +315,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/18-ibl/ibl.cpp b/examples/18-ibl/ibl.cpp index d9d05f369..fe94a1a81 100644 --- a/examples/18-ibl/ibl.cpp +++ b/examples/18-ibl/ibl.cpp @@ -588,7 +588,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); ImGui::SetNextWindowPos( ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) @@ -893,7 +893,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/19-oit/oit.cpp b/examples/19-oit/oit.cpp index 138add049..3bd9c93b6 100644 --- a/examples/19-oit/oit.cpp +++ b/examples/19-oit/oit.cpp @@ -287,7 +287,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); ImGui::SetNextWindowPos( ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) @@ -481,7 +481,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/20-nanovg/nanovg.cpp b/examples/20-nanovg/nanovg.cpp index d8dfb8038..0e91733a8 100644 --- a/examples/20-nanovg/nanovg.cpp +++ b/examples/20-nanovg/nanovg.cpp @@ -1305,7 +1305,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); imguiEndFrame(); @@ -1330,7 +1330,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/21-deferred/deferred.cpp b/examples/21-deferred/deferred.cpp index c8f449f99..85bc8b1ce 100644 --- a/examples/21-deferred/deferred.cpp +++ b/examples/21-deferred/deferred.cpp @@ -371,7 +371,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); int64_t now = bx::getHPCounter(); static int64_t last = now; @@ -712,7 +712,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/22-windows/windows.cpp b/examples/22-windows/windows.cpp index f494da4b7..1a45e6bdb 100644 --- a/examples/22-windows/windows.cpp +++ b/examples/22-windows/windows.cpp @@ -182,7 +182,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); imguiEndFrame(); @@ -311,7 +311,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/23-vectordisplay/main.cpp b/examples/23-vectordisplay/main.cpp index 353e29493..700aa7876 100644 --- a/examples/23-vectordisplay/main.cpp +++ b/examples/23-vectordisplay/main.cpp @@ -102,7 +102,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); imguiEndFrame(); @@ -192,7 +192,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/24-nbody/nbody.cpp b/examples/24-nbody/nbody.cpp index 28cbc7946..00d63cee5 100644 --- a/examples/24-nbody/nbody.cpp +++ b/examples/24-nbody/nbody.cpp @@ -257,7 +257,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); const bgfx::Caps* caps = bgfx::getCaps(); const bool computeSupported = !!(caps->supported & BGFX_CAPS_COMPUTE); @@ -446,7 +446,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/26-occlusion/occlusion.cpp b/examples/26-occlusion/occlusion.cpp index fcab057ee..77b8e99bd 100644 --- a/examples/26-occlusion/occlusion.cpp +++ b/examples/26-occlusion/occlusion.cpp @@ -171,7 +171,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); imguiEndFrame(); @@ -282,7 +282,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/27-terrain/terrain.cpp b/examples/27-terrain/terrain.cpp index af90d3d02..3c9e2d7ed 100644 --- a/examples/27-terrain/terrain.cpp +++ b/examples/27-terrain/terrain.cpp @@ -402,7 +402,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); ImGui::SetNextWindowPos( ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) @@ -483,7 +483,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/28-wireframe/wireframe.cpp b/examples/28-wireframe/wireframe.cpp index d42f356fc..91b59705e 100644 --- a/examples/28-wireframe/wireframe.cpp +++ b/examples/28-wireframe/wireframe.cpp @@ -405,7 +405,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); ImGui::SetNextWindowPos( ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) @@ -522,7 +522,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/29-debugdraw/debugdraw.cpp b/examples/29-debugdraw/debugdraw.cpp index f80039ede..0e197e510 100644 --- a/examples/29-debugdraw/debugdraw.cpp +++ b/examples/29-debugdraw/debugdraw.cpp @@ -108,7 +108,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); imguiEndFrame(); @@ -290,7 +290,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/30-picking/picking.cpp b/examples/30-picking/picking.cpp index 6519a826e..06ed4a2ba 100644 --- a/examples/30-picking/picking.cpp +++ b/examples/30-picking/picking.cpp @@ -365,7 +365,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); ImGui::SetNextWindowPos( ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) @@ -389,7 +389,7 @@ public: // process submitted rendering primitives. m_currFrame = bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/31-rsm/reflectiveshadowmap.cpp b/examples/31-rsm/reflectiveshadowmap.cpp index 11a27f9dc..b686620a4 100644 --- a/examples/31-rsm/reflectiveshadowmap.cpp +++ b/examples/31-rsm/reflectiveshadowmap.cpp @@ -589,7 +589,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); ImGui::SetNextWindowPos( ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) @@ -616,7 +616,7 @@ public: // process submitted rendering primitives. m_currFrame = bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/32-particles/particles.cpp b/examples/32-particles/particles.cpp index 203452d18..b4afa829c 100644 --- a/examples/32-particles/particles.cpp +++ b/examples/32-particles/particles.cpp @@ -365,7 +365,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); ImGui::SetNextWindowPos( ImVec2(m_width - m_width / 4.0f - 10.0f, 10.0f) @@ -434,7 +434,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/33-pom/pom.cpp b/examples/33-pom/pom.cpp index 72b710782..b1c2867c9 100644 --- a/examples/33-pom/pom.cpp +++ b/examples/33-pom/pom.cpp @@ -261,7 +261,7 @@ public: , uint16_t(m_height) ); - bool restart = showExampleDialog(this); + showExampleDialog(this); ImGui::SetNextWindowPos( ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f) @@ -356,7 +356,7 @@ public: // process submitted rendering primitives. bgfx::frame(); - return !restart; + return true; } return false; diff --git a/examples/common/example-glue.cpp b/examples/common/example-glue.cpp index 80a7ea55b..73072a8c8 100644 --- a/examples/common/example-glue.cpp +++ b/examples/common/example-glue.cpp @@ -8,10 +8,8 @@ #include "entry/cmd.h" #include -bool showExampleDialog(entry::AppI* _app) +void showExampleDialog(entry::AppI* _app) { - bool restart = false; - char temp[1024]; bx::snprintf(temp, BX_COUNTOF(temp), "Example: %s", _app->getName() ); @@ -102,6 +100,4 @@ bool showExampleDialog(entry::AppI* _app) ); ImGui::End(); - - return restart; } diff --git a/examples/common/imgui/imgui.h b/examples/common/imgui/imgui.h index b302a32bd..a71885820 100644 --- a/examples/common/imgui/imgui.h +++ b/examples/common/imgui/imgui.h @@ -55,7 +55,7 @@ void imguiBeginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, void imguiEndFrame(); namespace entry { class AppI; } -bool showExampleDialog(entry::AppI* _app); +void showExampleDialog(entry::AppI* _app); namespace ImGui {