Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FICN/src/orxonox/orxonox.h @ 609

Last change on this file since 609 was 609, checked in by rgrieder, 16 years ago
  • removed all the "using namespace Ogre" in the header files
  • cleaned up the orxonox.cc header a little bit (every Ogre class referenced is now included via header file)
File size: 2.4 KB
Line 
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 <OgreSceneManager.h>
12#include <OIS/OIS.h>
13
14#include "graphicsEngine.h"
15#include "../loader/LevelLoader.h"
16#include "../audio/AudioManager.h"
17#include "spaceship_steering.h"
18
19
20// TODO: Orxonox should maybe derive from BaseObject
21//! Orxonox singleton class
22namespace orxonox {
23
24  enum gameMode{
25    STANDALONE,
26    SERVER,
27    CLIENT,
28    PRESENTATION
29  };
30
31  class OrxListener;
32
33  class Orxonox
34  {
35    public:
36      void init(int argc, char **argv, std::string path);
37      void start();
38      // not sure if this should be private
39      void die(/* some error code */);
40      static Orxonox* getSingleton();
41      inline Ogre::SceneManager* getSceneManager() { return ogre_->getSceneManager(); };
42      inline GraphicsEngine* getOgrePointer() { return ogre_; };
43      inline audio::AudioManager* getAudioManagerPointer() { return auMan_; };
44      inline OIS::Keyboard* getKeyboard() { return this->keyboard_; }
45      inline OIS::Mouse* getMouse() { return this->mouse_; }
46
47    private:
48      Orxonox();
49      virtual ~Orxonox();
50      // init functions
51      void serverInit(std::string path);
52      void clientInit(std::string path);
53      void standaloneInit(std::string path);
54      // run functions
55      void playableServer(std::string path);
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:
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      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      std::string           serverIp_;
82  };
83}
84#endif /* ORXONOX_H */
Note: See TracBrowser for help on using the repository browser.