| [1035] | 1 | /* | 
|---|
 | 2 |  *   ORXONOX - the hottest 3D action shooter ever to exist | 
|---|
| [1505] | 3 |  *                    > www.orxonox.net < | 
|---|
| [1035] | 4 |  * | 
|---|
 | 5 |  * | 
|---|
 | 6 |  *   License notice: | 
|---|
 | 7 |  * | 
|---|
 | 8 |  *   This program is free software; you can redistribute it and/or | 
|---|
 | 9 |  *   modify it under the terms of the GNU General Public License | 
|---|
 | 10 |  *   as published by the Free Software Foundation; either version 2 | 
|---|
 | 11 |  *   of the License, or (at your option) any later version. | 
|---|
 | 12 |  * | 
|---|
 | 13 |  *   This program is distributed in the hope that it will be useful, | 
|---|
 | 14 |  *   but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
 | 15 |  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
 | 16 |  *   GNU General Public License for more details. | 
|---|
 | 17 |  * | 
|---|
 | 18 |  *   You should have received a copy of the GNU General Public License | 
|---|
 | 19 |  *   along with this program; if not, write to the Free Software | 
|---|
 | 20 |  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. | 
|---|
 | 21 |  * | 
|---|
 | 22 |  *   Author: | 
|---|
| [1535] | 23 |  *      Reto Grieder | 
|---|
| [1641] | 24 |  *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007 | 
|---|
| [1035] | 25 |  *   Co-authors: | 
|---|
| [1641] | 26 |  *      Felix Schulthess | 
|---|
| [1035] | 27 |  * | 
|---|
 | 28 |  */ | 
|---|
 | 29 |  | 
|---|
| [612] | 30 | /** | 
|---|
| [1035] | 31 |   @file | 
|---|
 | 32 |   @brief Declaration of GraphicsEngine Singleton. | 
|---|
| [612] | 33 |   @author Benjamin Knecht <beni_at_orxonox.net> | 
|---|
 | 34 |  */ | 
|---|
 | 35 |  | 
|---|
| [673] | 36 | #ifndef _GraphicsEngine_H__ | 
|---|
 | 37 | #define _GraphicsEngine_H__ | 
|---|
| [612] | 38 |  | 
|---|
| [1039] | 39 | #include "OrxonoxPrereqs.h" | 
|---|
 | 40 |  | 
|---|
| [715] | 41 | #include <string> | 
|---|
 | 42 |  | 
|---|
| [1021] | 43 | #include <OgrePrerequisites.h> | 
|---|
 | 44 | #include "core/OrxonoxClass.h" | 
|---|
| [612] | 45 |  | 
|---|
| [1625] | 46 | namespace orxonox | 
|---|
 | 47 | { | 
|---|
| [1214] | 48 |     /** | 
|---|
| [1032] | 49 |     @brief Graphics engine manager class | 
|---|
| [1214] | 50 |     */ | 
|---|
| [1686] | 51 |     class _OrxonoxExport GraphicsEngine : public OrxonoxClass | 
|---|
| [1214] | 52 |     { | 
|---|
| [1686] | 53 |         // HACK: temporary means | 
|---|
 | 54 |         friend class GSGraphics; | 
|---|
 | 55 |  | 
|---|
| [1638] | 56 |     public: | 
|---|
 | 57 |         GraphicsEngine(); | 
|---|
 | 58 |         ~GraphicsEngine(); | 
|---|
| [1293] | 59 |  | 
|---|
| [1638] | 60 |         void setConfigValues(); | 
|---|
| [612] | 61 |  | 
|---|
| [1638] | 62 |         void setLevelSceneManager(Ogre::SceneManager* sceneMgr) { this->levelSceneManager_ = sceneMgr; } | 
|---|
 | 63 |         Ogre::SceneManager* getLevelSceneManager() { return levelSceneManager_; } | 
|---|
| [1293] | 64 |  | 
|---|
| [1640] | 65 |         Ogre::Viewport* getViewport() { return this->viewport_; } | 
|---|
| [1686] | 66 |         Ogre::Root*     getOgreRoot() { return this->root_; } | 
|---|
| [1021] | 67 |  | 
|---|
| [1638] | 68 |         // several window properties | 
|---|
 | 69 |         int getWindowWidth() const; | 
|---|
 | 70 |         int getWindowHeight() const; | 
|---|
 | 71 |         float getWindowAspectRatio() const; | 
|---|
 | 72 |         float getAverageFramesPerSecond() const   { return this->avgFramesPerSecond_; } | 
|---|
 | 73 |         float getAverageTickTime() const          { return this->avgTickTime_; } | 
|---|
 | 74 |         void setAverageTickTime(float tickTime)   { this->avgTickTime_ = tickTime; } | 
|---|
 | 75 |         void setAverageFramesPerSecond(float fps) { this->avgFramesPerSecond_ = fps; } | 
|---|
| [1625] | 76 |  | 
|---|
| [1638] | 77 |         inline unsigned int getDetailLevelParticle() const | 
|---|
 | 78 |         { return this->detailLevelParticle_; } | 
|---|
| [1563] | 79 |  | 
|---|
| [1653] | 80 |         static GraphicsEngine& getInstance(); | 
|---|
 | 81 |         static GraphicsEngine* getInstancePtr() { return singletonRef_s; } | 
|---|
 | 82 |  | 
|---|
| [1638] | 83 |     private: | 
|---|
 | 84 |         // don't mess with singletons | 
|---|
| [1686] | 85 |         GraphicsEngine(GraphicsEngine&); | 
|---|
| [1502] | 86 |  | 
|---|
| [1638] | 87 |         Ogre::Root*         root_;                  //!< Ogre's root | 
|---|
 | 88 |         Ogre::RenderWindow* renderWindow_;          //!< the current render window | 
|---|
 | 89 |         Ogre::SceneManager* levelSceneManager_;     //!< scene manager of the game | 
|---|
| [1640] | 90 |         Ogre::Viewport*     viewport_;              //!< default full size viewport | 
|---|
| [1638] | 91 |  | 
|---|
 | 92 |         // stats | 
|---|
 | 93 |         float               avgTickTime_;           //!< time in ms to tick() one frame | 
|---|
 | 94 |         float               avgFramesPerSecond_;    //!< number of frames processed in one second | 
|---|
 | 95 |  | 
|---|
 | 96 |         // config values | 
|---|
 | 97 |         unsigned int        detailLevelParticle_;   //!< Detail level of particle effects (0: off, 1: low, 2: normal, 3: high) | 
|---|
 | 98 |  | 
|---|
 | 99 |         static GraphicsEngine* singletonRef_s;      //!< Pointer to the Singleton | 
|---|
| [1214] | 100 |     }; | 
|---|
| [612] | 101 | } | 
|---|
 | 102 |  | 
|---|
| [673] | 103 | #endif /* _GraphicsEngine_H__ */ | 
|---|