Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 633 was 612, checked in by rgrieder, 17 years ago
  • restored filename consistency for src/orxonox
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 "OrxonoxPrereqs.h"
14#include "GraphicsEngine.h"
15
16
17// TODO: Orxonox should maybe derive from BaseObject
18//! Orxonox singleton class
19namespace orxonox {
20
21  enum gameMode{
22    STANDALONE,
23    SERVER,
24    CLIENT,
25    PRESENTATION
26  };
27
28  class OrxListener;
29
30  class Orxonox
31  {
32    public:
33      void init(int argc, char **argv, std::string path);
34      void start();
35      // not sure if this should be private
36      void die(/* some error code */);
37      static Orxonox* getSingleton();
38      inline Ogre::SceneManager* getSceneManager() { return ogre_->getSceneManager(); };
39      inline GraphicsEngine* getOgrePointer() { return ogre_; };
40      inline audio::AudioManager* getAudioManagerPointer() { return auMan_; };
41      inline OIS::Keyboard* getKeyboard() { return this->keyboard_; }
42      inline OIS::Mouse* getMouse() { return this->mouse_; }
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      static Orxonox*       singletonRef_;
70      OIS::Keyboard*        keyboard_;
71      OIS::Mouse*           mouse_;
72      OIS::InputManager*    inputManager_;
73      OrxListener*          frameListener_;
74      Ogre::Root*           root_;
75
76      // this is used to identify the mode (server/client/...) we're in
77      gameMode              mode_;
78      std::string           serverIp_;
79  };
80}
81#endif /* ORXONOX_H */
Note: See TracBrowser for help on using the repository browser.