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 <OgrePrerequisites.h> |
---|
11 | #include <OIS/OISPrereqs.h> |
---|
12 | |
---|
13 | #include "OrxonoxPrereqs.h" |
---|
14 | #include "GraphicsEngine.h" |
---|
15 | |
---|
16 | |
---|
17 | // TODO: Orxonox should maybe derive from BaseObject |
---|
18 | //! Orxonox singleton class |
---|
19 | namespace orxonox { |
---|
20 | |
---|
21 | enum gameMode{ |
---|
22 | STANDALONE, |
---|
23 | SERVER, |
---|
24 | CLIENT, |
---|
25 | PRESENTATION |
---|
26 | }; |
---|
27 | |
---|
28 | class OrxListener; |
---|
29 | |
---|
30 | class Orxonox |
---|
31 | { |
---|
32 | public: |
---|
33 | void init(int argc, char **argv, std::string path); |
---|
34 | void start(); |
---|
35 | // not sure if this should be private |
---|
36 | void die(/* some error code */); |
---|
37 | static Orxonox* getSingleton(); |
---|
38 | inline Ogre::SceneManager* getSceneManager() { return ogre_->getSceneManager(); }; |
---|
39 | inline GraphicsEngine* getOgrePointer() { return ogre_; }; |
---|
40 | inline audio::AudioManager* getAudioManagerPointer() { return auMan_; }; |
---|
41 | inline OIS::Keyboard* getKeyboard() { return this->keyboard_; } |
---|
42 | inline OIS::Mouse* getMouse() { return this->mouse_; } |
---|
43 | inline BulletManager* getBulletMgr() { return this->bulletMgr_; } |
---|
44 | |
---|
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 | |
---|
65 | private: |
---|
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 | BulletManager* bulletMgr_; //!< Keeps track of the thrown bullets |
---|
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 | std::string serverIp_; |
---|
81 | }; |
---|
82 | } |
---|
83 | #endif /* ORXONOX_H */ |
---|