mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fixed window resizing
Former-commit-id: 81f2e18274aadb53b07704cf10c5c27efdccb032
This commit is contained in:
parent
df9b64355a
commit
6da495f0bd
@ -202,8 +202,8 @@ impl Renderer {
|
||||
/// Get the resolution of the render target.
|
||||
pub fn get_resolution(&self) -> Vec2<u16> {
|
||||
Vec2::new(
|
||||
self.tgt_color_view.get_dimensions().0,
|
||||
self.tgt_color_view.get_dimensions().1,
|
||||
self.win_color_view.get_dimensions().0,
|
||||
self.win_color_view.get_dimensions().1,
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ impl Window {
|
||||
glutin::Event::WindowEvent { event, .. } => match event {
|
||||
glutin::WindowEvent::CloseRequested => events.push(Event::Close),
|
||||
glutin::WindowEvent::Resized(glutin::dpi::LogicalSize { width, height }) => {
|
||||
let (mut color_view, mut depth_view) = renderer.tgt_views_mut();
|
||||
let (mut color_view, mut depth_view) = renderer.win_views_mut();
|
||||
gfx_window_glutin::update_views(&window, &mut color_view, &mut depth_view);
|
||||
renderer.on_resize().unwrap();
|
||||
events.push(Event::Resize(Vec2::new(width as u32, height as u32)));
|
||||
|
Loading…
Reference in New Issue
Block a user