Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 8, 2009, 12:36:08 AM (16 years ago)
Author:
dafrick
Message:

Merging of the current QuestSystem branch.

Location:
code/branches/questsystem5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem5

  • code/branches/questsystem5/src/orxonox/gamestates/GSGraphics.h

    r2756 r2907  
    2323 *      Reto Grieder
    2424 *   Co-authors:
    25  *      ...
     25 *      Benjamin Knecht (documentation)
    2626 *
    2727 */
     28
     29 /**
     30    @file
     31    @brief Declaration of the Graphics GameState class.
     32  */
    2833
    2934#ifndef _GSGraphics_H__
     
    3136
    3237#include "OrxonoxPrereqs.h"
    33 #include <OgrePrerequisites.h>
    34 #define NOMINMAX // required to stop windows.h screwing up std::min definition
    35 #include <OgreWindowEventUtilities.h>
    3638#include "core/GameState.h"
    37 #include "core/OrxonoxClass.h"
    38 #include "GSRoot.h"
     39#include "tools/WindowEventListener.h"
    3940
    4041namespace orxonox
    4142{
    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
    4451    {
    45         friend class ClassIdentifier<GSGraphics>;
    46 
    4752    public:
    48         GSGraphics();
     53        GSGraphics(const std::string& name);
    4954        ~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: // functions
    56         void enter();
    57         void leave();
    58         void ticked(const Clock& time);
    59 
    6055        void setConfigValues();
    6156
    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);
    6760
    68         // console commands
    69         void printScreen();
     61        void toggleGUI();
    7062
    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();
    8767
    8868        // managed singletons
    89         InputManager*         inputManager_;
     69        InputManager*         inputManager_;        //!< Reference to input management
    9070        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
    9573
    96         KeyBinder*            masterKeyBinder_;
     74        KeyBinder*            masterKeyBinder_;     //!< Key binder for master key bindings
     75        SimpleInputState*     masterInputState_;    //!< Special input state for master input
    9776        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
    11178    };
    11279}
Note: See TracChangeset for help on using the changeset viewer.