Rune Engine  Version 0.2.7-alpha
Documentation for how to make games using the Rune Engine.
gameApplication.h
1 
60 #ifndef GAMEAPP_H_INCLUDED
61 #define GAMEAPP_H_INCLUDED
62 
63 #include "core.h"
64 #define IMGUI_IMPL_OPENGL_LOADER_CUSTOM
65 #include <SceneManager\sceneManager.h>
66 #include <Renderer\RenderWindow.h>
67 #include <Events\clock.h>
68 
69 #define getGameInstance() rune::GameApplication::getApplication()
70 
71 namespace rune{
72 
73 class RUNE_ENGINE GameApplication
74 {
75 private:
76 
77  static GameApplication* currentApplication;
78 
79  RenderWindow m_mainWindow;
80 
81  double deltaTime;
82  int frameRate;
83 
84  bool m_gameRunning;
85  int m_updateRate;
86 
87  SceneManager m_sceneManager;
88 
90  GameApplication(std::string const& title = "Rune Engine", int updateRate = 60);
91 
92 public:
99 
100  //Delete the copy constructor
102  GameApplication(const GameApplication&) = delete;
104 
107  {
108  if(!currentApplication)
109  {
110  currentApplication = new GameApplication;
111  }
112 
113  return currentApplication;
114  }
115 
117  void loadScene(std::string const& sceneName, GameScene* newScene);
119  int run(void);
121  RenderWindow* getWindow(void);
123  double getDeltaTime(void);
125  int getFrameRate(void);
127  void quitApplication();
129  void changeScene(std::string const& newScene);
131  GameScene* getCurrentScene(void);
132 
133 };
134 }
135 
136 #endif
137 
rune::GameApplication
Entry point for all programs using the engine, must instantiate a game application for every new game...
Definition: gameApplication.h:74
rune::GameApplication::m_errorCode
int m_errorCode
Definition: gameApplication.h:98
rune::GameScene
This class is responsible for serving as a parent class for each instance of the game....
Definition: gameScene.h:29
rune::SceneManager
The scene manager is responsible for handling the transfer of the current state pointer that refers t...
Definition: sceneManager.h:23
rune::GameApplication::getApplication
static GameApplication * getApplication()
Definition: gameApplication.h:106
rune::RenderWindow
A window that the game can be drawn to.
Definition: renderWindow.h:26
rune
The main namespace to be used for interfacing with the engine.
Definition: animator.h:21