1234567891011121314
class Game { public: static void start(); private: static bool End(); static void Loop(); enum GameState {Unitialised, ShowingMenu, Playing, Finishing}; static GameState _gameState; static sf::RenderWindow _mainWindow; protected: };
12345678910111213
void Game::start() { if (_gameState!= Unitialised) return; _mainWindow.create(sf::VideoMode(1024,768,32),"SFML"); _gameState = Game::Playing; while (!End()) { Loop(); } _mainWindow.close(); }