From d2c896031c3119702cb7e60b441670b01b85a440 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 20 Oct 2023 17:17:24 -0700 Subject: [PATCH] graphics resize --- src/graphics.rs | 8 +++----- src/graphics_context.rs | 14 +++++++------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/graphics.rs b/src/graphics.rs index 87e45ca..650bc31 100644 --- a/src/graphics.rs +++ b/src/graphics.rs @@ -876,12 +876,10 @@ impl GraphicsState{ } pub fn resize( &mut self, - config: &wgpu::SurfaceConfiguration, - device: &wgpu::Device, - _queue: &wgpu::Queue, + context:&crate::graphics_context::GraphicsContext, ) { - self.depth_view = Self::create_depth_texture(config, device); - self.camera.screen_size=glam::uvec2(config.width, config.height); + self.depth_view = Self::create_depth_texture(&context.config,&context.device); + self.camera.screen_size=glam::uvec2(context.config.width, context.config.height); self.load_user_settings(&self.user_settings); } pub fn render( diff --git a/src/graphics_context.rs b/src/graphics_context.rs index 18823cf..43acc15 100644 --- a/src/graphics_context.rs +++ b/src/graphics_context.rs @@ -166,13 +166,13 @@ impl GraphicsContextPartial4{ } } } -struct GraphicsContext{ - instance:wgpu::Instance, - surface:wgpu::Surface, - adapter:wgpu::Adapter, - device:wgpu::Device, - queue:wgpu::Queue, - config:wgpu::SurfaceConfiguration, +pub struct GraphicsContext{ + pub instance:wgpu::Instance, + pub surface:wgpu::Surface, + pub adapter:wgpu::Adapter, + pub device:wgpu::Device, + pub queue:wgpu::Queue, + pub config:wgpu::SurfaceConfiguration, } pub fn setup(title:&str)->GraphicsContextSetup{