Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/network/src/orxonox/GraphicsEngine.h @ 934

Last change on this file since 934 was 929, checked in by rgrieder, 16 years ago
  • removed getRoot() from GaphicsEngine —> added getRenderWindow() —> added 3 function to control render loop
  • rearranged the sequence of methods in Orxonox.cc to make it a little bit more logical
  • added deletion code in Orxonox.cc destructor
  • fixed a bug in AudioManger destructor
  • fixed a bug in InputHandler destroy()
File size: 1.8 KB
RevLine 
[612]1/**
[614]2  @file GraphicsEngine.h
[612]3  @brief Graphics Engine
4  @author Benjamin Knecht <beni_at_orxonox.net>
5 */
6
[673]7#ifndef _GraphicsEngine_H__
8#define _GraphicsEngine_H__
[612]9
[715]10#include <string>
11
[929]12#include <OgrePrerequisites.h>
[612]13#include <OgreRoot.h>
14#include <OgreSceneManager.h>
15
[729]16#include "OrxonoxPrereqs.h"
[929]17#include "core/OrxonoxClass.h"
[612]18
[729]19
[612]20namespace orxonox {
21
22/**
23   * graphics engine manager class
24 */
[929]25  class _OrxonoxExport GraphicsEngine : public OrxonoxClass
[926]26  {
[612]27    public:
28      GraphicsEngine();
[715]29      inline void setConfigPath(std::string path) { this->configPath_ = path; };
[612]30      // find a better way for this
[929]31      //inline Ogre::Root* getRoot() { return root_; };
[926]32      void setConfigValues();
[612]33      void setup();
[926]34      bool load(std::string path);
[715]35      void loadRessourceLocations(std::string path);
[612]36      Ogre::SceneManager* getSceneManager();
[929]37      void initialise();
[612]38
[919]39      // several window properties
[929]40      Ogre::RenderWindow* getRenderWindow() { return this->renderWindow_; }
[919]41      size_t getWindowHandle();
42      int getWindowWidth() const;
43      int getWindowHeight() const;
44
[929]45      // Ogre Root access for Orxonox
46      void frameStarted(Ogre::FrameEvent &evt)
47      { if (root_) root_->_fireFrameStarted(evt); }
48      void frameEnded  (Ogre::FrameEvent &evt)
49      { if (root_) root_->_fireFrameEnded(evt);   }
50      void renderOneFrame()
51      { if (root_) root_->_updateAllRenderTargets(); }
52
[612]53      virtual ~GraphicsEngine();
[929]54
[612]55    private:
56      Ogre::Root*         root_;        //!< Ogre's root
[715]57      std::string         configPath_;  //!< path to config file
58      std::string         dataPath_;    //!< path to data file
[612]59      Ogre::SceneManager* scene_;       //!< scene manager of the game
[919]60      Ogre::RenderWindow* renderWindow_;//!< the current render window
[926]61      //bool               bOverwritePath_; //!< overwrites path
[612]62
63  };
64
65}
66
[673]67#endif /* _GraphicsEngine_H__ */
Note: See TracBrowser for help on using the repository browser.