Skip to content

Commit

Permalink
Fix resizing managed textures
Browse files Browse the repository at this point in the history
Resizing texture does not update its size params (since `self.textures.get(..)` returns a `Copy`)
  • Loading branch information
vdrn authored and not-fl3 committed Apr 17, 2024
1 parent 8c942d8 commit 69c3466
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/graphics/gl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,12 @@ impl RenderingBackend for GlContext {
) {
let mut t = self.textures.get(texture);
t.resize(self, width, height, source);
match texture.0 {
TextureIdInner::Managed(tex_id) => {
self.textures.0[tex_id].params = t.params;
}
_ => {}
};
}
fn texture_read_pixels(&mut self, texture: TextureId, source: &mut [u8]) {
let t = self.textures.get(texture);
Expand Down

0 comments on commit 69c3466

Please sign in to comment.