1 | /** |
---|
2 | @file GraphicsEngine.h |
---|
3 | @brief Graphics Engine |
---|
4 | @author Benjamin Knecht <beni_at_orxonox.net> |
---|
5 | */ |
---|
6 | |
---|
7 | #ifndef _GraphicsEngine_H__ |
---|
8 | #define _GraphicsEngine_H__ |
---|
9 | |
---|
10 | #include <string> |
---|
11 | |
---|
12 | #include <OgrePrerequisites.h> |
---|
13 | #include <OgreLog.h> |
---|
14 | |
---|
15 | #include "OrxonoxPrereqs.h" |
---|
16 | #include "core/OrxonoxClass.h" |
---|
17 | |
---|
18 | |
---|
19 | namespace orxonox { |
---|
20 | |
---|
21 | /** |
---|
22 | @brief Graphics engine manager class |
---|
23 | */ |
---|
24 | class _OrxonoxExport GraphicsEngine : public OrxonoxClass, public Ogre::LogListener |
---|
25 | { |
---|
26 | friend class ClassIdentifier<GraphicsEngine>; |
---|
27 | public: |
---|
28 | void setConfigPath(std::string path) { this->configPath_ = path; }; |
---|
29 | void setConfigValues(); |
---|
30 | void setup(); |
---|
31 | bool load(std::string path); |
---|
32 | void loadRessourceLocations(std::string path); |
---|
33 | Ogre::SceneManager* getSceneManager(); |
---|
34 | void initialise(); |
---|
35 | void destroy(); |
---|
36 | |
---|
37 | // several window properties |
---|
38 | Ogre::RenderWindow* getRenderWindow() { return this->renderWindow_; } |
---|
39 | size_t getWindowHandle(); |
---|
40 | int getWindowWidth() const; |
---|
41 | int getWindowHeight() const; |
---|
42 | |
---|
43 | static GraphicsEngine& getSingleton(); |
---|
44 | |
---|
45 | private: |
---|
46 | // don't mess with singletons |
---|
47 | GraphicsEngine(); |
---|
48 | GraphicsEngine(GraphicsEngine&) { } |
---|
49 | ~GraphicsEngine(); |
---|
50 | |
---|
51 | //! Method called by the LogListener from Ogre |
---|
52 | void messageLogged(const std::string&, Ogre::LogMessageLevel, |
---|
53 | bool, const std::string&); |
---|
54 | |
---|
55 | Ogre::Root* root_; //!< Ogre's root |
---|
56 | Ogre::SceneManager* scene_; //!< scene manager of the game |
---|
57 | Ogre::RenderWindow* renderWindow_;//!< the current render window |
---|
58 | //bool bOverwritePath_; //!< overwrites path |
---|
59 | std::string configPath_; //!< path to config file |
---|
60 | std::string dataPath_; //!< path to data file |
---|
61 | std::string ogreLogfile_; //!< log file name for Ogre log messages |
---|
62 | int ogreLogLevelTrivial_; //!< Corresponding Orxonx debug level for LL_TRIVIAL |
---|
63 | int ogreLogLevelNormal_; //!< Corresponding Orxonx debug level for LL_NORMAL |
---|
64 | int ogreLogLevelCritical_; //!< Corresponding Orxonx debug level for LL_CRITICAL |
---|
65 | |
---|
66 | }; |
---|
67 | |
---|
68 | } |
---|
69 | |
---|
70 | #endif /* _GraphicsEngine_H__ */ |
---|