aboutsummaryrefslogtreecommitdiff
path: root/src/graphics/Texture.cpp
diff options
context:
space:
mode:
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;