1 | /* |
---|
2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
3 | * > www.orxonox.net < |
---|
4 | * |
---|
5 | * |
---|
6 | * License notice: |
---|
7 | * |
---|
8 | * This program is free software; you can redistribute it and/or |
---|
9 | * modify it under the terms of the GNU General Public License |
---|
10 | * as published by the Free Software Foundation; either version 2 |
---|
11 | * of the License, or (at your option) any later version. |
---|
12 | * |
---|
13 | * This program is distributed in the hope that it will be useful, |
---|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | * GNU General Public License for more details. |
---|
17 | * |
---|
18 | * You should have received a copy of the GNU General Public License |
---|
19 | * along with this program; if not, write to the Free Software |
---|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
21 | * |
---|
22 | * Author: |
---|
23 | * Reto Grieder |
---|
24 | * Co-authors: |
---|
25 | * ... |
---|
26 | * |
---|
27 | */ |
---|
28 | |
---|
29 | #ifndef _GSGraphics_H__ |
---|
30 | #define _GSGraphics_H__ |
---|
31 | |
---|
32 | #include "OrxonoxPrereqs.h" |
---|
33 | #include <OgrePrerequisites.h> |
---|
34 | #include <OgreWindowEventUtilities.h> |
---|
35 | #include "core/GameState.h" |
---|
36 | #include "core/OrxonoxClass.h" |
---|
37 | |
---|
38 | namespace orxonox |
---|
39 | { |
---|
40 | class _OrxonoxExport GSGraphics : public GameState, public OrxonoxClass, public Ogre::WindowEventListener |
---|
41 | { |
---|
42 | friend class ClassIdentifier<GSGraphics>; |
---|
43 | public: |
---|
44 | GSGraphics(); |
---|
45 | ~GSGraphics(); |
---|
46 | |
---|
47 | private: |
---|
48 | void enter(); |
---|
49 | void leave(); |
---|
50 | void ticked(const Clock& time); |
---|
51 | |
---|
52 | void setConfigValues(); |
---|
53 | |
---|
54 | void declareResources(); |
---|
55 | void loadRenderer(); |
---|
56 | void initialiseResources(); |
---|
57 | |
---|
58 | void printScreen(); |
---|
59 | |
---|
60 | // window events from Ogre::WindowEventListener |
---|
61 | void windowMoved (Ogre::RenderWindow* rw); |
---|
62 | void windowResized (Ogre::RenderWindow* rw); |
---|
63 | void windowFocusChanged(Ogre::RenderWindow* rw); |
---|
64 | void windowClosed (Ogre::RenderWindow* rw); |
---|
65 | |
---|
66 | Ogre::Root* ogreRoot_; |
---|
67 | Ogre::RenderWindow* renderWindow_; //!< the current render window |
---|
68 | Ogre::Viewport* viewport_; //!< default full size viewport |
---|
69 | |
---|
70 | // managed singletons |
---|
71 | InputManager* inputManager_; |
---|
72 | InGameConsole* console_; |
---|
73 | GUIManager* guiManager_; |
---|
74 | |
---|
75 | // variables for time statistics |
---|
76 | unsigned long frameCount_; |
---|
77 | unsigned int statisticsRefreshCycle_; |
---|
78 | uint64_t statisticsStartTime_; |
---|
79 | unsigned long statisticsStartCount_; |
---|
80 | unsigned int tickTime_; |
---|
81 | |
---|
82 | // config values |
---|
83 | std::string resourceFile_; //!< resources file name |
---|
84 | unsigned int detailLevelParticle_; //!< Detail level of particle effects (0: off, 1: low, 2: normal, 3: high) |
---|
85 | }; |
---|
86 | } |
---|
87 | |
---|
88 | #endif /* _GSGraphics_H__ */ |
---|