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 | inline audio::AudioManager* getAudioManagerPointer() { return auMan_; }; |
---|
46 | private: |
---|
47 | Orxonox(); |
---|
48 | virtual ~Orxonox(); |
---|
49 | // init functions |
---|
50 | void serverInit(std::string path); |
---|
51 | void clientInit(std::string path); |
---|
52 | void standaloneInit(std::string path); |
---|
53 | // run functions |
---|
54 | void playableServer(std::string path); |
---|
55 | void standalone(); |
---|
56 | void defineResources(); |
---|
57 | void setupRenderSystem(); |
---|
58 | void createRenderWindow(); |
---|
59 | void initializeResourceGroups(); |
---|
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 |
---|
71 | SpaceshipSteering* steering_; |
---|
72 | static Orxonox* singletonRef_; |
---|
73 | OIS::Keyboard* keyboard_; |
---|
74 | OIS::Mouse* mouse_; |
---|
75 | OIS::InputManager* inputManager_; |
---|
76 | OrxListener* frameListener_; |
---|
77 | Ogre::Root* root_; |
---|
78 | |
---|
79 | // this is used to identify the mode (server/client/...) we're in |
---|
80 | gameMode mode_; |
---|
81 | }; |
---|
82 | } |
---|
83 | #endif /* ORXONOX_H */ |
---|