TurtleBrains  0.3.1
High quality, portable, C++ framework for rapid 2D game development.
tb_game_application.h
1 
9 #ifndef _TurtleBrains_GameApplication_h_
10 #define _TurtleBrains_GameApplication_h_
11 
12 #include "../application/tb_realtime_application.h"
13 #include "../graphics/tb_texture_manager.h" //For PixelSpace typedef.
14 
15 namespace TurtleBrains
16 {
17  namespace Game
18  {
19  class GameScene;
20 
26  class GameApplication : public Application::RealtimeApplication, public tbCore::Error::ErrorHandlerInterface
27  {
28  public:
35  GameApplication(const tbGraphics::PixelSpace& windowWidth = 1280, const tbGraphics::PixelSpace& windowHeight = 720, const bool verticalSync = true);
36 
40  ~GameApplication(void);
41 
49  void RunGame(GameScene& gameScene);
50 
62 
66  static void MarkForClose(void);
67 
72  static bool IsGameActive(void);
73 
74  private:
75 
80  virtual void OnErrorFired(const std::string& errorMessage) override;
81 
82  GameScene* mErrorScene;
83  };
84 
85  }; /* namespace Game */
86 }; /* namespace TurtleBrains */
87 
88 namespace tbGame = TurtleBrains::Game;
89 
90 #endif /* _TurtleBrains_GameApplication_h_ */
void SetApplicationHandler(Application::ApplicationHandlerInterface *applicationHandler)
GameApplication(const tbGraphics::PixelSpace &windowWidth=1280, const tbGraphics::PixelSpace &windowHeight=720, const bool verticalSync=true)
Definition: tb_game_application.h:26
Here is some information about the primary namespace.
Definition: tb_application_dialog.h:21
Definition: tb_game_scene.h:28
tbCore::uint16 PixelSpace
Definition: tb_texture_manager.h:35
Handle events from the application/window and actions from the user of your application by deriving a...
Definition: tb_application_handler_interface.h:31
Definition: tb_realtime_application.h:43
This is the heart of TurtleBrains for game developers to create GameScenes and Entities to interact w...
void RunGame(GameScene &gameScene)