Skip to content

Commit c9b89f3

Browse files
authored
Merge pull request #177 from bvssvni/master
Published 0.63.0
2 parents b3e8a9c + 96708b4 commit c9b89f3

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "pistoncore-glutin_window"
4-
version = "0.62.1"
4+
version = "0.63.0"
55
authors = ["bvssvni <bvssvni@gmail.com>"]
66
keywords = ["glutin", "window", "piston"]
77
description = "A Piston window back-end using the Glutin library"
@@ -18,5 +18,5 @@ path = "src/lib.rs"
1818
gl = "0.11.0"
1919
glutin = "0.21.0"
2020
pistoncore-input = "0.28.0"
21-
pistoncore-window = "0.43.0"
21+
pistoncore-window = "0.44.0"
2222
shader_version = "0.6.0"

src/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ use input::{
1717
ButtonArgs,
1818
ButtonState,
1919
CloseArgs,
20+
Event,
2021
MouseButton,
2122
Button,
2223
Input,
2324
FileDrag,
24-
TimeStamp,
2525
ResizeArgs,
2626
};
2727
use window::{
@@ -147,7 +147,7 @@ impl GlutinWindow {
147147
})
148148
}
149149

150-
fn wait_event(&mut self) -> (Input, Option<TimeStamp>) {
150+
fn wait_event(&mut self) -> Event {
151151
// First check for and handle any pending events.
152152
if let Some(event) = self.poll_event() {
153153
return event;
@@ -167,7 +167,7 @@ impl GlutinWindow {
167167
}
168168
}
169169

170-
fn wait_event_timeout(&mut self, timeout: Duration) -> Option<(Input, Option<TimeStamp>)> {
170+
fn wait_event_timeout(&mut self, timeout: Duration) -> Option<Event> {
171171
// First check for and handle any pending events.
172172
if let Some(event) = self.poll_event() {
173173
return Some(event);
@@ -190,14 +190,14 @@ impl GlutinWindow {
190190
self.poll_event()
191191
}
192192

193-
fn poll_event(&mut self) -> Option<(Input, Option<TimeStamp>)> {
193+
fn poll_event(&mut self) -> Option<Event> {
194194
use glutin::Event as E;
195195
use glutin::WindowEvent as WE;
196196

197197
// Loop to skip unknown events.
198198
loop {
199199
let event = self.pre_pop_front_event();
200-
if event.is_some() {return event.map(|x| (x, None));}
200+
if event.is_some() {return event.map(|x| Event::Input(x, None));}
201201

202202
if self.events.len() == 0 {
203203
let ref mut events = self.events;
@@ -225,7 +225,7 @@ impl GlutinWindow {
225225
let mut unknown = false;
226226
let event = self.handle_event(ev, &mut unknown);
227227
if unknown {continue};
228-
return event.map(|x| (x, None));
228+
return event.map(|x| Event::Input(x, None));
229229
}
230230
}
231231

@@ -442,11 +442,11 @@ impl Window for GlutinWindow {
442442
fn should_close(&self) -> bool { self.should_close }
443443
fn set_should_close(&mut self, value: bool) { self.should_close = value; }
444444
fn swap_buffers(&mut self) { let _ = self.ctx.swap_buffers(); }
445-
fn wait_event(&mut self) -> (Input, Option<TimeStamp>) { self.wait_event() }
446-
fn wait_event_timeout(&mut self, timeout: Duration) -> Option<(Input, Option<TimeStamp>)> {
445+
fn wait_event(&mut self) -> Event { self.wait_event() }
446+
fn wait_event_timeout(&mut self, timeout: Duration) -> Option<Event> {
447447
self.wait_event_timeout(timeout)
448448
}
449-
fn poll_event(&mut self) -> Option<(Input, Option<TimeStamp>)> { self.poll_event() }
449+
fn poll_event(&mut self) -> Option<Event> { self.poll_event() }
450450
}
451451

452452
impl BuildFromWindowSettings for GlutinWindow {

0 commit comments

Comments
 (0)