aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/graphics/Text.cpp7
-rw-r--r--src/window/Window.cpp4
2 files changed, 7 insertions, 4 deletions
diff --git a/src/graphics/Text.cpp b/src/graphics/Text.cpp
index fa82a88..a30cdf3 100644
--- a/src/graphics/Text.cpp
+++ b/src/graphics/Text.cpp
@@ -24,16 +24,15 @@ namespace mgl {
Text& Text::operator=(const Text &other) {
font = other.font;
str = other.str;
- mgl_text_init(&text, font ? font->internal_font() : nullptr, str.c_str(), str.size());
- mgl_text_set_position(&text, { other.text.position.x, other.text.position.y });
+ text = other.text;
+ mgl_text_set_string(&text, str.c_str(), str.size());
return *this;
}
Text::Text(Text &&other) {
font = std::move(other.font);
- str = std::move(other.str);
text = std::move(other.text);
- mgl_text_init(&text, font ? font->internal_font() : nullptr, str.c_str(), str.size());
+ set_string(std::move(other.str));
other.font = nullptr;
other.str.clear();
diff --git a/src/window/Window.cpp b/src/window/Window.cpp
index c41a0c6..dbb77a3 100644
--- a/src/window/Window.cpp
+++ b/src/window/Window.cpp
@@ -63,6 +63,10 @@ namespace mgl {
mgl_window_display(&window);
}
+ void Window::set_visible(bool visible) {
+ mgl_window_set_visible(&window, visible);
+ }
+
bool Window::is_open() const {
return mgl_window_is_open(&window);
}