Rework resize

This commit is contained in:
hodasemi 2024-08-27 11:24:44 +02:00
parent 304a29397b
commit be69061dd9

View file

@ -191,7 +191,7 @@ impl TextToScreen {
}
pub struct GuiHandler {
context: Arc<dyn ContextInterface>,
_context: Arc<dyn ContextInterface>,
device: Arc<Device>,
queue: Arc<Mutex<Queue>>,
@ -309,7 +309,7 @@ impl GuiHandler {
.build(device.clone())?;
Ok(Arc::new(GuiHandler {
context: context.clone(),
_context: context.clone(),
device: device.clone(),
queue: queue.clone(),
@ -1657,9 +1657,13 @@ impl GuiHandler {
Ok(())
}
pub fn resize(&self, width: u32, height: u32) -> Result<()> {
self.context
.images()
pub fn resize(
&self,
width: u32,
height: u32,
images: &TargetMode<Vec<Arc<Image>>>,
) -> Result<()> {
images
.chain(&self.render_targets)
.execute(|(images, render_target)| {
let mut rt_lock = render_target.write().unwrap();