Skip to content

Commit 97f81d0

Browse files
authored
Merge pull request glium#1817 from est31/glutin_022
Update to glutin 0.23
2 parents d247ec2 + 8e65f6f commit 97f81d0

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ unstable = [] # used for benchmarks
3434
test_headless = [] # used for testing headless display
3535

3636
[dependencies.glutin]
37-
version = "=0.22.0-alpha6"
37+
version = "0.23"
3838
features = []
3939
optional = true
4040

examples/deferred.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ fn main() {
3333
use cgmath::SquareMatrix;
3434

3535
let event_loop = glutin::event_loop::EventLoop::new();
36+
let size: glutin::dpi::LogicalSize<u32> = (800, 500).into();
3637
let wb = glutin::window::WindowBuilder::new()
37-
.with_inner_size((800, 500).into())
38+
.with_inner_size(size)
3839
.with_title("Glium Deferred Example");
3940
let cb = glutin::ContextBuilder::new();
4041
let display = glium::Display::new(wb, cb, &event_loop).unwrap();

examples/gpgpu.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ fn main() {
99
let event_loop = glium::glutin::event_loop::EventLoop::new();
1010
let cb = glutin::ContextBuilder::new();
1111
let size = PhysicalSize {
12-
width: 800.0,
13-
height: 600.0,
12+
width: 800,
13+
height: 600,
1414
};
1515
let context = cb.build_headless(&event_loop, size).unwrap();
1616
let context = unsafe {

examples/picking.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,7 @@ fn main() {
235235
glutin::event::Event::WindowEvent { event, .. } => match event {
236236
glutin::event::WindowEvent::CloseRequested => action = support::Action::Stop,
237237
glutin::event::WindowEvent::CursorMoved { position, .. } => {
238-
let hidpi_factor = display.gl_window().window().hidpi_factor();
239-
cursor_position = Some(position.to_physical(hidpi_factor).into());
238+
cursor_position = Some(position.cast::<i32>().into());
240239
}
241240
ev => camera.process_input(&ev),
242241
},

examples/support/mod.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,23 @@ pub fn start_loop<F>(event_loop: EventLoop<()>, mut callback: F)->! where F: 'st
2020
let mut events_buffer = Vec::new();
2121
let mut next_frame_time = Instant::now();
2222
event_loop.run(move |event, _, control_flow| {
23-
let run_callback = match event {
24-
Event::NewEvents(cause) => {
23+
let run_callback = match event.to_static() {
24+
Some(Event::NewEvents(cause)) => {
2525
match cause {
2626
StartCause::ResumeTimeReached { .. } | StartCause::Init => {
2727
true
2828
},
2929
_ => false
3030
}
3131
},
32-
_ => {
32+
Some(event) => {
3333
events_buffer.push(event);
3434
false
3535
}
36+
None => {
37+
// Ignore this event.
38+
false
39+
},
3640
};
3741

3842
let action = if run_callback {

src/backend/glutin/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ unsafe impl Backend for GlutinBackend {
273273
let gl_window_takeable = self.borrow();
274274
let gl_window = gl_window_takeable.window();
275275
let (width, height) = gl_window.inner_size()
276-
.to_physical(gl_window.hidpi_factor())
277276
.into();
278277
(width, height)
279278
}

0 commit comments

Comments
 (0)