Line | |
---|
1 | /*! |
---|
2 | * @file hud.h |
---|
3 | * @brief Definition of the ingame HUD. |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _HUD_H |
---|
7 | #define _HUD_H |
---|
8 | |
---|
9 | #include "element_2d.h" |
---|
10 | // FORWARD DECLARATION |
---|
11 | class TiXmlElement; |
---|
12 | class WeaponManager; |
---|
13 | namespace OrxGui { class GLGuiWidget; } |
---|
14 | |
---|
15 | //! A class that renders a HUD. |
---|
16 | class Hud : public Element2D |
---|
17 | { |
---|
18 | |
---|
19 | public: |
---|
20 | Hud(); |
---|
21 | virtual ~Hud(); |
---|
22 | |
---|
23 | |
---|
24 | virtual void loadParams(const TiXmlElement* root); |
---|
25 | |
---|
26 | void setBackGround(); |
---|
27 | void setEnergyWidget(OrxGui::GLGuiWidget* widget); |
---|
28 | void setShiledWidget(OrxGui::GLGuiWidget* widget); |
---|
29 | void setArmorWidget(OrxGui::GLGuiWidget* widget); |
---|
30 | void setWeaponManager(WeaponManager* weaponMan); |
---|
31 | |
---|
32 | void addWeaponWidget(OrxGui::GLGuiWidget* widget); |
---|
33 | void removeWeaponWidget(OrxGui::GLGuiWidget* widget); |
---|
34 | |
---|
35 | void updateWeaponManager(); |
---|
36 | |
---|
37 | void tick(float dt); |
---|
38 | void draw() const; |
---|
39 | |
---|
40 | private: |
---|
41 | void updateResolution(); |
---|
42 | |
---|
43 | private: |
---|
44 | unsigned int resX; |
---|
45 | unsigned int resY; |
---|
46 | |
---|
47 | OrxGui::GLGuiWidget* energyWidget; |
---|
48 | OrxGui::GLGuiWidget* shieldWidget; |
---|
49 | OrxGui::GLGuiWidget* armorWidget; |
---|
50 | |
---|
51 | WeaponManager* weaponManager; |
---|
52 | |
---|
53 | std::list<OrxGui::GLGuiWidget*> weaponsWidgets; //!< WeaponWidgets will be displayed one after another |
---|
54 | }; |
---|
55 | |
---|
56 | #endif /* _HUD_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.