Introduce a WindowProxy for accessing a subset of functionality
from other threads. This currently provides a way for other threads to wakeup a blocked event loop on X11. Other platforms have stub functions that need to be implemented. This is similar to the functionality of glfwPostEmptyEvent.
This commit is contained in:
parent
19d120b8b1
commit
9dc5689eef
8 changed files with 171 additions and 52 deletions
|
|
@ -207,6 +207,10 @@ impl Window {
|
|||
pub fn set_inner_size(&self, _x: uint, _y: uint) {
|
||||
}
|
||||
|
||||
pub fn create_window_proxy(&self) -> WindowProxy {
|
||||
WindowProxy
|
||||
}
|
||||
|
||||
pub fn poll_events(&self) -> Vec<Event> {
|
||||
use std::time::Duration;
|
||||
use std::io::timer;
|
||||
|
|
@ -271,6 +275,16 @@ impl Window {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "window")]
|
||||
#[deriving(Clone)]
|
||||
pub struct WindowProxy;
|
||||
|
||||
impl WindowProxy {
|
||||
pub fn wakeup_event_loop(&self) {
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for Window {
|
||||
fn drop(&mut self) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue