aboutsummaryrefslogtreecommitdiff
path: root/src/graphics/Texture.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-11-26 09:00:38 +0100
committerdec05eba <dec05eba@protonmail.com>2021-11-26 09:03:21 +0100
commitaaf0b6edbbda67c2414b4736b82a00e6fe4025f5 (patch)
treee1fb563f5fcc17209dedc9cc11b2dc328a77e6b4 /src/graphics/Texture.cpp
parent1d4cc1d1c2c4f6a574775914078c80cf496fc7de (diff)
Allow reloading images, textures and memory mapped files
Diffstat (limited to 'src/graphics/Texture.cpp')
-rw-r--r--src/graphics/Texture.cpp4
1 files changed, 2 insertions, 2 deletions
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;