mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 06:11:30 +11:00
parent
e567d7f4fd
commit
01fd8b1d9e
|
@ -228,8 +228,8 @@ impl Window {
|
||||||
context
|
context
|
||||||
};
|
};
|
||||||
|
|
||||||
// returning
|
// creating the window object
|
||||||
Ok(Window{
|
let window = Window {
|
||||||
display: display,
|
display: display,
|
||||||
window: window,
|
window: window,
|
||||||
im: im,
|
im: im,
|
||||||
|
@ -237,7 +237,20 @@ impl Window {
|
||||||
context: context,
|
context: context,
|
||||||
is_closed: AtomicBool::new(false),
|
is_closed: AtomicBool::new(false),
|
||||||
wm_delete_window: wm_delete_window,
|
wm_delete_window: wm_delete_window,
|
||||||
})
|
};
|
||||||
|
|
||||||
|
// calling glViewport
|
||||||
|
unsafe {
|
||||||
|
let ptr = window.get_proc_address("glViewport");
|
||||||
|
assert!(!ptr.is_null());
|
||||||
|
let ptr: extern "system" fn(libc::c_int, libc::c_int, libc::c_int, libc::c_int) =
|
||||||
|
mem::transmute(ptr);
|
||||||
|
let dimensions = window.get_inner_size().unwrap();
|
||||||
|
ptr(0, 0, dimensions.val0() as libc::c_int, dimensions.val1() as libc::c_int);
|
||||||
|
}
|
||||||
|
|
||||||
|
// returning
|
||||||
|
Ok(window)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_closed(&self) -> bool {
|
pub fn is_closed(&self) -> bool {
|
||||||
|
|
Loading…
Reference in a new issue