[1035] | 1 | /* |
---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
| 3 | * |
---|
| 4 | * |
---|
| 5 | * License notice: |
---|
| 6 | * |
---|
| 7 | * This program is free software; you can redistribute it and/or |
---|
| 8 | * modify it under the terms of the GNU General Public License |
---|
| 9 | * as published by the Free Software Foundation; either version 2 |
---|
| 10 | * of the License, or (at your option) any later version. |
---|
| 11 | * |
---|
| 12 | * This program is distributed in the hope that it will be useful, |
---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 15 | * GNU General Public License for more details. |
---|
| 16 | * |
---|
| 17 | * You should have received a copy of the GNU General Public License |
---|
| 18 | * along with this program; if not, write to the Free Software |
---|
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
| 20 | * |
---|
| 21 | * Author: |
---|
| 22 | * Benjamin Knecht <beni_at_orxonox.net>, (C) 2007 |
---|
| 23 | * Co-authors: |
---|
| 24 | * Reto Grieder |
---|
| 25 | * |
---|
| 26 | */ |
---|
| 27 | |
---|
[612] | 28 | /** |
---|
[1035] | 29 | @file |
---|
| 30 | @brief Declaration of GraphicsEngine Singleton. |
---|
[612] | 31 | @author Benjamin Knecht <beni_at_orxonox.net> |
---|
| 32 | */ |
---|
| 33 | |
---|
[673] | 34 | #ifndef _GraphicsEngine_H__ |
---|
| 35 | #define _GraphicsEngine_H__ |
---|
[612] | 36 | |
---|
[715] | 37 | #include <string> |
---|
| 38 | |
---|
[1021] | 39 | #include <OgrePrerequisites.h> |
---|
[1024] | 40 | #include <OgreLog.h> |
---|
[612] | 41 | |
---|
[729] | 42 | #include "OrxonoxPrereqs.h" |
---|
[1021] | 43 | #include "core/OrxonoxClass.h" |
---|
[612] | 44 | |
---|
[729] | 45 | |
---|
[612] | 46 | namespace orxonox { |
---|
| 47 | |
---|
[1032] | 48 | /** |
---|
| 49 | @brief Graphics engine manager class |
---|
| 50 | */ |
---|
[1024] | 51 | class _OrxonoxExport GraphicsEngine : public OrxonoxClass, public Ogre::LogListener |
---|
[1021] | 52 | { |
---|
[1032] | 53 | friend class ClassIdentifier<GraphicsEngine>; |
---|
[612] | 54 | public: |
---|
[1024] | 55 | void setConfigPath(std::string path) { this->configPath_ = path; }; |
---|
[1021] | 56 | void setConfigValues(); |
---|
[612] | 57 | void setup(); |
---|
[1021] | 58 | bool load(std::string path); |
---|
[715] | 59 | void loadRessourceLocations(std::string path); |
---|
[612] | 60 | Ogre::SceneManager* getSceneManager(); |
---|
[1021] | 61 | void initialise(); |
---|
[1032] | 62 | void destroy(); |
---|
[612] | 63 | |
---|
[1021] | 64 | // several window properties |
---|
| 65 | Ogre::RenderWindow* getRenderWindow() { return this->renderWindow_; } |
---|
| 66 | size_t getWindowHandle(); |
---|
| 67 | int getWindowWidth() const; |
---|
| 68 | int getWindowHeight() const; |
---|
| 69 | |
---|
[1032] | 70 | static GraphicsEngine& getSingleton(); |
---|
[1035] | 71 | static GraphicsEngine* getSingletonPtr() { return &getSingleton(); } |
---|
[1021] | 72 | |
---|
[1032] | 73 | private: |
---|
| 74 | // don't mess with singletons |
---|
| 75 | GraphicsEngine(); |
---|
[1035] | 76 | ~GraphicsEngine(); |
---|
[1032] | 77 | GraphicsEngine(GraphicsEngine&) { } |
---|
[1021] | 78 | |
---|
[1024] | 79 | //! Method called by the LogListener from Ogre |
---|
[1032] | 80 | void messageLogged(const std::string&, Ogre::LogMessageLevel, |
---|
| 81 | bool, const std::string&); |
---|
[1024] | 82 | |
---|
[612] | 83 | Ogre::Root* root_; //!< Ogre's root |
---|
| 84 | Ogre::SceneManager* scene_; //!< scene manager of the game |
---|
[1021] | 85 | Ogre::RenderWindow* renderWindow_;//!< the current render window |
---|
| 86 | //bool bOverwritePath_; //!< overwrites path |
---|
[1032] | 87 | std::string configPath_; //!< path to config file |
---|
| 88 | std::string dataPath_; //!< path to data file |
---|
[1024] | 89 | std::string ogreLogfile_; //!< log file name for Ogre log messages |
---|
| 90 | int ogreLogLevelTrivial_; //!< Corresponding Orxonx debug level for LL_TRIVIAL |
---|
| 91 | int ogreLogLevelNormal_; //!< Corresponding Orxonx debug level for LL_NORMAL |
---|
| 92 | int ogreLogLevelCritical_; //!< Corresponding Orxonx debug level for LL_CRITICAL |
---|
[612] | 93 | |
---|
| 94 | }; |
---|
| 95 | |
---|
| 96 | } |
---|
| 97 | |
---|
[673] | 98 | #endif /* _GraphicsEngine_H__ */ |
---|