Skip to content

Commit

Permalink
create real instances
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackScorp committed Apr 26, 2017
1 parent 5889833 commit 41e7f60
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@


int main(int argc, char** argv) {
Game* game = new Game();
if(false == game->init()){
std::cout << game->getError();

Game game;
if(false == game.init()){
std::cout << game.getError();
return -1;
}
game->run();
game.run();
return 0;
}

4 changes: 2 additions & 2 deletions source/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ void Game::run() {

unsigned int nextGameTick = SDL_GetTicks();

MainScene* scene = new MainScene;
scene->render();
MainScene scene;
scene.render();

while (Game::isRunning) {
loops = 0;
Expand Down

0 comments on commit 41e7f60

Please sign in to comment.