Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/network/src/orxonox/Orxonox.h @ 926

Last change on this file since 926 was 926, checked in by rgrieder, 16 years ago
File size: 2.5 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 <string>
11
12#include <OgrePrerequisites.h>
13//#include <OIS/OISPrereqs.h>
14
15#include "OrxonoxPrereqs.h"
16#include "audio/AudioPrereqs.h"
17
18#include "GraphicsEngine.h"
19#include "InputEventListener.h"
20
21
22// TODO: Orxonox should maybe derive from BaseObject
23//! Orxonox singleton class
24namespace orxonox {
25
26  enum gameMode{
27    SERVER,
28    CLIENT,
29    STANDALONE
30  };
31
32  class _OrxonoxExport Orxonox : public InputEventListener
33  {
34    public:
35      void init(int argc, char **argv, std::string path);
36      void start();
37      // not sure if this should be private
38      void die(/* some error code */);
39      void abortRequest();
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 BulletManager* getBulletMgr()                 { return this->bulletMgr_; }
45
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 serverStart();
55      void clientStart();
56      void standaloneStart();
57
58      void createScene(void);
59      void setupInputSystem();
60      void startRenderLoop();
61      float calculateEventTime(unsigned long, std::deque<unsigned long>&);
62
63      void eventOccured(InputEvent &evt);
64
65    private:
66      GraphicsEngine*       ogre_;          //!< our dearest graphics engine <3
67      std::string           dataPath_;      //!< path to data
68      audio::AudioManager*  auMan_;         //!< audio manager
69      BulletManager*        bulletMgr_;     //!< Keeps track of the thrown bullets
70      InputHandler*         inputHandler_;
71      Ogre::Root*           root_;
72      // TODO: make this a config-value by creating a config class for orxonox
73      float                 frameSmoothingTime_;
74      // little hack to actually show something dynamic in the HUD
75      HUD*                  orxonoxHUD_;
76      bool                  bAbort_;        //!< aborts the render loop if true
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__ */
Note: See TracBrowser for help on using the repository browser.