57 lines
1.1 KiB
C++
Raw Normal View History

2018-07-06 14:24:49 +02:00
/*
* =====================================================================================
*
* Filename: HUD.hpp
*
* Description:
*
* Created: 06/07/2018 13:58:33
*
* Author: Quentin Bazin, <quent42340@gmail.com>
*
* =====================================================================================
*/
#ifndef HUD_HPP_
#define HUD_HPP_
2019-01-12 20:19:10 +01:00
#include <gk/gl/Shader.hpp>
2018-07-06 14:24:49 +02:00
#include "BlockCursor.hpp"
#include "BlockInfoWidget.hpp"
2018-07-06 14:24:49 +02:00
#include "Crosshair.hpp"
#include "DebugOverlay.hpp"
#include "Hotbar.hpp"
2019-04-13 15:06:52 +02:00
class HUD : public gk::Transformable, public gk::Drawable {
2018-07-06 14:24:49 +02:00
public:
HUD(ClientPlayer &player, ClientWorld &world, ClientCommandHandler &client);
2018-07-06 14:24:49 +02:00
void setup();
void onEvent(const SDL_Event &event);
2018-07-06 14:24:49 +02:00
void update();
private:
2018-12-29 02:23:23 +01:00
void draw(gk::RenderTarget &target, gk::RenderStates states) const override;
2018-07-06 14:24:49 +02:00
ClientCommandHandler &m_client;
2018-12-29 02:23:23 +01:00
gk::Shader m_shader;
glm::mat4 m_orthoMatrix;
2018-07-06 14:24:49 +02:00
2019-01-12 20:19:10 +01:00
Hotbar m_hotbar;
2018-07-06 14:24:49 +02:00
2019-01-12 20:19:10 +01:00
BlockCursor m_blockCursor;
2018-07-06 14:24:49 +02:00
Crosshair m_crosshair;
DebugOverlay m_debugOverlay;
bool m_isDebugOverlayVisible = false;
2019-01-12 20:19:10 +01:00
BlockInfoWidget m_blockInfoWidget;
2020-01-27 19:24:20 +09:00
Text m_fpsText;
2018-07-06 14:24:49 +02:00
};
#endif // HUD_HPP_