[146] | 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 "Ogre.h" |
---|
| 33 | #include "OgreStringConverter.h" |
---|
| 34 | #include "OgreException.h" |
---|
| 35 | |
---|
| 36 | #include "ogre_control.h" |
---|
| 37 | #include "orxonox_scene.h" |
---|
| 38 | #include "orxonox_ship.h" |
---|
| 39 | |
---|
[152] | 40 | |
---|
[146] | 41 | //Use this define to signify OIS will be used as a DLL |
---|
| 42 | //(so that dll import/export macros are in effect) |
---|
| 43 | #define OIS_DYNAMIC_LIB |
---|
| 44 | #include <OIS/OIS.h> |
---|
| 45 | |
---|
| 46 | using namespace Ogre; |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | // let the class inherit from WindowEventListener in order for the RunMgr |
---|
| 50 | // to act as the central point of all the calcuations in Orxonox |
---|
| 51 | class RunManager : WindowEventListener |
---|
| 52 | { |
---|
| 53 | public: |
---|
| 54 | RunManager(OgreControl*, bool = false, bool = false, bool = false); |
---|
| 55 | |
---|
| 56 | virtual ~RunManager(); |
---|
| 57 | |
---|
[152] | 58 | virtual bool tick(unsigned long, Real); |
---|
[146] | 59 | |
---|
| 60 | protected: |
---|
| 61 | virtual void createCamera(void); |
---|
| 62 | |
---|
| 63 | virtual void createViewports(void); |
---|
| 64 | |
---|
| 65 | |
---|
| 66 | /** EVENT HANDLING **/ |
---|
| 67 | |
---|
| 68 | //Adjust mouse clipping area |
---|
| 69 | virtual void windowResized(RenderWindow*); |
---|
| 70 | |
---|
| 71 | //Unattach OIS before window shutdown (very important under Linux) |
---|
| 72 | virtual void windowClosed(RenderWindow*); |
---|
| 73 | |
---|
| 74 | |
---|
| 75 | /** INPUT PROCESSING **/ |
---|
| 76 | virtual bool processUnbufferedKeyInput(); |
---|
| 77 | |
---|
| 78 | virtual bool processUnbufferedMouseInput(); |
---|
| 79 | |
---|
| 80 | |
---|
| 81 | /** OUTPUT **/ |
---|
| 82 | |
---|
| 83 | virtual void updateStats(void); |
---|
| 84 | |
---|
| 85 | virtual void showDebugOverlay(bool); |
---|
| 86 | |
---|
[152] | 87 | protected: |
---|
| 88 | OgreControl *ogre_; |
---|
| 89 | SceneManager *sceneMgr_; |
---|
| 90 | RenderWindow *window_; |
---|
| 91 | OrxonoxScene *backgroundScene_; |
---|
| 92 | Camera *camera_; |
---|
| 93 | OrxonoxShip *playerShip_; |
---|
| 94 | |
---|
| 95 | bool statsOn_; |
---|
| 96 | std::string debugText_; |
---|
| 97 | |
---|
| 98 | unsigned int screenShotCounter_; |
---|
| 99 | // just to stop toggles flipping too fast |
---|
| 100 | Real timeUntilNextToggle_; |
---|
| 101 | bool leftButtonDown_; |
---|
| 102 | TextureFilterOptions filtering_; |
---|
| 103 | int aniso_; |
---|
| 104 | |
---|
| 105 | int sceneDetailIndex_; |
---|
| 106 | Overlay* debugOverlay_; |
---|
| 107 | |
---|
| 108 | //OIS Input devices |
---|
| 109 | OIS::InputManager* inputManager_; |
---|
| 110 | OIS::Mouse* mouse_; |
---|
| 111 | OIS::Keyboard* keyboard_; |
---|
| 112 | OIS::JoyStick* joystick_; |
---|
| 113 | |
---|
| 114 | // Bullet array |
---|
| 115 | Bullet **bullets_; |
---|
| 116 | int bulletsSize_; |
---|
| 117 | int bulletsIndex_; |
---|
| 118 | |
---|
| 119 | // previously elapsed render time |
---|
| 120 | unsigned long totalTime_; |
---|
| 121 | |
---|
[146] | 122 | }; |
---|
| 123 | |
---|
| 124 | #endif /* RUN_MANAGER_H */ |
---|