diff --git a/Application/World.cpp b/Application/World.cpp index b03814b..4ef4e25 100644 --- a/Application/World.cpp +++ b/Application/World.cpp @@ -17,7 +17,8 @@ World::World(Scop::Scene& scene) : m_scene(scene), m_previous_chunk_position(-10 auto narrator_update = [this](Scop::NonOwningPtr scene, Scop::Inputs& input, float delta) { static bool generate = true; - static bool debounce = false; + static bool generation_debounce = false; + static bool wireframe_debounce = false; Scop::FirstPerson3D* camera = reinterpret_cast(m_scene.GetCamera().get()); std::int32_t x_chunk = static_cast(camera->GetPosition().x) / static_cast(CHUNK_SIZE.x); @@ -25,11 +26,11 @@ World::World(Scop::Scene& scene) : m_scene(scene), m_previous_chunk_position(-10 m_current_chunk_position = Scop::Vec2i{ x_chunk, z_chunk }; if(input.IsKeyPressed(SDL_SCANCODE_G)) - debounce = true; - else if(debounce) + generation_debounce = true; + else if(generation_debounce) { generate = !generate; - debounce = false; + generation_debounce = false; } if(generate) @@ -47,6 +48,16 @@ World::World(Scop::Scene& scene) : m_scene(scene), m_previous_chunk_position(-10 } Upload(); } + + if(input.IsKeyPressed(SDL_SCANCODE_F)) + wireframe_debounce = true; + else if(wireframe_debounce) + { + m_scene.GetForwardData().wireframe = !m_scene.GetForwardData().wireframe; + Scop::RenderCore::Get().WaitDeviceIdle(); + m_scene.GetPipeline().Destroy(); + wireframe_debounce = false; + } }; m_scene.CreateNarrator().AttachScript(std::make_shared(std::function{}, narrator_update, std::function{})); diff --git a/ScopEngine/Makefile b/ScopEngine/Makefile index de7d870..b6a3715 100644 --- a/ScopEngine/Makefile +++ b/ScopEngine/Makefile @@ -116,7 +116,7 @@ $(SHADER_DIR): shaders: $(SHADER_DIR) $(SPVS) _printbuildinfos: - @printf "$(_PURPLE)$(_BOLD)Vox $(_RESET)Compiling in $(_BOLD)$(MODE)$(_RESET) mode on $(_BOLD)$(OS)$(_RESET) | Using $(_BOLD)$(CXX) ($(shell $(CXX) --version | head -n 1))$(_RESET), flags: $(_BOLD)$(_ENABLEDFLAGS)$(_RESET)\n" + @printf "$(_PURPLE)$(_BOLD)ScopEngine $(_RESET)Compiling in $(_BOLD)$(MODE)$(_RESET) mode on $(_BOLD)$(OS)$(_RESET) | Using $(_BOLD)$(CXX) ($(shell $(CXX) --version | head -n 1))$(_RESET), flags: $(_BOLD)$(_ENABLEDFLAGS)$(_RESET)\n" debug: @$(MAKE) all DEBUG=true -j$(shell nproc)