~brandontschaefer/unity/sdl-bouncy-ball

« back to all changes in this revision

Viewing changes to src/Main.cpp

  • Committer: Brandon Schaefer
  • Date: 2014-04-25 23:40:46 UTC
  • Revision ID: brandontschaefer@gmail.com-20140425234046-tt1stvvm4m2n35es
* Fix major memory leaks.
* Actually quite correctly (not just exit(0))

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
}
38
38
 
39
39
Main::Main()
40
 
  : main_loop_(TITLE, WIDTH, HEIGHT)
 
40
  : main_loop_(std::make_shared<sbe::MainLoop>(TITLE, WIDTH, HEIGHT))
41
41
  , main_layer_(std::make_shared<sbe::EntityLayer>())
42
42
{
43
43
  sbe::EntityCreator ec;
44
44
 
45
45
  // Need to add this layer first, so it draws last
46
 
  main_loop_.world()->AddLayerToBottom(main_layer_);
 
46
  main_loop_->world()->AddLayerToBottom(main_layer_);
47
47
 
48
48
  bouncy_main_ = std::make_shared<BouncyBallMain>(ec.GetUniqueId(), main_loop_);
49
49
  main_layer_->AddEntity(bouncy_main_);
50
50
 
51
 
  main_loop_.StartMainLoop();
 
51
  main_loop_->StartMainLoop();
 
52
  main_layer_->Clear();
52
53
}
53
54
 
54
55
} // namespace bouncy_ball