Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FICN_test/src/orxonox/Orxonox.h @ 767

Last change on this file since 767 was 729, checked in by rgrieder, 17 years ago
  • fixed multiple template instantiation problem under windows
  • removed some warnings by introducing explicit casts
File size: 2.6 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 "loader/LoaderPrereqs.h"
17
18#include "GraphicsEngine.h"
19
20
21// TODO: Orxonox should maybe derive from BaseObject
22//! Orxonox singleton class
23namespace orxonox {
24
25  enum gameMode{
26    STANDALONE,
27    SERVER,
28    CLIENT,
29    PRESENTATION
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      static Orxonox* getSingleton();
40      inline Ogre::SceneManager* getSceneManager()         { return ogre_->getSceneManager(); };
41      inline GraphicsEngine* getOgrePointer()              { return ogre_; };
42      inline audio::AudioManager* getAudioManagerPointer() { return auMan_; };
43      inline OIS::Keyboard* getKeyboard()                  { return this->keyboard_; }
44      inline OIS::Mouse* getMouse()                        { return this->mouse_; }
45      inline BulletManager* getBulletMgr()                 { return this->bulletMgr_; }
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      BulletManager*        bulletMgr_;     //!< Keeps track of the thrown bullets
73      static Orxonox*       singletonRef_;
74      OIS::Keyboard*        keyboard_;
75      OIS::Mouse*           mouse_;
76      OIS::InputManager*    inputManager_;
77      OrxListener*          frameListener_;
78      Ogre::Root*           root_;
79
80      // this is used to identify the mode (server/client/...) we're in
81      gameMode              mode_;
82      std::string           serverIp_;
83  };
84}
85#endif /* _Orxonox_H__ */
Note: See TracBrowser for help on using the repository browser.