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 | * Yuning Chai |
---|
24 | * Co-authors: |
---|
25 | * Felix Schulthess |
---|
26 | * |
---|
27 | */ |
---|
28 | |
---|
29 | |
---|
30 | #ifndef _HUD_H__ |
---|
31 | #define _HUD_H__ |
---|
32 | |
---|
33 | #include "OrxonoxPrereqs.h" |
---|
34 | |
---|
35 | #include <OgrePrerequisites.h> |
---|
36 | #include <OgreTextAreaOverlayElement.h> |
---|
37 | #include "objects/Tickable.h" |
---|
38 | #include "util/Math.h" |
---|
39 | #include "OverlayElementFactories.h" |
---|
40 | |
---|
41 | namespace orxonox |
---|
42 | { |
---|
43 | class _OrxonoxExport HUD : public TickableReal |
---|
44 | { |
---|
45 | public: |
---|
46 | void initialise(); |
---|
47 | void destroy(); |
---|
48 | |
---|
49 | virtual void tick(float); |
---|
50 | |
---|
51 | void resize(); |
---|
52 | void addRadarObject(WorldEntity* object, const ColourValue& colour = ColourValue(0.5, 0.5, 0.5, 1)); |
---|
53 | void removeRadarObject(WorldEntity* object); |
---|
54 | void setRenderTimeRatio(float ratio); |
---|
55 | void setFPS(); |
---|
56 | |
---|
57 | std::list<RadarObject*>& getRadarObjects() |
---|
58 | { return this->roSet_; } |
---|
59 | |
---|
60 | static HUD& getSingleton(); |
---|
61 | |
---|
62 | static void setEnergy(float value); |
---|
63 | static void cycleNavigationFocus(); |
---|
64 | static void releaseNavigationFocus(); |
---|
65 | static void toggleFPS(); |
---|
66 | static void toggleRenderTime(); |
---|
67 | |
---|
68 | private: |
---|
69 | HUD(); |
---|
70 | HUD(const HUD& instance); |
---|
71 | ~HUD(); |
---|
72 | |
---|
73 | std::list<RadarObject*> roSet_; |
---|
74 | BarOverlayElementFactory barOverlayElementFactory_; |
---|
75 | RadarOverlayElementFactory radarOverlayElementFactory_; |
---|
76 | |
---|
77 | Ogre::Overlay* orxonoxHUD_; |
---|
78 | Ogre::OverlayContainer* container_; |
---|
79 | Ogre::TextAreaOverlayElement* fpsText_; |
---|
80 | Ogre::TextAreaOverlayElement* rTRText_; |
---|
81 | BarOverlayElement* energyBar_; |
---|
82 | BarOverlayElement* speedoBar_; |
---|
83 | RadarOverlayElement* radar_; |
---|
84 | Navigation* nav_; |
---|
85 | |
---|
86 | bool showFPS_; |
---|
87 | bool showRenderTime_; |
---|
88 | }; |
---|
89 | } |
---|
90 | |
---|
91 | #endif /* _HUD_H__ */ |
---|