X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fui%2FMessageBox.hpp;h=b5a82c8b0a7b21f65be52587ee42b0c81dbd30e3;hb=b49cc8c88caf7d69b35b50e23a40528e71306ade;hp=2191627b039aab23f9a8410521476991ca631d01;hpb=75172fd735e34082c34b47ae7c194445b53038d9;p=blank.git diff --git a/src/ui/MessageBox.hpp b/src/ui/MessageBox.hpp index 2191627..b5a82c8 100644 --- a/src/ui/MessageBox.hpp +++ b/src/ui/MessageBox.hpp @@ -3,6 +3,7 @@ #include "Text.hpp" #include "../graphics/align.hpp" +#include "../graphics/PrimitiveMesh.hpp" #include #include @@ -22,7 +23,7 @@ public: void Position(const glm::vec3 &, Gravity) noexcept; void Foreground(const glm::vec4 &col) noexcept { fg = col; } - void Background(const glm::vec4 &col) noexcept { bg = col; } + void Background(const glm::vec4 &col) noexcept { bg = col; dirty = true; } void PushLine(const char *); void PushLine(const std::string &l) { @@ -31,6 +32,9 @@ public: void Render(Viewport &) noexcept; +private: + void Recalc(); + private: const Font &font; std::deque lines; @@ -38,11 +42,15 @@ private: glm::vec3 pos; glm::vec3 adv; + glm::vec2 size; glm::vec4 bg; glm::vec4 fg; + PrimitiveMesh bg_mesh; + Gravity grav; + bool dirty; };