Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FICN/src/orxonox/orxonox.h @ 610

Last change on this file since 610 was 610, checked in by rgrieder, 16 years ago
  • added OrxonoxPrereq.h, containing all forward declarations (please remove all the classes that should not be used outside)
  • cleaned up orxonox.h header inclusion part
File size: 2.3 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 "OrxonoxPrereq.h"
14
15
16// TODO: Orxonox should maybe derive from BaseObject
17//! Orxonox singleton class
18namespace orxonox {
19
20  enum gameMode{
21    STANDALONE,
22    SERVER,
23    CLIENT,
24    PRESENTATION
25  };
26
27  class OrxListener;
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
43    private:
44      Orxonox();
45      virtual ~Orxonox();
46      // init functions
47      void serverInit(std::string path);
48      void clientInit(std::string path);
49      void standaloneInit(std::string path);
50      // run functions
51      void playableServer(std::string path);
52      void standalone();
53      void defineResources();
54      void setupRenderSystem();
55      void createRenderWindow();
56      void initializeResourceGroups();
57      void createScene(void);
58      void setupScene();
59      void setupInputSystem();
60      void createFrameListener();
61      void startRenderLoop();
62
63    private:
64      GraphicsEngine*       ogre_;      //!< our dearest graphics engine <3
65      std::string           dataPath_;  //!< path to data
66      loader::LevelLoader*  loader_;    //!< level loader builds the scene
67      audio::AudioManager*  auMan_;     //!< audio manager
68      static Orxonox*       singletonRef_;
69      OIS::Keyboard*        keyboard_;
70      OIS::Mouse*           mouse_;
71      OIS::InputManager*    inputManager_;
72      OrxListener*          frameListener_;
73      Ogre::Root*           root_;
74
75      // this is used to identify the mode (server/client/...) we're in
76      gameMode              mode_;
77      std::string           serverIp_;
78  };
79}
80#endif /* ORXONOX_H */
Note: See TracBrowser for help on using the repository browser.