Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/orxonox/GraphicsEngine.h @ 1035

Last change on this file since 1035 was 1035, checked in by rgrieder, 16 years ago
  • minor Singleton changes
File size: 3.2 KB
Line 
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
28/**
29  @file
30  @brief Declaration of GraphicsEngine Singleton.
31  @author Benjamin Knecht <beni_at_orxonox.net>
32 */
33
34#ifndef _GraphicsEngine_H__
35#define _GraphicsEngine_H__
36
37#include <string>
38
39#include <OgrePrerequisites.h>
40#include <OgreLog.h>
41
42#include "OrxonoxPrereqs.h"
43#include "core/OrxonoxClass.h"
44
45
46namespace orxonox {
47
48  /**
49    @brief Graphics engine manager class
50  */
51  class _OrxonoxExport GraphicsEngine : public OrxonoxClass, public Ogre::LogListener
52  {
53    friend class ClassIdentifier<GraphicsEngine>;
54    public:
55      void setConfigPath(std::string path) { this->configPath_ = path; };
56      void setConfigValues();
57      void setup();
58      bool load(std::string path);
59      void loadRessourceLocations(std::string path);
60      Ogre::SceneManager* getSceneManager();
61      void initialise();
62      void destroy();
63
64      // several window properties
65      Ogre::RenderWindow* getRenderWindow() { return this->renderWindow_; }
66      size_t getWindowHandle();
67      int getWindowWidth() const;
68      int getWindowHeight() const;
69
70      static GraphicsEngine& getSingleton();
71      static GraphicsEngine* getSingletonPtr() { return &getSingleton(); }
72
73    private:
74      // don't mess with singletons
75      GraphicsEngine();
76      ~GraphicsEngine();
77      GraphicsEngine(GraphicsEngine&) { }
78
79      //! Method called by the LogListener from Ogre
80      void messageLogged(const std::string&, Ogre::LogMessageLevel,
81                         bool, const std::string&);
82
83      Ogre::Root*         root_;        //!< Ogre's root
84      Ogre::SceneManager* scene_;       //!< scene manager of the game
85      Ogre::RenderWindow* renderWindow_;//!< the current render window
86      //bool               bOverwritePath_; //!< overwrites path
87      std::string         configPath_;  //!< path to config file
88      std::string         dataPath_;    //!< path to data file
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
93
94  };
95
96}
97
98#endif /* _GraphicsEngine_H__ */
Note: See TracBrowser for help on using the repository browser.