graphics resize

This commit is contained in:
Quaternions 2023-10-20 17:17:24 -07:00
parent d27187aa53
commit d2c896031c
2 changed files with 10 additions and 12 deletions

View File

@ -876,12 +876,10 @@ impl GraphicsState{
} }
pub fn resize( pub fn resize(
&mut self, &mut self,
config: &wgpu::SurfaceConfiguration, context:&crate::graphics_context::GraphicsContext,
device: &wgpu::Device,
_queue: &wgpu::Queue,
) { ) {
self.depth_view = Self::create_depth_texture(config, device); self.depth_view = Self::create_depth_texture(&context.config,&context.device);
self.camera.screen_size=glam::uvec2(config.width, config.height); self.camera.screen_size=glam::uvec2(context.config.width, context.config.height);
self.load_user_settings(&self.user_settings); self.load_user_settings(&self.user_settings);
} }
pub fn render( pub fn render(

View File

@ -166,13 +166,13 @@ impl GraphicsContextPartial4{
} }
} }
} }
struct GraphicsContext{ pub struct GraphicsContext{
instance:wgpu::Instance, pub instance:wgpu::Instance,
surface:wgpu::Surface, pub surface:wgpu::Surface,
adapter:wgpu::Adapter, pub adapter:wgpu::Adapter,
device:wgpu::Device, pub device:wgpu::Device,
queue:wgpu::Queue, pub queue:wgpu::Queue,
config:wgpu::SurfaceConfiguration, pub config:wgpu::SurfaceConfiguration,
} }
pub fn setup(title:&str)->GraphicsContextSetup{ pub fn setup(title:&str)->GraphicsContextSetup{