]> git.localhorst.tv Git - blank.git/blobdiff - src/ui/Progress.hpp
simple (text) progress display for preloader
[blank.git] / src / ui / Progress.hpp
diff --git a/src/ui/Progress.hpp b/src/ui/Progress.hpp
new file mode 100644 (file)
index 0000000..9ea9f6d
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef BLANK_UI_PROGRESS_HPP_
+#define BLANK_UI_PROGRESS_HPP_
+
+#include "FixedText.hpp"
+
+
+namespace blank {
+
+class Font;
+class Viewport;
+
+class Progress {
+
+public:
+       explicit Progress(Font &) noexcept;
+
+       void Position(const glm::vec3 &p, Gravity g) noexcept { text.Position(p, g); }
+       void Template(const char *t) noexcept { tpl = t; }
+
+       void Update(int current, int total);
+       void Render(Viewport &) noexcept;
+
+private:
+       Font &font;
+       FixedText text;
+       const char *tpl;
+
+};
+
+}
+
+#endif