Jamie Slowgrove - OOT Assignment 1 - A Mission in Afghanistan
 All Classes Namespaces Files Functions Variables Macros
OgreApplication.h
Go to the documentation of this file.
1 //
2 // GameDemo.h
3 // OOT Tutorial Ogre Framework Demo.
4 // Created by Wen Tang on 19/01/15.
5 //
6 
7 #pragma once
8 #ifndef _OGRE_APPLICATION_H_
9 #define _OGRE_APPLICATION_H_
10 
11 #include "stdafx.h"
12 #include "OgreWrapper.h"
13 
14 using namespace std;
15 
17 {
18  Ogre::String Name;
19  Ogre::SceneNode* Node;
20 };
21 
23 {
24 
25 private:
26 
27  shared_ptr<Ogre::OverlaySystem> overlaySystem;
28 
30  Ogre::Root *root;
31  Ogre::RenderWindow *renderWindow;
32  Ogre::SceneManager *sceneManager;
33 
34  Ogre::SceneNode *rootSceneNode;
35  Ogre::Viewport *viewport;
36  OIS::InputManager *inputManager;
37 
38  shared_ptr<Ogre::Timer> timer;
39  shared_ptr<OIS::Mouse> mouse;
40  shared_ptr<OIS::Keyboard> keyboard;
41 
42  void CreateLights();
43  void CreateEnviroment();
44 
45 public:
46 
47  OgreApplication(void);
48  ~OgreApplication(void);
49 
50  bool Initialize();
51  void CleanUp();
52 
53  std::shared_ptr<Ogre::SceneNode> CreateCamera(Ogre::String name, Ogre::SceneNode* targetNode);
54  std::shared_ptr<Ogre::SceneNode> CreateEntityFromMesh(std::string mesh, std::string name);
55 
56  void SetEntityColour(Ogre::String materialName,
57  Ogre::String resourceGroupName,
58  Ogre::ColourValue diffuse,
59  Ogre::ColourValue specular,
60  Ogre::Real shininess);
61 
62  void CreateIOS();
63  void Run(bool updateOption=false, bool synchroOption=true); //The main run loop
64  void DestroyNode(Ogre::SceneNode *nodeName);
65 
66  shared_ptr<Ogre::Timer> CreateTimer();
67 
68  const OgreWrapper& GetOgreWrapper(){ return ogreWrapper; }
69  Ogre::SceneManager* GetSceneManager(){return sceneManager ;}
70 
71  shared_ptr<OIS::Keyboard> GetKeyboard(){return keyboard;}
72  shared_ptr<OIS::Mouse> GetMouse(){return mouse;}
73  shared_ptr<Ogre::Timer> GetTimer(){return timer;}
74 
75  Ogre::RenderWindow* GetRenderWindow() {return renderWindow;}
76 };
77 
78 #endif // End of _OGRE_APPLICATION_H_
Ogre::SceneNode * Node
Definition: OgreApplication.h:19
Definition: OgreApplication.h:22
shared_ptr< Ogre::Timer > timer
Definition: OgreApplication.h:38
Ogre::RenderWindow * renderWindow
Definition: OgreApplication.h:31
shared_ptr< OIS::Mouse > GetMouse()
Definition: OgreApplication.h:72
Ogre::SceneManager * sceneManager
Definition: OgreApplication.h:32
OIS::InputManager * inputManager
Definition: OgreApplication.h:36
Ogre::Viewport * viewport
Definition: OgreApplication.h:35
Ogre::RenderWindow * GetRenderWindow()
Definition: OgreApplication.h:75
shared_ptr< OIS::Keyboard > keyboard
Definition: OgreApplication.h:40
shared_ptr< Ogre::OverlaySystem > overlaySystem
Definition: OgreApplication.h:27
Definition: OgreWrapper.h:23
Ogre::SceneManager * GetSceneManager()
Definition: OgreApplication.h:69
Definition: OgreApplication.h:16
shared_ptr< OIS::Mouse > mouse
Definition: OgreApplication.h:39
const OgreWrapper & GetOgreWrapper()
Definition: OgreApplication.h:68
OgreWrapper ogreWrapper
Definition: OgreApplication.h:29
shared_ptr< Ogre::Timer > GetTimer()
Definition: OgreApplication.h:73
Ogre::String Name
Definition: OgreApplication.h:18
shared_ptr< OIS::Keyboard > GetKeyboard()
Definition: OgreApplication.h:71
Ogre::Root * root
Definition: OgreApplication.h:30
Ogre::SceneNode * rootSceneNode
Definition: OgreApplication.h:34