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(
&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(

View File

@ -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{