Changeset 2801 for code/branches/gui/src/orxonox/GraphicsManager.h
- Timestamp:
- Mar 19, 2009, 10:58:43 AM (16 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/orxonox/GraphicsManager.h
r2797 r2801 29 29 30 30 /** 31 32 @brief Declaration of GraphicsEngine Singleton. 33 @author Benjamin Knecht <beni_at_orxonox.net>31 @file 32 @brief 33 Declaration of GraphicsManager Singleton. 34 34 */ 35 35 … … 40 40 41 41 #include <string> 42 #include <cassert> 43 #include <OgreLog.h> 42 44 43 #include <OgrePrerequisites.h>44 45 #include "core/OrxonoxClass.h" 45 46 … … 47 48 { 48 49 /** 49 @brief Graphics engine manager class 50 @brief 51 Graphics engine manager class 50 52 */ 51 class _OrxonoxExport Graphics Engine : public OrxonoxClass53 class _OrxonoxExport GraphicsManager : public OrxonoxClass, public Ogre::LogListener 52 54 { 53 // HACK: temporary means54 friend class GSGraphics;55 56 55 public: 57 Graphics Engine();58 ~Graphics Engine();56 GraphicsManager(); 57 ~GraphicsManager(); 59 58 60 59 void setConfigValues(); 60 void initialise(); 61 62 void update(const Clock& time); 63 61 64 void detailLevelParticleChanged(); 65 inline unsigned int getDetailLevelParticle() const 66 { return this->detailLevelParticle_; } 62 67 68 // <HACK> 63 69 float getAverageFramesPerSecond() const { return this->avgFramesPerSecond_; } 64 70 float getAverageTickTime() const { return this->avgTickTime_; } 65 71 void setAverageTickTime(float tickTime) { this->avgTickTime_ = tickTime; } 66 72 void setAverageFramesPerSecond(float fps) { this->avgFramesPerSecond_ = fps; } 67 68 inline unsigned int getDetailLevelParticle() const 69 { return this->detailLevelParticle_; } 70 71 static GraphicsEngine& getInstance(); 72 static GraphicsEngine* getInstancePtr() { return singletonRef_s; } 73 // </HACK> 73 74 74 75 inline void setViewport(Ogre::Viewport* viewport) … … 76 77 inline Ogre::Viewport* getViewport() const 77 78 { return this->viewport_; } 79 inline Ogre::RenderWindow* getRenderWindow() 80 { return this->renderWindow_; } 81 82 static GraphicsManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; } 83 78 84 79 85 private: 80 // don't mess with singletons 81 GraphicsEngine(GraphicsEngine&); 86 GraphicsManager(GraphicsManager&); // don't mess with singletons 82 87 83 Ogre::Viewport* viewport_; //!< default full size viewport 88 // OGRE initialisation 89 void setupOgre(); 90 void loadOgrePlugins(); 91 void declareResources(); 92 void loadRenderer(); 93 void initialiseResources(); 84 94 85 // stats 86 float avgTickTime_; //!< time in ms to tick() one frame 87 float avgFramesPerSecond_; //!< number of frames processed in one second 95 // event from Ogre::LogListener 96 void messageLogged(const std::string& message, Ogre::LogMessageLevel lml, 97 bool maskDebug, const std::string& logName); 98 99 // console commands 100 void printScreen(); 101 102 private: 103 bool loaded_; 104 105 Ogre::Root* ogreRoot_; //!< Ogre's root 106 Ogre::LogManager* ogreLogger_; 107 Ogre::RenderWindow* renderWindow_; //!< the one and only render window 108 Ogre::Viewport* viewport_; //!< default full size viewport 109 OgreWindowEventListener* ogreWindowEventListener_; 110 111 // stats (Hack) 112 float avgTickTime_; //!< time in ms to tick() one frame 113 float avgFramesPerSecond_; //!< number of frames processed in one second 88 114 89 115 // config values 90 unsigned int detailLevelParticle_; //!< Detail level of particle effects (0: off, 1: low, 2: normal, 3: high) 116 unsigned int detailLevelParticle_; //!< Detail level of particle effects (0: off, 1: low, 2: normal, 3: high) 117 std::string resourceFile_; //!< resources file name 118 std::string ogreConfigFile_; //!< ogre config file name 119 std::string ogrePluginsFolder_; //!< Folder where the Ogre plugins are located 120 std::string ogrePlugins_; //!< Comma separated list of all plugins to load 121 std::string ogreLogFile_; //!< log file name for Ogre log messages 122 int ogreLogLevelTrivial_; //!< Corresponding Orxonx debug level for LL_TRIVIAL 123 int ogreLogLevelNormal_; //!< Corresponding Orxonx debug level for LL_NORMAL 124 int ogreLogLevelCritical_; //!< Corresponding Orxonx debug level for LL_CRITICAL 91 125 92 static GraphicsEngine* singletonRef_s; //!< Pointer to the Singleton 126 // console commands 127 ConsoleCommand* ccPrintScreen_; 128 129 static GraphicsManager* singletonRef_s; //!< Pointer to the Singleton 93 130 }; 94 131 }
Note: See TracChangeset
for help on using the changeset viewer.