Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FICN/src/orxonox/Orxonox.h @ 708

Last change on this file since 708 was 708, checked in by rgrieder, 16 years ago
  • added Vector2, Vector3, Matrix3, ColourValue, Quaternion and String to the misc folder as header files (each of them contains #include <string> … typedef std::string String , etc.)
  • please use String from now on by including <misc/String.h"
  • removed #include <OgreVector3.h", etc. from "CoreIncludes.h" (adjusted all source files)
  • adjusted all the source files (except network, that keeps <string> for the moment) (what a mess..)
  • moved usleep hack to misc/Sleep.h
  • relative include paths for files from other root directories (like misc, network, etc.) (but it stills writes "../Orxonox.h" when in folder orxonox/objects)
  • "OgreSceneManager.h" —> <OgreSceneManager.h>
  • included OrxonoxPrereqs in every file in folder orxonox
  • moved HUD and ParticleInterface to namespace orxonox
  • removed some using namespace Ogre/std when appropriate
  • I hope I haven't forgotten important points..
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 <OgrePrerequisites.h>
11#include <OIS/OISPrereqs.h>
12
13#include "OrxonoxPrereqs.h"
14#include "loader/LoaderPrereqs.h"
15
16#include "misc/String.h"
17#include "GraphicsEngine.h"
18
19
20// TODO: Orxonox should maybe derive from BaseObject
21//! Orxonox singleton class
22namespace orxonox {
23
24  enum gameMode{
25    STANDALONE,
26    SERVER,
27    CLIENT,
28    PRESENTATION
29  };
30
31  class Orxonox
32  {
33    public:
34      void init(int argc, char **argv, String path);
35      void start();
36      // not sure if this should be private
37      void die(/* some error code */);
38      static Orxonox* getSingleton();
39      inline Ogre::SceneManager* getSceneManager()         { return ogre_->getSceneManager(); };
40      inline GraphicsEngine* getOgrePointer()              { return ogre_; };
41      inline audio::AudioManager* getAudioManagerPointer() { return auMan_; };
42      inline OIS::Keyboard* getKeyboard()                  { return this->keyboard_; }
43      inline OIS::Mouse* getMouse()                        { return this->mouse_; }
44      inline BulletManager* getBulletMgr()                 { return this->bulletMgr_; }
45
46    private:
47      Orxonox();
48      virtual ~Orxonox();
49      // init functions
50      void serverInit(String path);
51      void clientInit(String path);
52      void standaloneInit(String path);
53      // run functions
54      void playableServer(String path);
55      void standalone();
56      void defineResources();
57      void setupRenderSystem();
58      void createRenderWindow();
59      void initializeResourceGroups();
60      void createScene(void);
61      void setupScene();
62      void setupInputSystem();
63      void createFrameListener();
64      void startRenderLoop();
65
66    private:
67      GraphicsEngine*       ogre_;      //!< our dearest graphics engine <3
68      String           dataPath_;  //!< path to data
69      loader::LevelLoader*  loader_;    //!< level loader builds the scene
70      audio::AudioManager*  auMan_;     //!< audio manager
71      BulletManager*        bulletMgr_; //!< Keeps track of the thrown bullets
72      static Orxonox*       singletonRef_;
73      OIS::Keyboard*        keyboard_;
74      OIS::Mouse*           mouse_;
75      OIS::InputManager*    inputManager_;
76      OrxListener*          frameListener_;
77      Ogre::Root*           root_;
78
79      // this is used to identify the mode (server/client/...) we're in
80      gameMode              mode_;
81      String           serverIp_;
82  };
83}
84#endif /* _Orxonox_H__ */
Note: See TracBrowser for help on using the repository browser.