Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 1039 was 1039, checked in by rgrieder, 16 years ago
  • train riding doesn't have to be boring
  • added some license notes
  • removed certain header dependencies in audio
  • changed order of header file inclusion in orxonox and audio (coding style guide will be updated)
File size: 3.2 KB
RevLine 
[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
[1039]37#include "OrxonoxPrereqs.h"
38
[715]39#include <string>
40
[1021]41#include <OgrePrerequisites.h>
[1024]42#include <OgreLog.h>
[612]43
[1021]44#include "core/OrxonoxClass.h"
[612]45
[729]46
[612]47namespace orxonox {
48
[1032]49  /**
50    @brief Graphics engine manager class
51  */
[1024]52  class _OrxonoxExport GraphicsEngine : public OrxonoxClass, public Ogre::LogListener
[1021]53  {
[1032]54    friend class ClassIdentifier<GraphicsEngine>;
[612]55    public:
[1024]56      void setConfigPath(std::string path) { this->configPath_ = path; };
[1021]57      void setConfigValues();
[612]58      void setup();
[1021]59      bool load(std::string path);
[715]60      void loadRessourceLocations(std::string path);
[612]61      Ogre::SceneManager* getSceneManager();
[1021]62      void initialise();
[1032]63      void destroy();
[612]64
[1021]65      // several window properties
66      Ogre::RenderWindow* getRenderWindow() { return this->renderWindow_; }
67      size_t getWindowHandle();
68      int getWindowWidth() const;
69      int getWindowHeight() const;
70
[1032]71      static GraphicsEngine& getSingleton();
[1035]72      static GraphicsEngine* getSingletonPtr() { return &getSingleton(); }
[1021]73
[1032]74    private:
75      // don't mess with singletons
76      GraphicsEngine();
[1035]77      ~GraphicsEngine();
[1032]78      GraphicsEngine(GraphicsEngine&) { }
[1021]79
[1024]80      //! Method called by the LogListener from Ogre
[1032]81      void messageLogged(const std::string&, Ogre::LogMessageLevel,
82                         bool, const std::string&);
[1024]83
[612]84      Ogre::Root*         root_;        //!< Ogre's root
85      Ogre::SceneManager* scene_;       //!< scene manager of the game
[1021]86      Ogre::RenderWindow* renderWindow_;//!< the current render window
87      //bool               bOverwritePath_; //!< overwrites path
[1032]88      std::string         configPath_;  //!< path to config file
89      std::string         dataPath_;    //!< path to data file
[1024]90      std::string         ogreLogfile_; //!< log file name for Ogre log messages
91      int ogreLogLevelTrivial_;         //!< Corresponding Orxonx debug level for LL_TRIVIAL
92      int ogreLogLevelNormal_;          //!< Corresponding Orxonx debug level for LL_NORMAL
93      int ogreLogLevelCritical_;        //!< Corresponding Orxonx debug level for LL_CRITICAL
[612]94
95  };
96
97}
98
[673]99#endif /* _GraphicsEngine_H__ */
Note: See TracBrowser for help on using the repository browser.