Skip to content

Commit

Permalink
Merge pull request glium#1817 from est31/glutin_022
Browse files Browse the repository at this point in the history
Update to glutin 0.23
  • Loading branch information
est31 committed Feb 9, 2020
2 parents d247ec2 + 8e65f6f commit 97f81d0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -34,7 +34,7 @@ unstable = [] # used for benchmarks
test_headless = [] # used for testing headless display

[dependencies.glutin]
version = "=0.22.0-alpha6"
version = "0.23"
features = []
optional = true

Expand Down
3 changes: 2 additions & 1 deletion examples/deferred.rs
Expand Up @@ -33,8 +33,9 @@ fn main() {
use cgmath::SquareMatrix;

let event_loop = glutin::event_loop::EventLoop::new();
let size: glutin::dpi::LogicalSize<u32> = (800, 500).into();
let wb = glutin::window::WindowBuilder::new()
.with_inner_size((800, 500).into())
.with_inner_size(size)
.with_title("Glium Deferred Example");
let cb = glutin::ContextBuilder::new();
let display = glium::Display::new(wb, cb, &event_loop).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions examples/gpgpu.rs
Expand Up @@ -9,8 +9,8 @@ fn main() {
let event_loop = glium::glutin::event_loop::EventLoop::new();
let cb = glutin::ContextBuilder::new();
let size = PhysicalSize {
width: 800.0,
height: 600.0,
width: 800,
height: 600,
};
let context = cb.build_headless(&event_loop, size).unwrap();
let context = unsafe {
Expand Down
3 changes: 1 addition & 2 deletions examples/picking.rs
Expand Up @@ -235,8 +235,7 @@ fn main() {
glutin::event::Event::WindowEvent { event, .. } => match event {
glutin::event::WindowEvent::CloseRequested => action = support::Action::Stop,
glutin::event::WindowEvent::CursorMoved { position, .. } => {
let hidpi_factor = display.gl_window().window().hidpi_factor();
cursor_position = Some(position.to_physical(hidpi_factor).into());
cursor_position = Some(position.cast::<i32>().into());
}
ev => camera.process_input(&ev),
},
Expand Down
10 changes: 7 additions & 3 deletions examples/support/mod.rs
Expand Up @@ -20,19 +20,23 @@ pub fn start_loop<F>(event_loop: EventLoop<()>, mut callback: F)->! where F: 'st
let mut events_buffer = Vec::new();
let mut next_frame_time = Instant::now();
event_loop.run(move |event, _, control_flow| {
let run_callback = match event {
Event::NewEvents(cause) => {
let run_callback = match event.to_static() {
Some(Event::NewEvents(cause)) => {
match cause {
StartCause::ResumeTimeReached { .. } | StartCause::Init => {
true
},
_ => false
}
},
_ => {
Some(event) => {
events_buffer.push(event);
false
}
None => {
// Ignore this event.
false
},
};

let action = if run_callback {
Expand Down
1 change: 0 additions & 1 deletion src/backend/glutin/mod.rs
Expand Up @@ -273,7 +273,6 @@ unsafe impl Backend for GlutinBackend {
let gl_window_takeable = self.borrow();
let gl_window = gl_window_takeable.window();
let (width, height) = gl_window.inner_size()
.to_physical(gl_window.hidpi_factor())
.into();
(width, height)
}
Expand Down

0 comments on commit 97f81d0

Please sign in to comment.