gaming
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user