[462] | 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" |
---|
[515] | 18 | #include "spaceship_steering.h" |
---|
[462] | 19 | |
---|
| 20 | |
---|
| 21 | // TODO: Orxonox should maybe derive from BaseObject |
---|
| 22 | //! Orxonox singleton class |
---|
| 23 | namespace orxonox { |
---|
| 24 | |
---|
[568] | 25 | enum gameMode{ |
---|
| 26 | STANDALONE, |
---|
| 27 | SERVER, |
---|
| 28 | CLIENT, |
---|
| 29 | PRESENTATION |
---|
| 30 | }; |
---|
| 31 | |
---|
[462] | 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(); }; |
---|
[515] | 43 | inline GraphicsEngine* getOgrePointer() { return ogre_; }; |
---|
| 44 | inline SpaceshipSteering* getSteeringPointer() { return steering_; }; |
---|
[584] | 45 | inline audio::AudioManager* getAudioManagerPointer() { return auMan_; }; |
---|
[462] | 46 | private: |
---|
| 47 | Orxonox(); |
---|
| 48 | virtual ~Orxonox(); |
---|
[568] | 49 | // init functions |
---|
[462] | 50 | void serverInit(std::string path); |
---|
| 51 | void clientInit(std::string path); |
---|
[568] | 52 | void standaloneInit(std::string path); |
---|
| 53 | // run functions |
---|
[531] | 54 | void playableServer(std::string path); |
---|
[568] | 55 | void standalone(); |
---|
[473] | 56 | void defineResources(); |
---|
| 57 | void setupRenderSystem(); |
---|
| 58 | void createRenderWindow(); |
---|
| 59 | void initializeResourceGroups(); |
---|
[462] | 60 | void createScene(void); |
---|
| 61 | void setupScene(); |
---|
| 62 | void setupInputSystem(); |
---|
| 63 | void createFrameListener(); |
---|
| 64 | void startRenderLoop(); |
---|
| 65 | private: |
---|
| 66 | |
---|
| 67 | GraphicsEngine* ogre_; //!< our dearest graphics engine <3 |
---|
| 68 | std::string dataPath_; //!< path to data |
---|
| 69 | loader::LevelLoader* loader_; //!< level loader builds the scene |
---|
| 70 | audio::AudioManager* auMan_; //!< audio manager |
---|
[515] | 71 | SpaceshipSteering* steering_; |
---|
[462] | 72 | static Orxonox* singletonRef_; |
---|
| 73 | OIS::Keyboard* keyboard_; |
---|
| 74 | OIS::Mouse* mouse_; |
---|
| 75 | OIS::InputManager* inputManager_; |
---|
| 76 | OrxListener* frameListener_; |
---|
[473] | 77 | Ogre::Root* root_; |
---|
[568] | 78 | |
---|
| 79 | // this is used to identify the mode (server/client/...) we're in |
---|
| 80 | gameMode mode_; |
---|
[599] | 81 | std::string serverIp_; |
---|
[462] | 82 | }; |
---|
| 83 | } |
---|
| 84 | #endif /* ORXONOX_H */ |
---|