From 16b0ce3748f1b3ea788bbaf4caaeb342a8f58d6f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 7 Nov 2021 08:24:55 +0100 Subject: Use char array for text entered str, reset text fields on deinit --- src/graphics/text.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/graphics/text.c') diff --git a/src/graphics/text.c b/src/graphics/text.c index 9804ab2..2f410d4 100644 --- a/src/graphics/text.c +++ b/src/graphics/text.c @@ -52,7 +52,11 @@ int mgl_text_init(mgl_text *self, mgl_font *font, const char *str, size_t str_si } void mgl_text_deinit(mgl_text *self) { - (void)self; + self->font = NULL; + self->position = (mgl_vec2f){ 0.0f, 0.0f }; + self->text = NULL; + self->text_size = 0; + self->bounds = (mgl_vec2f){ 0.0f, 0.0f }; } int mgl_text_set_string(mgl_text *self, const char *str, size_t str_size) { -- cgit v1.2.3