diff --git a/Shooter.cpp b/Shooter.cpp index 687cd99..11f762b 100644 --- a/Shooter.cpp +++ b/Shooter.cpp @@ -158,6 +158,10 @@ void Shooter::update() { screen->setMouseCursorVisible(!inGame); } + if (keyboard->isKeyTapped(sf::Keyboard::Tab)) { + setDebugInfo(!showDebugInfo()); + } + if (inGame) { screen->setTitle(ShooterConsts::PROJECT_NAME); playerController->update(); diff --git a/Source.cpp b/Source.cpp index 372c41c..a1662ce 100644 --- a/Source.cpp +++ b/Source.cpp @@ -10,10 +10,10 @@ using namespace std; int main() { Shooter game; - game.create(1280, 720, ShooterConsts::PROJECT_NAME); + //game.create(1280, 720, ShooterConsts::PROJECT_NAME); //game.create(1920, 1080, ShooterConsts::PROJECT_NAME, true, Consts::BACKGROUND_COLOR, sf::Style::Fullscreen); - //game.create(2048, 1152, ShooterConsts::PROJECT_NAME, true); + game.create(2048, 1152, ShooterConsts::PROJECT_NAME, true); //game.create(3072, 1920, ShooterConsts::PROJECT_NAME, true, Consts::BACKGROUND_COLOR, sf::Style::Fullscreen); return 0; diff --git a/engine/Consts.h b/engine/Consts.h index 5224041..e46237e 100644 --- a/engine/Consts.h +++ b/engine/Consts.h @@ -16,7 +16,7 @@ namespace Consts { const std::string PROJECT_NAME = "engine"; const bool USE_LOG_FILE = true; const bool USE_OPEN_GL = true; - const bool SHOW_DEBUG_INFO = true; + const bool SHOW_DEBUG_INFO = false; const bool SHOW_FPS_COUNTER = true; const double PI = 3.14159265358979323846264338327950288; diff --git a/engine/Engine.h b/engine/Engine.h index bc032a0..effdb19 100644 --- a/engine/Engine.h +++ b/engine/Engine.h @@ -35,7 +35,8 @@ protected: virtual void update() {}; - void setDebugText(bool value) { _showDebugInfo = value; } + [[nodiscard]] bool showDebugInfo() const { return _showDebugInfo; } + void setDebugInfo(bool value) { _showDebugInfo = value; } void setUpdateWorld(bool value) { _updateWorld = value; }