aboutsummaryrefslogtreecommitdiff
path: root/stockton-render/src/draw/ui/texture.rs
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 17:44:23 +0100
committertcmal <me@aria.rip>2024-08-25 17:44:23 +0100
commitc52a05e6d3977efce6bd4479aa312dc90e0452e5 (patch)
treec383c910c1467b406e332651906e081c599d6951 /stockton-render/src/draw/ui/texture.rs
parentd5b9ccd3d4a6e5b35a0411688bfb7113f5c7d631 (diff)
feat(render): proper error handling
Diffstat (limited to 'stockton-render/src/draw/ui/texture.rs')
-rwxr-xr-xstockton-render/src/draw/ui/texture.rs16
1 files changed, 5 insertions, 11 deletions
diff --git a/stockton-render/src/draw/ui/texture.rs b/stockton-render/src/draw/ui/texture.rs
index 0ec4873..f5ddb3e 100755
--- a/stockton-render/src/draw/ui/texture.rs
+++ b/stockton-render/src/draw/ui/texture.rs
@@ -1,6 +1,6 @@
use crate::draw::texture::{LoadableImage, TextureRepo};
-use crate::types::*;
use crate::UiState;
+use anyhow::Result;
use egui::Texture;
use stockton_levels::{prelude::HasTextures, traits::textures::Texture as LTexture};
@@ -43,19 +43,13 @@ impl LoadableImage for &Texture {
}
}
-pub fn ensure_textures(
- _tex_repo: &mut TextureRepo,
- ui: &mut UiState,
- _device: &mut DeviceT,
- _adapter: &mut Adapter,
- _allocator: &mut DynamicAllocator,
- _command_queue: &mut QueueT,
- _command_pool: &mut CommandPoolT,
-) {
+pub fn ensure_textures(tex_repo: &mut TextureRepo, ui: &mut UiState) -> Result<()> {
let tex = ui.ctx.texture();
if tex.version != ui.last_tex_ver {
- // tex_repo.force_queue_load(0).unwrap(); // TODO
+ tex_repo.force_queue_load(0)?;
ui.last_tex_ver = tex.version;
}
+
+ Ok(())
}