From 230f10fc575e66147adc157b611b3b5ebccf016b Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Sun, 5 May 2024 02:02:30 +0200 Subject: [PATCH] minor changes --- kubi/src/rendering.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/kubi/src/rendering.rs b/kubi/src/rendering.rs index cc3df5f..33a052a 100644 --- a/kubi/src/rendering.rs +++ b/kubi/src/rendering.rs @@ -3,29 +3,23 @@ use winit::dpi::PhysicalSize; use glam::{Vec3, UVec2}; use crate::{events::WindowResizedEvent, state::is_ingame}; -pub mod renderer; +mod renderer; +pub use renderer::Renderer; + pub mod primitives; pub mod world; pub mod selection_box; pub mod entities; pub mod sumberge; -pub use renderer::Renderer; pub struct BufferPair { pub index: wgpu::Buffer, pub vertex: wgpu::Buffer, } #[derive(Unique)] -#[repr(transparent)] pub struct BackgroundColor(pub Vec3); -#[derive(Unique, Clone, Copy)] -#[repr(transparent)] -#[deprecated = "use Renderer.size instead"] -#[allow(deprecated)] -pub struct WindowSize(pub UVec2); - pub fn render_master(storages: AllStoragesViewMut) { let renderer = storages.borrow::>().unwrap(); @@ -77,6 +71,13 @@ pub fn resize_renderer( } //Deprecated WindowSize thingy + +#[derive(Unique, Clone, Copy)] +#[repr(transparent)] +#[deprecated = "use Renderer.size instead"] +#[allow(deprecated)] +pub struct WindowSize(pub UVec2); + pub fn init_window_size(storages: AllStoragesView) { let size = storages.borrow::>().unwrap().iter().next().unwrap().0; storages.add_unique(WindowSize(size))