aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/win32
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2015-06-17 07:36:16 +0200
committertomaka <pierre.krieger1708@gmail.com>2015-06-17 07:36:16 +0200
commit7773996d7b103e4e057cd547c0666e5d5834416f (patch)
tree292b9dc3717c10b9435b14b04b0a590b8b524ac3 /src/api/win32
parent90b28c205219df732d83e403f98abab31e6e52d4 (diff)
parent39128dd7e11ffa05eb06933cb6e3ce0e750e8806 (diff)
downloadglutin-7773996d7b103e4e057cd547c0666e5d5834416f.tar.gz
glutin-7773996d7b103e4e057cd547c0666e5d5834416f.zip
Merge pull request #488 from tomaka/rem-is-closed
Remove the is_closed function
Diffstat (limited to 'src/api/win32')
-rw-r--r--src/api/win32/init.rs1
-rw-r--r--src/api/win32/mod.rs33
2 files changed, 2 insertions, 32 deletions
diff --git a/src/api/win32/init.rs b/src/api/win32/init.rs
index f46c395..7cb5433 100644
--- a/src/api/win32/init.rs
+++ b/src/api/win32/init.rs
@@ -257,7 +257,6 @@ unsafe fn init(title: Vec<u16>, builder: BuilderAttribs<'static>,
window: real_window,
context: context,
events_receiver: events_receiver,
- is_closed: AtomicBool::new(false),
cursor_state: cursor_state,
})
}
diff --git a/src/api/win32/mod.rs b/src/api/win32/mod.rs
index 9efdc93..d21f16d 100644
--- a/src/api/win32/mod.rs
+++ b/src/api/win32/mod.rs
@@ -48,9 +48,6 @@ pub struct Window {
/// Receiver for the events dispatched by the window callback.
events_receiver: Receiver<Event>,
- /// True if a `Closed` event has been received.
- is_closed: AtomicBool,
-
/// The current cursor state.
cursor_state: Arc<Mutex<CursorState>>,
}
@@ -99,12 +96,6 @@ impl Window {
}
/// See the docs in the crate root file.
- pub fn is_closed(&self) -> bool {
- use std::sync::atomic::Ordering::Relaxed;
- self.is_closed.load(Relaxed)
- }
-
- /// See the docs in the crate root file.
///
/// Calls SetWindowText on the HWND.
pub fn set_title(&self, text: &str) {
@@ -367,17 +358,7 @@ impl<'a> Iterator for PollEventsIterator<'a> {
type Item = Event;
fn next(&mut self) -> Option<Event> {
- use events::Event::Closed;
-
- match self.window.events_receiver.try_recv() {
- Ok(Closed) => {
- use std::sync::atomic::Ordering::Relaxed;
- self.window.is_closed.store(true, Relaxed);
- Some(Closed)
- },
- Ok(ev) => Some(ev),
- Err(_) => None
- }
+ self.window.events_receiver.try_recv().ok()
}
}
@@ -389,17 +370,7 @@ impl<'a> Iterator for WaitEventsIterator<'a> {
type Item = Event;
fn next(&mut self) -> Option<Event> {
- use events::Event::Closed;
-
- match self.window.events_receiver.recv() {
- Ok(Closed) => {
- use std::sync::atomic::Ordering::Relaxed;
- self.window.is_closed.store(true, Relaxed);
- Some(Closed)
- },
- Ok(ev) => Some(ev),
- Err(_) => None
- }
+ self.window.events_receiver.recv().ok()
}
}