/**
 * @file Gui.h
 * @author Petr Egert (egertpet@fel.cvut.cz)
 * @brief Contains Gui class declaration
 */

#ifndef GUI_H
#define GUI_H

#include <set>
#include "GuiElements.h"
#include "Error.h"
#include "Vector.h"

namespace RD
{
    class GuiElement;

    /**
     * @brief Class representing a graphical user interface (GUI)
     */
    class Gui
    {
        public:
            ///Default constructor, sets pos to (0.0, 0.0) and size to (1.0, 1.0)
            Gui() : pos(0.0, 0.0),  size(1.0, 1.0), rootElement(NULL){}

            ///Default destructor, currently does nothing
            ~Gui(){}

            Result Init();
            Result Release();

            void SetPos(const vec2 &pos);
            void SetSize(const vec2 &size);

            void Update();
            void Render();

            void RegisterElement(GuiElement *element);

        protected:
            friend class GuiElement;

            vec2 pos;   ///< Current position
            vec2 size;  ///< Current size

            GuiElement *rootElement; ///< Pointer to the root element of the GUI

        private:
            void UpdateMatrix();
    };
};

#endif // GUI_H

