Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 927 was 926, checked in by rgrieder, 17 years ago
File size: 2.5 KB
RevLine 
[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>
[926]13//#include <OIS/OISPrereqs.h>
[612]14
15#include "OrxonoxPrereqs.h"
[777]16#include "audio/AudioPrereqs.h"
[729]17
[612]18#include "GraphicsEngine.h"
[922]19#include "InputEventListener.h"
[612]20
21
22// TODO: Orxonox should maybe derive from BaseObject
23//! Orxonox singleton class
24namespace orxonox {
25
26  enum gameMode{
27    SERVER,
28    CLIENT,
[888]29    STANDALONE
[612]30  };
31
[922]32  class _OrxonoxExport Orxonox : public InputEventListener
[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 */);
[917]39      void abortRequest();
[612]40      static Orxonox* getSingleton();
[637]41      inline Ogre::SceneManager* getSceneManager()         { return ogre_->getSceneManager(); };
42      inline GraphicsEngine* getOgrePointer()              { return ogre_; };
[888]43      inline audio::AudioManager* getAudioManagerPointer() { return auMan_; };
44      inline BulletManager* getBulletMgr()                 { return this->bulletMgr_; }
[612]45
46    private:
47      Orxonox();
48      virtual ~Orxonox();
49      // init functions
[715]50      void serverInit(std::string path);
51      void clientInit(std::string path);
52      void standaloneInit(std::string path);
[612]53      // run functions
[888]54      void serverStart();
55      void clientStart();
56      void standaloneStart();
[926]57
[612]58      void createScene(void);
59      void setupInputSystem();
[888]60      void startRenderLoop();
[917]61      float calculateEventTime(unsigned long, std::deque<unsigned long>&);
[922]62
63      void eventOccured(InputEvent &evt);
[612]64
65    private:
[717]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
[919]70      InputHandler*         inputHandler_;
[612]71      Ogre::Root*           root_;
[917]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_;
[926]76      bool                  bAbort_;        //!< aborts the render loop if true
[612]77
78      // this is used to identify the mode (server/client/...) we're in
79      gameMode              mode_;
[715]80      std::string           serverIp_;
[612]81  };
82}
[673]83#endif /* _Orxonox_H__ */
Note: See TracBrowser for help on using the repository browser.