diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-12-22 12:16:38 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-12-22 12:16:38 +0000 |
commit | e806d41c8703ddc4bcaf2186d0c1701bd1e1ada3 (patch) | |
tree | 1612baf22456c0b5a1bef82980177afb34b2756c /ui/uiComponentPlacer.h | |
parent | Window handles UIComponent rendering (diff) | |
download | ilt-e806d41c8703ddc4bcaf2186d0c1701bd1e1ada3.tar.bz2 ilt-e806d41c8703ddc4bcaf2186d0c1701bd1e1ada3.tar.xz ilt-e806d41c8703ddc4bcaf2186d0c1701bd1e1ada3.zip |
Initial commit with some basic UI
Diffstat (limited to 'ui/uiComponentPlacer.h')
-rw-r--r-- | ui/uiComponentPlacer.h | 22 |
1 files changed, 22 insertions, 0 deletions
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 <glm/glm.hpp> + +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 |