From c9ee5e1c1feccb073863ba17cbfdcf094f235886 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 22 Oct 2021 07:05:55 +0200 Subject: Add vertex buffer --- src/graphics/Text.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/graphics/Text.cpp') diff --git a/src/graphics/Text.cpp b/src/graphics/Text.cpp index 094b198..7d08c22 100644 --- a/src/graphics/Text.cpp +++ b/src/graphics/Text.cpp @@ -6,8 +6,10 @@ extern "C" { } namespace mgl { - Text::Text(const char *str, vec2f position, Font &font) : font(font) { - mgl_text_init(&text, font.internal_font(), str, position.x, position.y); + Text::Text(std::string str, Font &font) : Text(std::move(str), mgl::vec2f(0.0f, 0.0f), font){} + + Text::Text(std::string str, vec2f position, Font &font) : font(font), str(std::move(str)) { + mgl_text_init(&text, font.internal_font(), this->str.c_str(), position.x, position.y); } Text::~Text() { -- cgit v1.2.3