Rune Engine  Version 0.2.7-alpha
Documentation for how to make games using the Rune Engine.
gameScene.h
1 
11 #ifndef GAMESCENE_H_INCLUDED
12 #define GAMESCENE_H_INCLUDED
13 
14 #include <core.h>
15 #include <vector>
16 #include <string>
17 #include <Renderer\color.h>
18 #include <Physics\physicsEngine.h>
19 #include <Entities\gameObject.h>
20 #include <Events\clock.h>
21 #include <Renderer\camera.h>
22 #include <Renderer\frameBuffer.h>
23 #include <DataStructures\list.h>
24 //#include <Physics\world.h>
25 
26 namespace rune{
27 
28 class RUNE_ENGINE GameScene
29 {
30 protected:
32  bool isStateActive = false;
34  std::vector<physics::RigidBody*> physicsBodies;
38  std::vector<rune::Drawable*> drawableObjects;
42  double dT;
44  double accumulator;
46  double frameStart;
49 
50 public:
52  GameScene();
54  virtual void doInit(void);
56  virtual void reInit(void);
57  virtual void deInit(void);
58  virtual void pause(void);
59  virtual void resume(void);
60  virtual void updateFixed(void);
61  virtual void updateVariable(void);
62  virtual void Draw(RenderWindow& window);
63  void updatePhysics(void);
64  virtual void handleCleanup(void);
65  virtual void handleUI(RenderWindow& window);
67  void startComponents(void);
69  void updateComponents(void);
71  void renderScene(RenderWindow& window);
73  bool isActive(void);
75  void addObjectToScene(rune::GameObject&);
77  void submitToRenderer(rune::Drawable&);
79  void addPhysicsObject(physics::RigidBody& body);
80 
81  friend class SceneSerializer;
82 
83 };
84 }
85 
86 #endif
87 
rune::List< rune::GameObject * >
rune::GameScene::drawableObjects
std::vector< rune::Drawable * > drawableObjects
The drawable objects contained in the scene that should be rendered to the screen.
Definition: gameScene.h:38
rune::GameScene::sceneObjects
List< rune::GameObject * > sceneObjects
Objects in the scene that need to have their components updated every frame.
Definition: gameScene.h:36
physics::RigidBody
Game object component that allows a game object to have collisions with other objects.
Definition: rigidBody.h:95
rune::GameScene
This class is responsible for serving as a parent class for each instance of the game....
Definition: gameScene.h:29
rune::GameScene::dT
double dT
Time between variable update calls.
Definition: gameScene.h:42
rune::GameScene::variableClock
rune::Clock variableClock
A clock that records the amount of time between variable update calls.
Definition: gameScene.h:40
rune::Drawable
Interface class for creating something that can be drawn to the screen.
Definition: drawable.h:20
rune::GameScene::frameStart
double frameStart
The time that the current frame started.
Definition: gameScene.h:46
rune::GameScene::physicsBodies
std::vector< physics::RigidBody * > physicsBodies
The physics bodies in the scene to be simulated.
Definition: gameScene.h:34
rune::GameScene::accumulator
double accumulator
Clamping value for physics simulator.
Definition: gameScene.h:44
rune::GameScene::clearColor
rune::Color clearColor
The color that the screen will be when cleared.
Definition: gameScene.h:48
rune::RenderWindow
A window that the game can be drawn to.
Definition: renderWindow.h:26
rune::Color
A color object to be applied to drawable objects.
Definition: color.h:19
rune::SceneSerializer
An object that can be used to write a GameScene to a YAML encoded file.
Definition: SceneSerializer.h:18
rune
The main namespace to be used for interfacing with the engine.
Definition: animator.h:21
rune::GameObject
Entity control system main object used for all objects in the scene.
Definition: gameObject.h:23
rune::Clock
A clock that can be used to tell how much time has passed.
Definition: clock.h:19