[612] | 1 | /** |
---|
| 2 | @file Orxonox.h |
---|
| 3 | @brief Main Orxonox Class File |
---|
| 4 | @author Benjamin Knecht <beni_at_orxonox.net> |
---|
| 5 | */ |
---|
| 6 | |
---|
[673] | 7 | #ifndef _Orxonox_H__ |
---|
| 8 | #define _Orxonox_H__ |
---|
[612] | 9 | |
---|
[715] | 10 | #include <string> |
---|
| 11 | |
---|
[612] | 12 | #include <OgrePrerequisites.h> |
---|
| 13 | #include <OIS/OISPrereqs.h> |
---|
| 14 | |
---|
| 15 | #include "OrxonoxPrereqs.h" |
---|
[682] | 16 | #include "loader/LoaderPrereqs.h" |
---|
[729] | 17 | |
---|
[612] | 18 | #include "GraphicsEngine.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 | |
---|
[729] | 32 | class _OrxonoxExport Orxonox |
---|
[612] | 33 | { |
---|
| 34 | public: |
---|
[715] | 35 | void init(int argc, char **argv, std::string path); |
---|
[612] | 36 | void start(); |
---|
| 37 | // not sure if this should be private |
---|
| 38 | void die(/* some error code */); |
---|
| 39 | static Orxonox* getSingleton(); |
---|
[637] | 40 | inline Ogre::SceneManager* getSceneManager() { return ogre_->getSceneManager(); }; |
---|
| 41 | inline GraphicsEngine* getOgrePointer() { return ogre_; }; |
---|
[612] | 42 | inline audio::AudioManager* getAudioManagerPointer() { return auMan_; }; |
---|
[637] | 43 | inline OIS::Keyboard* getKeyboard() { return this->keyboard_; } |
---|
| 44 | inline OIS::Mouse* getMouse() { return this->mouse_; } |
---|
| 45 | inline BulletManager* getBulletMgr() { return this->bulletMgr_; } |
---|
[612] | 46 | |
---|
| 47 | private: |
---|
| 48 | Orxonox(); |
---|
| 49 | virtual ~Orxonox(); |
---|
| 50 | // init functions |
---|
[715] | 51 | void serverInit(std::string path); |
---|
| 52 | void clientInit(std::string path); |
---|
| 53 | void standaloneInit(std::string path); |
---|
[612] | 54 | // run functions |
---|
[715] | 55 | void playableServer(std::string path); |
---|
[612] | 56 | void standalone(); |
---|
| 57 | void defineResources(); |
---|
| 58 | void setupRenderSystem(); |
---|
| 59 | void createRenderWindow(); |
---|
| 60 | void initializeResourceGroups(); |
---|
| 61 | void createScene(void); |
---|
| 62 | void setupScene(); |
---|
| 63 | void setupInputSystem(); |
---|
| 64 | void createFrameListener(); |
---|
| 65 | void startRenderLoop(); |
---|
| 66 | |
---|
| 67 | private: |
---|
[717] | 68 | GraphicsEngine* ogre_; //!< our dearest graphics engine <3 |
---|
| 69 | std::string dataPath_; //!< path to data |
---|
| 70 | loader::LevelLoader* loader_; //!< level loader builds the scene |
---|
| 71 | audio::AudioManager* auMan_; //!< audio manager |
---|
| 72 | BulletManager* bulletMgr_; //!< Keeps track of the thrown bullets |
---|
[612] | 73 | static Orxonox* singletonRef_; |
---|
| 74 | OIS::Keyboard* keyboard_; |
---|
| 75 | OIS::Mouse* mouse_; |
---|
| 76 | OIS::InputManager* inputManager_; |
---|
| 77 | OrxListener* frameListener_; |
---|
| 78 | Ogre::Root* root_; |
---|
| 79 | |
---|
| 80 | // this is used to identify the mode (server/client/...) we're in |
---|
| 81 | gameMode mode_; |
---|
[715] | 82 | std::string serverIp_; |
---|
[612] | 83 | }; |
---|
| 84 | } |
---|
[673] | 85 | #endif /* _Orxonox_H__ */ |
---|