Window example doesnt render quite right when i move it from a hidpi screen to 1x, or vice versa
Tested on macos high sierra, dont have a hidpi windows setup to test i'm afraid.
When I run the example, it appears on my main screen (the laptop hidpi 2), and looks like:
When i drag it to the second monitor, which is a standard 24" 1080p. It gets zoomed in sorta.

Once i drag the window corner to resize it, it fixes itself. I tried updating the example to handle the hidpi change, but it hasnt improved.
match event {
glutin::Event::WindowEvent { event, .. } => match event {
glutin::WindowEvent::CloseRequested => running = false,
glutin::WindowEvent::HiDpiFactorChanged(dpi_factor) => {
let logical_size = gl_window.get_inner_size().unwrap();
gl_window.resize(logical_size.to_physical(dpi_factor));
println!("{:?} - {:?}", event, logical_size.to_physical(dpi_factor));
},
glutin::WindowEvent::Resized(logical_size) => {
let dpi_factor = gl_window.get_hidpi_factor();
gl_window.resize(logical_size.to_physical(dpi_factor));
println!("{:?} - {:?}", event, logical_size.to_physical(dpi_factor));
},
_ => (),
},
_ => ()
}
In the terminal, this is the output i see:
HiDpiFactorChanged(2.0) - PhysicalSize { width: 2048.0, height: 1536.0 }
Resized(LogicalSize { width: 1024.0, height: 768.0 }) - PhysicalSize { width: 2048.0, height: 1536.0 }
HiDpiFactorChanged(1.0) - PhysicalSize { width: 1024.0, height: 768.0 }
Resized(LogicalSize { width: 1024.0, height: 768.0 }) - PhysicalSize { width: 1024.0, height: 768.0 }
IIRC the example rendering code doesn't handle resizes at all. The triangle verts are never transformed, so they'll be in the same place after resizing.
(HiDpiFactorChanged also wouldn't need to be handled separately like this, as any DPI change that results in a resize would be accompanied by Resized. The former event is still useful if you're explicitly/specifically interested in DPI changes, though.)
@francesca64 When i resize the screen with my above code, the scene skews with the new size. So the triangle stretches, which is what i expect.
Though im not sure why the scene is offset upon moving it to the other monitor, and how to handle that.
Fixed in #1435.