press 'tab' to see debug info

master
Vectozavr 2021-11-03 16:49:07 +07:00
parent 762fae3da4
commit e10521c5e2
4 changed files with 9 additions and 4 deletions

View File

@ -158,6 +158,10 @@ void Shooter::update() {
screen->setMouseCursorVisible(!inGame); screen->setMouseCursorVisible(!inGame);
} }
if (keyboard->isKeyTapped(sf::Keyboard::Tab)) {
setDebugInfo(!showDebugInfo());
}
if (inGame) { if (inGame) {
screen->setTitle(ShooterConsts::PROJECT_NAME); screen->setTitle(ShooterConsts::PROJECT_NAME);
playerController->update(); playerController->update();

View File

@ -10,10 +10,10 @@ using namespace std;
int main() { int main() {
Shooter game; 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(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); //game.create(3072, 1920, ShooterConsts::PROJECT_NAME, true, Consts::BACKGROUND_COLOR, sf::Style::Fullscreen);
return 0; return 0;

View File

@ -16,7 +16,7 @@ namespace Consts {
const std::string PROJECT_NAME = "engine"; const std::string PROJECT_NAME = "engine";
const bool USE_LOG_FILE = true; const bool USE_LOG_FILE = true;
const bool USE_OPEN_GL = 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 bool SHOW_FPS_COUNTER = true;
const double PI = 3.14159265358979323846264338327950288; const double PI = 3.14159265358979323846264338327950288;

View File

@ -35,7 +35,8 @@ protected:
virtual void update() {}; 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; } void setUpdateWorld(bool value) { _updateWorld = value; }