mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 22:31:30 +11:00
Merge pull request #629 from tomaka/fix-win-vsync
Fix vsync being enabled even when disabled
This commit is contained in:
commit
dcd5c49b7f
|
@ -133,13 +133,11 @@ impl Context {
|
||||||
let gl_library = try!(load_opengl32_dll());
|
let gl_library = try!(load_opengl32_dll());
|
||||||
|
|
||||||
// handling vsync
|
// handling vsync
|
||||||
if opengl.vsync {
|
if extensions.split(' ').find(|&i| i == "WGL_EXT_swap_control").is_some() {
|
||||||
if extensions.split(' ').find(|&i| i == "WGL_EXT_swap_control").is_some() {
|
let _guard = try!(CurrentContextGuard::make_current(hdc, context.0));
|
||||||
let _guard = try!(CurrentContextGuard::make_current(hdc, context.0));
|
|
||||||
|
|
||||||
if extra_functions.SwapIntervalEXT(1) == 0 {
|
if extra_functions.SwapIntervalEXT(if opengl.vsync { 1 } else { 0 }) == 0 {
|
||||||
return Err(CreationError::OsError(format!("wglSwapIntervalEXT failed")));
|
return Err(CreationError::OsError(format!("wglSwapIntervalEXT failed")));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue