- Timestamp:
- Apr 8, 2009, 12:36:08 AM (16 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/gamestates/GSGraphics.h
r2756 r2907 23 23 * Reto Grieder 24 24 * Co-authors: 25 * ...25 * Benjamin Knecht (documentation) 26 26 * 27 27 */ 28 29 /** 30 @file 31 @brief Declaration of the Graphics GameState class. 32 */ 28 33 29 34 #ifndef _GSGraphics_H__ … … 31 36 32 37 #include "OrxonoxPrereqs.h" 33 #include <OgrePrerequisites.h>34 #define NOMINMAX // required to stop windows.h screwing up std::min definition35 #include <OgreWindowEventUtilities.h>36 38 #include "core/GameState.h" 37 #include "core/OrxonoxClass.h" 38 #include "GSRoot.h" 39 #include "tools/WindowEventListener.h" 39 40 40 41 namespace orxonox 41 42 { 42 class _OrxonoxExport GSGraphics : public GameState<GSRoot>, public OrxonoxClass, 43 public Ogre::WindowEventListener, public Ogre::LogListener 43 /** 44 @class GSGraphics 45 @brief 46 Game state used when displaying graphics of any kind 47 48 This game state is only left out if we start a dedicated server where no graphics are present. 49 */ 50 class _OrxonoxExport GSGraphics : public GameState, public WindowEventListener 44 51 { 45 friend class ClassIdentifier<GSGraphics>;46 47 52 public: 48 GSGraphics( );53 GSGraphics(const std::string& name); 49 54 ~GSGraphics(); 50 51 Ogre::Root* getOgreRoot() { return this->ogreRoot_ ; }52 Ogre::Viewport* getViewport() { return this->viewport_ ; }53 GUIManager* getGUIManager() { return this->guiManager_; }54 55 private: // functions56 void enter();57 void leave();58 void ticked(const Clock& time);59 60 55 void setConfigValues(); 61 56 62 void setupOgre(); 63 void loadOgrePlugins(); 64 void declareResources(); 65 void loadRenderer(); 66 void initialiseResources(); 57 void activate(); 58 void deactivate(); 59 void update(const Clock& time); 67 60 68 // console commands 69 void printScreen(); 61 void toggleGUI(); 70 62 71 // event from Ogre::LogListener 72 void messageLogged(const std::string& message, Ogre::LogMessageLevel lml, 73 bool maskDebug, const std::string& logName); 74 75 // window events from Ogre::WindowEventListener 76 void windowMoved (Ogre::RenderWindow* rw); 77 void windowResized (Ogre::RenderWindow* rw); 78 void windowFocusChange (Ogre::RenderWindow* rw); 79 void windowClosed (Ogre::RenderWindow* rw); 80 81 void requestWindowEventListenerUpdate() { this->bWindowEventListenerUpdateRequired_ = true; } 82 83 private: // variables 84 Ogre::RenderWindow* renderWindow_; //!< the current render window 85 Ogre::Viewport* viewport_; //!< default full size viewport 86 bool bWindowEventListenerUpdateRequired_; //!< True if a new WindowEventListener was created but not yet updated. 63 private: 64 // Window events from WindowEventListener 65 void windowResized(unsigned int newWidth, unsigned int newHeight); 66 void windowFocusChanged(); 87 67 88 68 // managed singletons 89 InputManager* inputManager_; 69 InputManager* inputManager_; //!< Reference to input management 90 70 InGameConsole* console_; 91 GUIManager* guiManager_; 92 Ogre::Root* ogreRoot_; //!< Ogre's root 93 Ogre::LogManager* ogreLogger_; 94 GraphicsEngine* graphicsEngine_; //!< Interface to Ogre 71 GUIManager* guiManager_; //!< Interface to GUI 72 GraphicsManager* graphicsManager_; //!< Interface to Ogre 95 73 96 KeyBinder* masterKeyBinder_; 74 KeyBinder* masterKeyBinder_; //!< Key binder for master key bindings 75 SimpleInputState* masterInputState_; //!< Special input state for master input 97 76 XMLFile* debugOverlay_; 98 99 // config values 100 std::string resourceFile_; //!< resources file name 101 std::string ogreConfigFile_; //!< ogre config file name 102 std::string ogrePluginsFolder_; //!< Folder where the Ogre plugins are located 103 std::string ogrePlugins_; //!< Comma separated list of all plugins to load 104 std::string ogreLogFile_; //!< log file name for Ogre log messages 105 int ogreLogLevelTrivial_; //!< Corresponding Orxonx debug level for LL_TRIVIAL 106 int ogreLogLevelNormal_; //!< Corresponding Orxonx debug level for LL_NORMAL 107 int ogreLogLevelCritical_; //!< Corresponding Orxonx debug level for LL_CRITICAL 108 109 // console commands 110 ConsoleCommand* ccPrintScreen_; 77 ConsoleCommand* ccToggleGUI_; //!< Console command to toggle GUI 111 78 }; 112 79 }
Note: See TracChangeset
for help on using the changeset viewer.