From e806d41c8703ddc4bcaf2186d0c1701bd1e1ada3 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 22 Dec 2021 12:16:38 +0000 Subject: Initial commit with some basic UI --- ui/uiComponentPlacer.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 ui/uiComponentPlacer.h (limited to 'ui/uiComponentPlacer.h') diff --git a/ui/uiComponentPlacer.h b/ui/uiComponentPlacer.h new file mode 100644 index 0000000..b68c4d8 --- /dev/null +++ b/ui/uiComponentPlacer.h @@ -0,0 +1,22 @@ +#ifndef UICOMPONENTPLACER_H +#define UICOMPONENTPLACER_H + +#include + +class UIComponentPlacer { +public: + UIComponentPlacer(glm::vec2 padding, float spacing, glm::length_t axis = 0); + + glm::vec2 next(glm::vec2 size); + glm::vec2 getLimit() const; + +private: + const glm::vec2 padding; + const float spacing; + const glm::length_t axis; + + float current {}; + float max {}; +}; + +#endif -- cgit v1.2.3