aboutsummaryrefslogtreecommitdiffstats
path: root/src/api
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2015-10-08 16:32:10 +0200
committertomaka <pierre.krieger1708@gmail.com>2015-10-08 16:32:10 +0200
commitdcd5c49b7f479c10004c54623c73cdb4434498a8 (patch)
tree612fe9a86ad6d6a7d6d8d13b01775b7abe17a22e /src/api
parent760f9d5fc5e7349c94b14da38e146301a9c671de (diff)
parent0c1f15f8425d55a67004b7e0ebf8e6cb5a6481f5 (diff)
downloadglutin-dcd5c49b7f479c10004c54623c73cdb4434498a8.tar.gz
glutin-dcd5c49b7f479c10004c54623c73cdb4434498a8.zip
Merge pull request #629 from tomaka/fix-win-vsync
Fix vsync being enabled even when disabled
Diffstat (limited to 'src/api')
-rw-r--r--src/api/wgl/mod.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/api/wgl/mod.rs b/src/api/wgl/mod.rs
index e118931..f064931 100644
--- a/src/api/wgl/mod.rs
+++ b/src/api/wgl/mod.rs
@@ -133,13 +133,11 @@ impl Context {
let gl_library = try!(load_opengl32_dll());
// handling vsync
- if opengl.vsync {
- if extensions.split(' ').find(|&i| i == "WGL_EXT_swap_control").is_some() {
- let _guard = try!(CurrentContextGuard::make_current(hdc, context.0));
+ if extensions.split(' ').find(|&i| i == "WGL_EXT_swap_control").is_some() {
+ let _guard = try!(CurrentContextGuard::make_current(hdc, context.0));
- if extra_functions.SwapIntervalEXT(1) == 0 {
- return Err(CreationError::OsError(format!("wglSwapIntervalEXT failed")));
- }
+ if extra_functions.SwapIntervalEXT(if opengl.vsync { 1 } else { 0 }) == 0 {
+ return Err(CreationError::OsError(format!("wglSwapIntervalEXT failed")));
}
}