1 | /* |
---|
2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
3 | * |
---|
4 | * |
---|
5 | * License notice: |
---|
6 | * |
---|
7 | * This program is free software: you can redistribute it and/or modify |
---|
8 | * it under the terms of the GNU General Public License as published by |
---|
9 | * the Free Software Foundation, either version 3 of the License, or |
---|
10 | * (at your option) any later version. |
---|
11 | * |
---|
12 | * This program is distributed in the hope that it will be useful, |
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | * GNU General Public License for more details. |
---|
16 | * |
---|
17 | * You should have received a copy of the GNU General Public License |
---|
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
19 | * |
---|
20 | * |
---|
21 | * Author: |
---|
22 | * Reto Grieder |
---|
23 | * Co-authors: |
---|
24 | * ... |
---|
25 | * |
---|
26 | */ |
---|
27 | |
---|
28 | |
---|
29 | #ifndef RUN_MANAGER_H |
---|
30 | #define RUN_MANAGER_H |
---|
31 | |
---|
32 | #include "OgrePrerequisites.h" |
---|
33 | #include "OgreWindowEventUtilities.h" |
---|
34 | #include "OgreTextureManager.h" |
---|
35 | |
---|
36 | #include <OIS/OISPrereqs.h> |
---|
37 | |
---|
38 | #include "orxonox_prerequisites.h" |
---|
39 | |
---|
40 | |
---|
41 | namespace orxonox { |
---|
42 | |
---|
43 | // let the class inherit from WindowEventListener in order for the RunMgr |
---|
44 | // to act as the central point of all the calcuations in Orxonox |
---|
45 | class RunManager : Ogre::WindowEventListener |
---|
46 | { |
---|
47 | public: |
---|
48 | RunManager(OgreControl*); |
---|
49 | |
---|
50 | virtual ~RunManager(); |
---|
51 | |
---|
52 | virtual bool tick(unsigned long, Ogre::Real); |
---|
53 | |
---|
54 | protected: |
---|
55 | virtual void createCamera(void); |
---|
56 | |
---|
57 | virtual void createViewports(void); |
---|
58 | |
---|
59 | |
---|
60 | /** EVENT HANDLING **/ |
---|
61 | |
---|
62 | //Adjust mouse clipping area |
---|
63 | virtual void windowResized(Ogre::RenderWindow*); |
---|
64 | |
---|
65 | //Unattach OIS before window shutdown (very important under Linux) |
---|
66 | virtual void windowClosed(Ogre::RenderWindow*); |
---|
67 | |
---|
68 | |
---|
69 | /** INPUT PROCESSING **/ |
---|
70 | virtual bool processUnbufferedKeyInput(); |
---|
71 | |
---|
72 | virtual bool processUnbufferedMouseInput(); |
---|
73 | |
---|
74 | |
---|
75 | /** OUTPUT **/ |
---|
76 | |
---|
77 | virtual void updateStats(void); |
---|
78 | |
---|
79 | virtual void showDebugOverlay(bool); |
---|
80 | |
---|
81 | protected: |
---|
82 | Ogre::SceneManager *sceneMgr_; |
---|
83 | Ogre::RenderWindow *window_; |
---|
84 | Ogre::Camera *camera_; |
---|
85 | OgreControl *ogre_; |
---|
86 | OrxonoxScene *backgroundScene_; |
---|
87 | OrxonoxShip *playerShip_; |
---|
88 | |
---|
89 | bool statsOn_; |
---|
90 | std::string debugText_; |
---|
91 | |
---|
92 | unsigned int screenShotCounter_; |
---|
93 | // just to stop toggles flipping too fast |
---|
94 | Ogre::Real timeUntilNextToggle_; |
---|
95 | bool leftButtonDown_; |
---|
96 | Ogre::TextureFilterOptions filtering_; |
---|
97 | int aniso_; |
---|
98 | |
---|
99 | int sceneDetailIndex_; |
---|
100 | Ogre::Overlay* debugOverlay_; |
---|
101 | |
---|
102 | //OIS Input devices |
---|
103 | OIS::InputManager* inputManager_; |
---|
104 | OIS::Mouse* mouse_; |
---|
105 | OIS::Keyboard* keyboard_; |
---|
106 | OIS::JoyStick* joystick_; |
---|
107 | |
---|
108 | const Ogre::Real mouseSensitivity_; |
---|
109 | |
---|
110 | // Bullet array |
---|
111 | Bullet **bullets_; |
---|
112 | int bulletsSize_; |
---|
113 | int bulletsIndex_; |
---|
114 | |
---|
115 | // previously elapsed render time |
---|
116 | unsigned long totalTime_; |
---|
117 | |
---|
118 | }; |
---|
119 | |
---|
120 | } |
---|
121 | |
---|
122 | #endif /* RUN_MANAGER_H */ |
---|