X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fui%2FHUD.hpp;h=b842da392d892340d9d6413cc45c76d85f531865;hb=1bc2f230105ad6e1ee8d999ddc079cd85d244bf9;hp=32a167b865d2979209f763a1e12341280f3b2f28;hpb=3542823a1af7f5063d7cc8da84efa248eb889b8a;p=blank.git diff --git a/src/ui/HUD.hpp b/src/ui/HUD.hpp index 32a167b..b842da3 100644 --- a/src/ui/HUD.hpp +++ b/src/ui/HUD.hpp @@ -4,7 +4,7 @@ #include "FixedText.hpp" #include "MessageBox.hpp" #include "../graphics/EntityMesh.hpp" -#include "../graphics/OutlineMesh.hpp" +#include "../graphics/PrimitiveMesh.hpp" #include @@ -14,6 +14,7 @@ namespace blank { class Block; class BlockTypeRegistry; class Config; +class CongestionControl; class Environment; class Font; class Player; @@ -42,11 +43,16 @@ public: void UpdatePosition(); void UpdateOrientation(); + // net stats + void UpdateNetStats(const CongestionControl &); + // message box void PostMessage(const char *); void PostMessage(const std::string &msg) { PostMessage(msg.c_str()); } + // whether to always render message box regardless of last post + void KeepMessages(bool k) { msg_keep = k; } void Update(int dt); void Render(Viewport &) noexcept; @@ -57,7 +63,7 @@ private: const Player &player; // block focus - OutlineMesh outline; + PrimitiveMesh outline; glm::mat4 outline_transform; bool outline_visible; @@ -77,12 +83,19 @@ private: bool show_block; bool show_entity; + // net stats + FixedText bandwidth_text; + FixedText rtt_text; + FixedText packet_loss_text; + bool show_net; + // message box MessageBox messages; - IntervalTimer msg_timer; + CoarseTimer msg_timer; + bool msg_keep; // crosshair - OutlineMesh crosshair; + PrimitiveMesh crosshair; };