mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-11 21:31:29 +11:00
Bugfix in swap interval for win32
This commit is contained in:
parent
a6bc0b0ba0
commit
f7a50c162c
|
@ -350,7 +350,16 @@ pub fn new_window(builder_dimensions: Option<(uint, uint)>, builder_title: Strin
|
||||||
if builder_vsync {
|
if builder_vsync {
|
||||||
if extra_functions.SwapIntervalEXT.is_loaded() {
|
if extra_functions.SwapIntervalEXT.is_loaded() {
|
||||||
unsafe { ffi::wgl::MakeCurrent(hdc, context) };
|
unsafe { ffi::wgl::MakeCurrent(hdc, context) };
|
||||||
extra_functions.SwapIntervalEXT(1);
|
if extra_functions.SwapIntervalEXT(1) == 0 {
|
||||||
|
tx.send(Err(format!("wglSwapIntervalEXT failed")));
|
||||||
|
unsafe { ffi::wgl::DeleteContext(context); }
|
||||||
|
unsafe { ffi::DestroyWindow(real_window); }
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// it is important to remove the current context, otherwise you get very weird
|
||||||
|
// errors
|
||||||
|
unsafe { ffi::wgl::MakeCurrent(ptr::null(), ptr::null()); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue