Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 682 was 682, checked in by rgrieder, 16 years ago
  • adapted the core to be an actual windows dll (only tested with MSVC)
  • misc header files dependency changes
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#include "GraphicsEngine.h"
16
17
18// TODO: Orxonox should maybe derive from BaseObject
19//! Orxonox singleton class
20namespace orxonox {
21
22  enum gameMode{
23    STANDALONE,
24    SERVER,
25    CLIENT,
26    PRESENTATION
27  };
28
29  class Orxonox
30  {
31    public:
32      void init(int argc, char **argv, std::string path);
33      void start();
34      // not sure if this should be private
35      void die(/* some error code */);
36      static Orxonox* getSingleton();
37      inline Ogre::SceneManager* getSceneManager()         { return ogre_->getSceneManager(); };
38      inline GraphicsEngine* getOgrePointer()              { return ogre_; };
39      inline audio::AudioManager* getAudioManagerPointer() { return auMan_; };
40      inline OIS::Keyboard* getKeyboard()                  { return this->keyboard_; }
41      inline OIS::Mouse* getMouse()                        { return this->mouse_; }
42      inline BulletManager* getBulletMgr()                 { return this->bulletMgr_; }
43
44    private:
45      Orxonox();
46      virtual ~Orxonox();
47      // init functions
48      void serverInit(std::string path);
49      void clientInit(std::string path);
50      void standaloneInit(std::string path);
51      // run functions
52      void playableServer(std::string path);
53      void standalone();
54      void defineResources();
55      void setupRenderSystem();
56      void createRenderWindow();
57      void initializeResourceGroups();
58      void createScene(void);
59      void setupScene();
60      void setupInputSystem();
61      void createFrameListener();
62      void startRenderLoop();
63
64    private:
65      GraphicsEngine*       ogre_;      //!< our dearest graphics engine <3
66      std::string           dataPath_;  //!< path to data
67      loader::LevelLoader*  loader_;    //!< level loader builds the scene
68      audio::AudioManager*  auMan_;     //!< audio manager
69      BulletManager*        bulletMgr_; //!< Keeps track of the thrown bullets
70      static Orxonox*       singletonRef_;
71      OIS::Keyboard*        keyboard_;
72      OIS::Mouse*           mouse_;
73      OIS::InputManager*    inputManager_;
74      OrxListener*          frameListener_;
75      Ogre::Root*           root_;
76
77      // this is used to identify the mode (server/client/...) we're in
78      gameMode              mode_;
79      std::string           serverIp_;
80  };
81}
82#endif /* _Orxonox_H__ */
Note: See TracBrowser for help on using the repository browser.