From 497217a3e09b577f650aaf503356588515067ca8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 25 Sep 2022 17:29:17 +0200 Subject: widgets --- src/gui/Widget.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/gui/Widget.cpp') diff --git a/src/gui/Widget.cpp b/src/gui/Widget.cpp index c30c1d1..718fd8d 100644 --- a/src/gui/Widget.cpp +++ b/src/gui/Widget.cpp @@ -1,7 +1,20 @@ #include "../../include/gui/Widget.hpp" +#include "../../include/gui/WidgetContainer.hpp" namespace gsr { + Widget::Widget() { + WidgetContainer::get_instance().add_widget(this); + } + + Widget::~Widget() { + WidgetContainer::get_instance().remove_widget(this); + } + void Widget::set_position(mgl::vec2f position) { this->position = position; } + + mgl::vec2f Widget::get_position() const { + return position; + } } \ No newline at end of file -- cgit v1.2.3