Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/orxonox/Orxonox.h @ 1023

Last change on this file since 1023 was 1021, checked in by bknecht, 18 years ago

merged back that script-branch

File size: 2.8 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>
[1021]13//#include <OIS/OISPrereqs.h>
[612]14
15#include "OrxonoxPrereqs.h"
[777]16#include "audio/AudioPrereqs.h"
[729]17
[612]18#include "GraphicsEngine.h"
[1021]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,
[1021]29    STANDALONE
[612]30  };
31
[1021]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
[1021]38      void abortImmediate(/* some error code */);
39      void abortRequest();
40      inline Ogre::SceneManager*  getSceneManager()        { return ogre_->getSceneManager(); };
41      inline GraphicsEngine*      getOgrePointer()         { return ogre_; };
42      inline audio::AudioManager* getAudioManagerPointer() { return auMan_; };
43      inline BulletManager*       getBulletMgr()           { return this->bulletMgr_; }
44
[612]45      static Orxonox* getSingleton();
[1021]46      static void destroy();
[612]47
[1021]48   private:
49      // don't mess with singletons
[612]50      Orxonox();
[1021]51      Orxonox(Orxonox& instance);
52      Orxonox& operator=(const Orxonox& instance);
53      ~Orxonox();
54
[612]55      // init functions
[715]56      void serverInit(std::string path);
57      void clientInit(std::string path);
58      void standaloneInit(std::string path);
[1021]59
[612]60      // run functions
[1021]61      void serverStart();
62      void clientStart();
63      void standaloneStart();
64
65      void createScene();
[612]66      void setupInputSystem();
[1021]67      void startRenderLoop();
68      float calculateEventTime(unsigned long, std::deque<unsigned long>&);
69
70      void eventOccured(InputEvent &evt);
[612]71
72    private:
[717]73      GraphicsEngine*       ogre_;          //!< our dearest graphics engine <3
74      std::string           dataPath_;      //!< path to data
75      audio::AudioManager*  auMan_;         //!< audio manager
76      BulletManager*        bulletMgr_;     //!< Keeps track of the thrown bullets
[1021]77      InputHandler*         inputHandler_;  //!< Handles input with key bindings
78      Ogre::Root*           root_;          //!< Holy grail of Ogre
79      Ogre::Timer*          timer_;         //!< Main loop timer
80      // TODO: make this a config-value by creating a config class for orxonox
81      float                 frameSmoothingTime_;
82      // little hack to actually show something dynamic in the HUD
83      HUD*                  orxonoxHUD_;
84      bool                  bAbort_;        //!< aborts the render loop if true
[612]85
86      // this is used to identify the mode (server/client/...) we're in
87      gameMode              mode_;
[715]88      std::string           serverIp_;
[1021]89
90      static Orxonox *singletonRef_s;
[612]91  };
92}
[673]93#endif /* _Orxonox_H__ */
Note: See TracBrowser for help on using the repository browser.