forked from StrafesNET/strafe-client
graphics resize
This commit is contained in:
parent
d27187aa53
commit
d2c896031c
@ -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(
|
||||
|
@ -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{
|
||||
|
Loading…
Reference in New Issue
Block a user