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 <OgreSceneNode.h> |
---|
38 | #include "core/Tickable.h" |
---|
39 | #include "util/Math.h" |
---|
40 | |
---|
41 | namespace orxonox |
---|
42 | { |
---|
43 | class _OrxonoxExport HUD : public Tickable |
---|
44 | { |
---|
45 | private: |
---|
46 | HUD(); |
---|
47 | HUD(HUD& instance); |
---|
48 | ~HUD(); |
---|
49 | Ogre::OverlayManager* om; |
---|
50 | Ogre::SceneManager* sm; |
---|
51 | Ogre::Overlay* orxonoxHUD; |
---|
52 | Ogre::OverlayContainer* container; |
---|
53 | Ogre::TextAreaOverlayElement* fpsText; |
---|
54 | Ogre::TextAreaOverlayElement* rTRText; |
---|
55 | BarOverlayElement* energyBar; |
---|
56 | BarOverlayElement* speedoBar; |
---|
57 | RadarOverlayElement* radar; |
---|
58 | Navigation* nav; |
---|
59 | |
---|
60 | bool showFPS; |
---|
61 | bool showRenderTime; |
---|
62 | |
---|
63 | public: |
---|
64 | virtual void tick(float); |
---|
65 | void addRadarObject(Ogre::SceneNode* node, int colour = 0); |
---|
66 | void removeRadarObject(Ogre::SceneNode* node); |
---|
67 | void setRenderTimeRatio(float ratio); |
---|
68 | void setFPS(); |
---|
69 | |
---|
70 | std::set<RadarObject*> roSet; |
---|
71 | |
---|
72 | static HUD* instance_s; |
---|
73 | static HUD& getSingleton(); |
---|
74 | static void setEnergy(float value); |
---|
75 | static void cycleNavigationFocus(); |
---|
76 | static void toggleFPS(); |
---|
77 | static void toggleRenderTime(); |
---|
78 | }; |
---|
79 | } |
---|
80 | |
---|
81 | #endif /* _HUD_H__ */ |
---|