From aaf0b6edbbda67c2414b4736b82a00e6fe4025f5 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 26 Nov 2021 09:00:38 +0100 Subject: Allow reloading images, textures and memory mapped files --- src/graphics/Texture.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/graphics/Texture.cpp') diff --git a/src/graphics/Texture.cpp b/src/graphics/Texture.cpp index 29c2eea..794c563 100644 --- a/src/graphics/Texture.cpp +++ b/src/graphics/Texture.cpp @@ -27,7 +27,7 @@ namespace mgl { bool Texture::load_from_file(const char *filepath, const LoadOptions load_options) { if(texture.id) - return false; + clear(); if(mgl_texture_init(&texture) != 0) return false; @@ -41,7 +41,7 @@ namespace mgl { bool Texture::load_from_image(Image &image, const LoadOptions load_options) { if(texture.id) - return false; + clear(); if(mgl_texture_init(&texture) != 0) return false; -- cgit v1.2.3