Push branche HUD. Propriétes et getters pour Player (HP, username). Changements minimes à Audio (enlever d'un merge). Modification et ajouts de DrawHud et DrawData

This commit is contained in:
Mathieu Duval
2023-09-15 11:24:43 -04:00
parent 8e40f17b75
commit f8ad857666
9 changed files with 216 additions and 133 deletions

View File

@@ -29,11 +29,13 @@ public:
virtual void MouseMoveEvent(int x, int y);
virtual void MousePressEvent(const MOUSE_BUTTON &button, int x, int y);
virtual void MouseReleaseEvent(const MOUSE_BUTTON &button, int x, int y);
const char* GetGLErrorString(GLenum error);
private:
bool LoadTexture(Texture& texture, const std::string& filename, bool stopOnError = true);
void DrawHud(float elapsedTime, BlockType bloc);
void PrintText(unsigned int x, unsigned int y, const std::string& t);
void DrawHud();
void DrawData(float elapsedTime, BlockType bloc);
void PrintText(unsigned int x, unsigned int y, float scale, const std::string& t);
int GetFps(float elapsedTime) const;
bool m_wireframe = false;
@@ -52,7 +54,7 @@ private:
Texture m_textureCrosshair;
Skybox m_skybox;
Audio m_audio = Audio(AUDIO_PATH "music01.wav");
Audio m_audio = Audio(AUDIO_PATH "start.wav");
irrklang::ISound* m_powpow;
irrklang::ISound* m_scream;
@@ -65,7 +67,6 @@ private:
bool m_keyA = false;
bool m_keyS = false;
bool m_keyD = false;
bool m_keylshift = false;
bool m_keySpace = false;
bool m_mouseL = false;
bool m_mouseR = false;
@@ -75,6 +76,8 @@ private:
bool m_block = false;
bool m_flash = true;
bool m_displayData = false;
bool m_displayHud = true;
};