summaryrefslogtreecommitdiff
path: root/alligator_render
diff options
context:
space:
mode:
Diffstat (limited to 'alligator_render')
-rw-r--r--alligator_render/examples/bunnymark.rs5
-rw-r--r--alligator_render/src/texture.rs2
2 files changed, 4 insertions, 3 deletions
diff --git a/alligator_render/examples/bunnymark.rs b/alligator_render/examples/bunnymark.rs
index fea69ca..55feb86 100644
--- a/alligator_render/examples/bunnymark.rs
+++ b/alligator_render/examples/bunnymark.rs
@@ -89,7 +89,7 @@ impl State {
for _ in 0..=(fps as u64 * 50) {
let texture_x = renderer.textures_mut().texture_x(self.texture_id).unwrap();
- let texture_y = renderer.textures_mut().texture_x(self.texture_id).unwrap();
+ let texture_y = renderer.textures_mut().texture_y(self.texture_id).unwrap();
let texture_height = renderer
.textures_mut()
.texture_height(self.texture_id)
@@ -147,10 +147,11 @@ fn main() {
let bunny = include_bytes!("res/bunny.ff");
let texture_manager = Arc::new(TextureManager::new(&texture_config));
- let renderer = Renderer::new(&render_config, texture_manager.clone()).unwrap();
+ let mut renderer = Renderer::new(&render_config, texture_manager.clone()).unwrap();
let texture_id = texture_manager
.load_from_memory(bunny, ImageFormat::Farbfeld)
.unwrap();
+ renderer.textures_mut().load_texture(texture_id).unwrap();
let state = Box::leak(Box::new(State::new(texture_id)));
renderer.run(|r| state.update(r));
diff --git a/alligator_render/src/texture.rs b/alligator_render/src/texture.rs
index 0afa0af..76e77a8 100644
--- a/alligator_render/src/texture.rs
+++ b/alligator_render/src/texture.rs
@@ -168,8 +168,8 @@ impl TextureAtlas {
}
/// Load a new subtexture from memory
- // TODO support RGBA16
pub fn load_texture(&mut self, id: TextureId) -> Result<TextureId, TextureError> {
+ self.changed = true;
let img = self.textures.load_texture(id)?;
self.packer.pack_own(id, img).map_err(PackError)?;
Ok(id)