Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 608 was 608, checked in by landauf, 18 years ago

added SpaceShip class

File size: 2.4 KB
RevLine 
[462]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 <OgreSingleton.h>
11#include <OgreSceneManager.h>
12#include <OIS/OIS.h>
13
14#include "graphicsEngine.h"
15#include "../loader/LevelLoader.h"
16#include "../audio/AudioManager.h"
[515]17#include "spaceship_steering.h"
[462]18
19
20// TODO: Orxonox should maybe derive from BaseObject
21//! Orxonox singleton class
22namespace orxonox {
23
[568]24  enum gameMode{
25    STANDALONE,
26    SERVER,
27    CLIENT,
28    PRESENTATION
29  };
[608]30
[462]31  class OrxListener;
32
33  class Orxonox
34  {
35    public:
36      void init(int argc, char **argv, std::string path);
37      void start();
38      // not sure if this should be private
39      void die(/* some error code */);
40      static Orxonox* getSingleton();
41      inline SceneManager* getSceneManager() { return ogre_->getSceneManager(); };
[515]42      inline GraphicsEngine* getOgrePointer() { return ogre_; };
[608]43      inline audio::AudioManager* getAudioManagerPointer() { return auMan_; };
44      inline OIS::Keyboard* getKeyboard() { return this->keyboard_; }
45      inline OIS::Mouse* getMouse() { return this->mouse_; }
46
[462]47    private:
48      Orxonox();
49      virtual ~Orxonox();
[568]50      // init functions
[462]51      void serverInit(std::string path);
52      void clientInit(std::string path);
[568]53      void standaloneInit(std::string path);
54      // run functions
[531]55      void playableServer(std::string path);
[568]56      void standalone();
[473]57      void defineResources();
58      void setupRenderSystem();
59      void createRenderWindow();
60      void initializeResourceGroups();
[462]61      void createScene(void);
62      void setupScene();
63      void setupInputSystem();
64      void createFrameListener();
[608]65      void startRenderLoop();
66
[462]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      static Orxonox*       singletonRef_;
73      OIS::Keyboard*        keyboard_;
74      OIS::Mouse*           mouse_;
75      OIS::InputManager*    inputManager_;
76      OrxListener*          frameListener_;
[473]77      Ogre::Root*           root_;
[608]78
[568]79      // this is used to identify the mode (server/client/...) we're in
80      gameMode              mode_;
[599]81      std::string           serverIp_;
[462]82  };
83}
84#endif /* ORXONOX_H */
Note: See TracBrowser for help on using the repository browser.