| 1 | /** | 
|---|
| 2 |  @file  orxonox.h | 
|---|
| 3 |  @brief Main Orxonox Class File | 
|---|
| 4 |  @author Benjamin Knecht <beni_at_orxonox.net> | 
|---|
| 5 |  */ | 
|---|
| 6 |  | 
|---|
| 7 | #ifndef ORXONOX_H | 
|---|
| 8 | #define ORXONOX_H | 
|---|
| 9 |  | 
|---|
| 10 | //#include <OgreSingleton.h> | 
|---|
| 11 | #include <OgreSceneManager.h> | 
|---|
| 12 |  | 
|---|
| 13 | #include <OIS/OIS.h> | 
|---|
| 14 |  | 
|---|
| 15 | #include "graphicsEngine.h" | 
|---|
| 16 | #include "../loader/LevelLoader.h" | 
|---|
| 17 | #include "../audio/AudioManager.h" | 
|---|
| 18 | #include "spaceship_steering.h" | 
|---|
| 19 |  | 
|---|
| 20 |  | 
|---|
| 21 | // TODO: Orxonox should maybe derive from BaseObject | 
|---|
| 22 | //! Orxonox singleton class | 
|---|
| 23 | namespace orxonox { | 
|---|
| 24 |  | 
|---|
| 25 |   enum gameMode{ | 
|---|
| 26 |     STANDALONE, | 
|---|
| 27 |     SERVER, | 
|---|
| 28 |     CLIENT, | 
|---|
| 29 |     PRESENTATION | 
|---|
| 30 |   }; | 
|---|
| 31 |    | 
|---|
| 32 |   class OrxListener; | 
|---|
| 33 |  | 
|---|
| 34 |   class Orxonox | 
|---|
| 35 |   { | 
|---|
| 36 |     public: | 
|---|
| 37 |       void init(int argc, char **argv, std::string path); | 
|---|
| 38 |       void start(); | 
|---|
| 39 |       // not sure if this should be private | 
|---|
| 40 |       void die(/* some error code */); | 
|---|
| 41 |       static Orxonox* getSingleton(); | 
|---|
| 42 |       inline SceneManager* getSceneManager() { return ogre_->getSceneManager(); }; | 
|---|
| 43 |       inline GraphicsEngine* getOgrePointer() { return ogre_; }; | 
|---|
| 44 |       inline SpaceshipSteering* getSteeringPointer() { return steering_; }; | 
|---|
| 45 |     private: | 
|---|
| 46 |       Orxonox(); | 
|---|
| 47 |       virtual ~Orxonox(); | 
|---|
| 48 |       // init functions | 
|---|
| 49 |       void serverInit(std::string path); | 
|---|
| 50 |       void clientInit(std::string path); | 
|---|
| 51 |       void standaloneInit(std::string path); | 
|---|
| 52 |       // run functions | 
|---|
| 53 |       void playableServer(std::string path); | 
|---|
| 54 |       void standalone(); | 
|---|
| 55 |       void defineResources(); | 
|---|
| 56 |       void setupRenderSystem(); | 
|---|
| 57 |       void createRenderWindow(); | 
|---|
| 58 |       void initializeResourceGroups(); | 
|---|
| 59 |       void createScene(void); | 
|---|
| 60 |       void setupScene(); | 
|---|
| 61 |       void setupInputSystem(); | 
|---|
| 62 |       void createFrameListener(); | 
|---|
| 63 |       void startRenderLoop(); | 
|---|
| 64 |     private: | 
|---|
| 65 |  | 
|---|
| 66 |       GraphicsEngine*       ogre_;      //!< our dearest graphics engine <3 | 
|---|
| 67 |       std::string           dataPath_;  //!< path to data | 
|---|
| 68 |       loader::LevelLoader*  loader_;    //!< level loader builds the scene | 
|---|
| 69 |       audio::AudioManager*  auMan_;     //!< audio manager | 
|---|
| 70 |       SpaceshipSteering*        steering_; | 
|---|
| 71 |       static Orxonox*       singletonRef_; | 
|---|
| 72 |       OIS::Keyboard*        keyboard_; | 
|---|
| 73 |       OIS::Mouse*           mouse_; | 
|---|
| 74 |       OIS::InputManager*    inputManager_; | 
|---|
| 75 |       OrxListener*          frameListener_; | 
|---|
| 76 |       Ogre::Root*           root_; | 
|---|
| 77 |        | 
|---|
| 78 |       // this is used to identify the mode (server/client/...) we're in | 
|---|
| 79 |       gameMode              mode_; | 
|---|
| 80 |   }; | 
|---|
| 81 | } | 
|---|
| 82 | #endif /* ORXONOX_H */ | 
|---|