mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-25 06:41:31 +11:00
android: Updated for Rust be9bd7c93 2015-04-05
This commit is contained in:
parent
4d0472f7d8
commit
65c2884dc3
|
@ -120,9 +120,6 @@ impl<'a> Iterator for WaitEventsIterator<'a> {
|
|||
type Item = Event;
|
||||
|
||||
fn next(&mut self) -> Option<Event> {
|
||||
use std::time::Duration;
|
||||
use std::old_io::timer;
|
||||
|
||||
loop {
|
||||
// calling poll_events()
|
||||
if let Some(ev) = self.window.poll_events().next() {
|
||||
|
@ -130,7 +127,7 @@ impl<'a> Iterator for WaitEventsIterator<'a> {
|
|||
}
|
||||
|
||||
// TODO: Implement a proper way of sleeping on the event queue
|
||||
timer::sleep(Duration::milliseconds(16));
|
||||
// timer::sleep(Duration::milliseconds(16));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -182,10 +179,8 @@ impl Window {
|
|||
let mut attribute_list = vec!();
|
||||
|
||||
if use_gles2 {
|
||||
attribute_list.push_all(&[
|
||||
ffi::egl::RENDERABLE_TYPE as i32,
|
||||
ffi::egl::OPENGL_ES2_BIT as i32,
|
||||
]);
|
||||
attribute_list.push(ffi::egl::RENDERABLE_TYPE as i32);
|
||||
attribute_list.push(ffi::egl::OPENGL_ES2_BIT as i32);
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -194,15 +189,16 @@ impl Window {
|
|||
16 => (6, 5, 6),
|
||||
_ => panic!("Bad color_bits"),
|
||||
};
|
||||
attribute_list.push_all(&[ffi::egl::RED_SIZE as i32, red]);
|
||||
attribute_list.push_all(&[ffi::egl::GREEN_SIZE as i32, green]);
|
||||
attribute_list.push_all(&[ffi::egl::BLUE_SIZE as i32, blue]);
|
||||
attribute_list.push(ffi::egl::RED_SIZE as i32);
|
||||
attribute_list.push(red);
|
||||
attribute_list.push(ffi::egl::GREEN_SIZE as i32);
|
||||
attribute_list.push(green);
|
||||
attribute_list.push(ffi::egl::BLUE_SIZE as i32);
|
||||
attribute_list.push(blue);
|
||||
}
|
||||
|
||||
attribute_list.push_all(&[
|
||||
ffi::egl::DEPTH_SIZE as i32,
|
||||
builder.depth_bits.unwrap_or(8) as i32,
|
||||
]);
|
||||
attribute_list.push(ffi::egl::DEPTH_SIZE as i32);
|
||||
attribute_list.push(builder.depth_bits.unwrap_or(8) as i32);
|
||||
|
||||
attribute_list.push(ffi::egl::NONE as i32);
|
||||
|
||||
|
@ -227,7 +223,8 @@ impl Window {
|
|||
let context = unsafe {
|
||||
let mut context_attributes = vec!();
|
||||
if use_gles2 {
|
||||
context_attributes.push_all(&[ffi::egl::CONTEXT_CLIENT_VERSION as i32, 2]);
|
||||
context_attributes.push(ffi::egl::CONTEXT_CLIENT_VERSION as i32);
|
||||
context_attributes.push(2);
|
||||
}
|
||||
context_attributes.push(ffi::egl::NONE as i32);
|
||||
|
||||
|
@ -329,7 +326,7 @@ impl Window {
|
|||
}
|
||||
|
||||
pub fn get_proc_address(&self, addr: &str) -> *const () {
|
||||
let addr = CString::from_slice(addr.as_bytes());
|
||||
let addr = CString::new(addr.as_bytes()).unwrap();
|
||||
let addr = addr.as_ptr();
|
||||
unsafe {
|
||||
ffi::egl::GetProcAddress(addr) as *const ()
|
||||
|
|
Loading…
Reference in a new issue