Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////////////
- // GAME.H //
- ////////////
- class Game
- {
- public:
- Game();
- void run()
- {
- while (running)
- {
- void render();
- void update();
- }
- }
- virtual ~Game();
- protected:
- private:
- Game (const Game& other) {}
- void operator = (const Game& other) {}
- void render();
- void update();
- SDL_Event e;
- bool running = true;
- };
- //////////////
- // GAME.CPP //
- //////////////
- Game::Game()
- {
- // INIT everything here //
- Display display(WIDTH, HEIGHT, "Crude (indev version 0.1)");
- }
- Game::~Game()
- {
- // SHUTDOWN everything here //
- }
- void Game::render()
- {
- // Render stuff
- }
- void Game::update()
- {
- while (SDL_PollEvent(&e) != 0)
- {
- if (e.type == SDL_QUIT)
- running = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment