This commit is contained in:
2025-08-13 01:35:09 -04:00
parent 23a5ccd05e
commit c7e3225c5f
11 changed files with 247 additions and 142 deletions

View File

@@ -1,4 +1,4 @@
use gui::{UIRenderNode, UI};
use gui::{UIRenderNode, Ui};
use pollster::FutureExt;
use std::sync::Arc;
use wgpu::util::StagingBelt;
@@ -7,6 +7,7 @@ use winit::{dpi::PhysicalSize, window::Window};
pub const CLEAR_COLOR: wgpu::Color = wgpu::Color::BLACK;
pub struct Renderer {
window: Arc<Window>,
surface: wgpu::Surface<'static>,
device: wgpu::Device,
queue: wgpu::Queue,
@@ -17,7 +18,7 @@ pub struct Renderer {
}
impl Renderer {
pub fn update(&mut self, ui: &UI) {
pub fn update(&mut self, ui: &mut Ui) {
self.ui_node.update(&self.device, &self.queue, ui);
}
@@ -127,6 +128,11 @@ impl Renderer {
encoder,
staging_belt,
ui_node: shape_pipeline,
window,
}
}
pub fn window(&self) -> &Window {
self.window.as_ref()
}
}