mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-23 22:01:31 +11:00
parent
da5e372719
commit
61781cf209
|
@ -717,6 +717,9 @@ extern "system" {
|
|||
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms633519(v=vs.85).aspx
|
||||
pub fn GetWindowRect(hWnd: HWND, lpRect: *mut RECT) -> BOOL;
|
||||
|
||||
//
|
||||
pub fn glViewport(x: libc::c_int, y: libc::c_int, w: libc::c_int, h: libc::c_int);
|
||||
|
||||
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms684175(v=vs.85).aspx
|
||||
pub fn LoadLibraryW(lpFileName: LPCWSTR) -> HMODULE;
|
||||
|
||||
|
|
|
@ -323,14 +323,25 @@ pub fn new_window(builder: WindowBuilder) -> Result<Window, String> {
|
|||
};
|
||||
|
||||
// building the struct
|
||||
tx.send(Ok(Window{
|
||||
let window = Window{
|
||||
window: real_window,
|
||||
hdc: hdc,
|
||||
context: context,
|
||||
gl_library: gl_library,
|
||||
events_receiver: events_receiver,
|
||||
is_closed: AtomicBool::new(false),
|
||||
}));
|
||||
};
|
||||
|
||||
// calling glViewport
|
||||
unsafe {
|
||||
use libc;
|
||||
let dimensions = window.get_inner_size().unwrap();
|
||||
ffi::glViewport(0, 0, dimensions.val0() as libc::c_int,
|
||||
dimensions.val1() as libc::c_int);
|
||||
}
|
||||
|
||||
// sending
|
||||
tx.send(Ok(window));
|
||||
|
||||
// now that the `Window` struct is initialized, the main `Window::new()` function will
|
||||
// return and this events loop will run in parallel
|
||||
|
|
Loading…
Reference in a new issue