Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 918 was 918, checked in by rgrieder, 16 years ago
  • created basic construct for the InputHandler (mere copy of InputManager but without the Listeners)
  • some msvc related fixes with winsocks.h and winsocks2.h
  • fix in Tickable.h (due to lazy displacement to new folder)
File size: 3.0 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#include <deque>
12
13#include <OgrePrerequisites.h>
14#include <OIS/OISPrereqs.h>
15
16#include "OrxonoxPrereqs.h"
17#include "audio/AudioPrereqs.h"
18
19#include "GraphicsEngine.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
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 OIS::Keyboard* getKeyboard()                  { return this->keyboard_; }
45      inline OIS::Mouse* getMouse()                        { return this->mouse_; }
46      inline BulletManager* getBulletMgr()                 { return this->bulletMgr_; }
47
48    private:
49      Orxonox();
50      virtual ~Orxonox();
51      // init functions
52      void serverInit(std::string path);
53      void clientInit(std::string path);
54      void standaloneInit(std::string path);
55      // run functions
56      void serverStart();
57      void clientStart();
58      void standaloneStart();
59      void defineResources();
60      void setupRenderSystem();
61      void createRenderWindow();
62      void initializeResourceGroups();
63      void createScene(void);
64      void setupScene();
65      void setupInputSystem();
66      void createFrameListener();
67      void startRenderLoop();
68      void mainLoop();
69      void updateTimers(float);
70      float calculateEventTime(unsigned long, std::deque<unsigned long>&);
71
72    private:
73      GraphicsEngine*       ogre_;          //!< our dearest graphics engine <3
74      std::string           dataPath_;      //!< path to data
75//      loader::LevelLoader*  loader_;        //!< level loader builds the scene
76      audio::AudioManager*  auMan_;         //!< audio manager
77      BulletManager*        bulletMgr_;     //!< Keeps track of the thrown bullets
78      static Orxonox*       singletonRef_;
79      OIS::Keyboard*        keyboard_;
80      OIS::Mouse*           mouse_;
81      OIS::InputManager*    inputManager_;
82      OrxListener*          frameListener_;
83      Ogre::Root*           root_;
84      // TODO: make this a config-value by creating a config class for orxonox
85      float                 frameSmoothingTime_;
86      // little hack to actually show something dynamic in the HUD
87      HUD*                  orxonoxHUD_;
88      bool                  bAbort_;
89
90      // this is used to identify the mode (server/client/...) we're in
91      gameMode              mode_;
92      std::string           serverIp_;
93  };
94}
95#endif /* _Orxonox_H__ */
Note: See TracBrowser for help on using the repository browser.