I have the GameSettings class.
GameSettings.hpp
class GameSettings
{
public:
GameSettings();
GameSettings loadSettings();
void saveSettings(GameSettings const & GS);
sf::VideoMode getVideoMode() const {return VMode;}
bool isFullscreen() const {return fullscreen;}
private:
sf::VideoMode VMode;
bool fullscreen;
};
One GameSettings is contained in Game class (Game class is Monostate):
Game.hpp
class Game
{
public:
Game() {};
static void init();
static void run();
static void clean();
private:
static sf::Window window;
static GameSettings currentGS;
};
Here is the implementation of init function (only implemented function in Game class yet):
Game.cpp
void Game::init()
{
currentGS.loadSettings();
sf::Uint32 style = currentGS.isFullscreen() ? sf::Style::Fullscreen : sf::Style::None | sf::Style::Close;
window.create(currentGS.getVideoMode(), "Name", style);
}
And I'm getting these errors:
Game.hpp:
(twice) error C2146: syntax error : missing ';' before identifier 'currentGS' - Line 15
(twice) error C4430: missing type specifier - int assumed. Note: C++ does not support default-int - Line 15
Line 15: static GameSettings currentGS;
Game.cpp
error C2065: 'currentGS' : undeclared identifier - Lines 7, 8, 9
error C2228: left of '.loadSettings' must have class/struct/union - Line 7, 8, 9
These are only lines of init function ^