// Copyright (c) 2023 Dominic Masters // // This software is released under the MIT License. // https://opensource.org/licenses/MIT #pragma once #include "ui/UIAlign.hpp" #include "display/shader/UIShader.hpp" #include "component/ui/UICanvas.hpp" namespace Dawn { class UIComponent { protected: /** * Virtual method overridden by the UIComponent to get the quads for the * component. * * @param t The translation of this component already applied. * @param ctx The canvas to add the quads to. */ virtual void getSelfQuads(const glm::vec2 t, UICanvas &ctx) = 0; /** * Virtual method overridden by the UIComponent to get the children of * this component. */ virtual std::vector> getChildren(); /** * Method called by the UICanvas to get the quads for this component. * * @param parent The parent translation to apply to the component. * @param ctx The canvas to add the quads to. */ void getQuads(const glm::vec2 parent, UICanvas &ctx); public: glm::vec2 position; friend class UICanvas; }; }