mirror of
https://github.com/rust-windowing/winit.git
synced 2026-09-02 06:40:06 -04:00
Merge pull request #172 from ozkriff/master
Removed 'extern crate gl_generator' and implemented 'poll_events'
This commit is contained in:
@@ -212,16 +212,6 @@ impl Window {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn poll_events(&self) -> Vec<Event> {
|
pub fn poll_events(&self) -> Vec<Event> {
|
||||||
use std::time::Duration;
|
|
||||||
use std::io::timer;
|
|
||||||
timer::sleep(Duration::milliseconds(16));
|
|
||||||
Vec::new()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn wait_events(&self) -> Vec<Event> {
|
|
||||||
use std::time::Duration;
|
|
||||||
use std::io::timer;
|
|
||||||
timer::sleep(Duration::milliseconds(16));
|
|
||||||
let mut events = Vec::new();
|
let mut events = Vec::new();
|
||||||
loop {
|
loop {
|
||||||
match self.event_rx.try_recv() {
|
match self.event_rx.try_recv() {
|
||||||
@@ -244,6 +234,13 @@ impl Window {
|
|||||||
events
|
events
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn wait_events(&self) -> Vec<Event> {
|
||||||
|
use std::time::Duration;
|
||||||
|
use std::io::timer;
|
||||||
|
timer::sleep(Duration::milliseconds(16));
|
||||||
|
self.poll_events()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn make_current(&self) {
|
pub fn make_current(&self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
ffi::egl::MakeCurrent(self.display, self.surface, self.surface, self.context);
|
ffi::egl::MakeCurrent(self.display, self.surface, self.surface, self.context);
|
||||||
|
|||||||
@@ -28,8 +28,6 @@
|
|||||||
//!
|
//!
|
||||||
//! By default only `window` is enabled.
|
//! By default only `window` is enabled.
|
||||||
|
|
||||||
#[phase(plugin)] extern crate gl_generator;
|
|
||||||
|
|
||||||
extern crate gl_common;
|
extern crate gl_common;
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user