Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 12, 2008, 4:08:29 PM (16 years ago)
Author:
rgrieder
Message:
  • singletonized GraphicsEngine —> Orxonox.h has to included only twice —> better compile performance —> Everything graphic related can now be accessed with GraphicsEngine::getSingleton()
  • asylumized Fighter (SpaceShip with weapon system integrated)
  • removed weapon system from build
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/GraphicsEngine.h

    r1024 r1032  
    1212#include <OgrePrerequisites.h>
    1313#include <OgreLog.h>
    14 #include <OgreRoot.h>
    15 #include <OgreSceneManager.h>
    1614
    1715#include "OrxonoxPrereqs.h"
     
    2119namespace orxonox {
    2220
    23 /**
    24    * graphics engine manager class
    25  */
     21  /**
     22    @brief Graphics engine manager class
     23  */
    2624  class _OrxonoxExport GraphicsEngine : public OrxonoxClass, public Ogre::LogListener
    2725  {
     26    friend class ClassIdentifier<GraphicsEngine>;
    2827    public:
    29       GraphicsEngine();
    3028      void setConfigPath(std::string path) { this->configPath_ = path; };
    31       // find a better way for this
    32       //inline Ogre::Root* getRoot() { return root_; };
    3329      void setConfigValues();
    3430      void setup();
     
    3733      Ogre::SceneManager* getSceneManager();
    3834      void initialise();
     35      void destroy();
    3936
    4037      // several window properties
     
    4441      int getWindowHeight() const;
    4542
    46       // Ogre Root access for Orxonox
    47       void frameStarted(Ogre::FrameEvent &evt)
    48       { if (root_) root_->_fireFrameStarted(evt); }
    49       void frameEnded  (Ogre::FrameEvent &evt)
    50       { if (root_) root_->_fireFrameEnded(evt);   }
    51       void renderOneFrame()
    52       { if (root_) root_->_updateAllRenderTargets(); }
    53 
    54       virtual ~GraphicsEngine();
     43      static GraphicsEngine& getSingleton();
    5544
    5645    private:
     46      // don't mess with singletons
     47      GraphicsEngine();
     48      GraphicsEngine(GraphicsEngine&) { }
     49      ~GraphicsEngine();
     50
    5751      //! Method called by the LogListener from Ogre
    58       void messageLogged(const std::string& message, Ogre::LogMessageLevel lml,
    59                          bool maskDebug, const std::string &logName);
     52      void messageLogged(const std::string&, Ogre::LogMessageLevel,
     53                         bool, const std::string&);
    6054
    6155      Ogre::Root*         root_;        //!< Ogre's root
    62       std::string         configPath_;  //!< path to config file
    63       std::string         dataPath_;    //!< path to data file
    6456      Ogre::SceneManager* scene_;       //!< scene manager of the game
    6557      Ogre::RenderWindow* renderWindow_;//!< the current render window
    6658      //bool               bOverwritePath_; //!< overwrites path
     59      std::string         configPath_;  //!< path to config file
     60      std::string         dataPath_;    //!< path to data file
    6761      std::string         ogreLogfile_; //!< log file name for Ogre log messages
    6862      int ogreLogLevelTrivial_;         //!< Corresponding Orxonx debug level for LL_TRIVIAL
Note: See TracChangeset for help on using the changeset viewer.