Skip to content

Commit

Permalink
wip: clear texture array if update or creation fails
Browse files Browse the repository at this point in the history
  • Loading branch information
B-LechCode committed Jan 28, 2025
1 parent 09eb7c1 commit fdaaab1
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/texture_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ impl TextureWrapperManager {
&& img.color() == tex.image_format
{
debug!("Re-using texture as it is the same size and type.");
return tex.update_textures(gfx, img);
match tex.update_textures(gfx, img) {
Ok(_) => {}
Err(error) => {
self.clear();
error!("{error}");
return Err(error);
}
}
}
}

Expand All @@ -61,8 +68,8 @@ impl TextureWrapperManager {
Ok(())
}
Err(error) => {
self.current_texture = None;
error!("{error}"); //TODO pass this to caller
self.clear();
error!("{error}");
Err(error)
}
}
Expand Down

0 comments on commit fdaaab1

Please sign in to comment.