From 04a09e6a59200092e7e4ccde94535a921c01c4c4 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 18 Apr 2022 10:40:00 +0200 Subject: Moved global game instance to a header --- Globals.h | 6 ++++++ TitleScreen.cpp | 3 +-- main.cpp | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 Globals.h diff --git a/Globals.h b/Globals.h new file mode 100644 index 0000000..8a3b467 --- /dev/null +++ b/Globals.h @@ -0,0 +1,6 @@ +#pragma once + +#include "Game.h" + + +extern Game g_game; diff --git a/TitleScreen.cpp b/TitleScreen.cpp index 9bdd47c..3994fe9 100644 --- a/TitleScreen.cpp +++ b/TitleScreen.cpp @@ -6,10 +6,9 @@ #include "Game.h" #include "GameScreen.h" +#include "Globals.h" -extern Game g_game; - static constexpr const char* TITLE {"Generic Bullet HELL"}; static constexpr const char* PRESS {"Press SPACE to start"}; diff --git a/main.cpp b/main.cpp index e76f30a..207e861 100644 --- a/main.cpp +++ b/main.cpp @@ -7,6 +7,7 @@ #endif #include "Game.h" +#include "Globals.h" #include "TitleScreen.h" -- cgit v1.1