diff options
Diffstat (limited to 'src/win32/init.rs')
-rw-r--r-- | src/win32/init.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/win32/init.rs b/src/win32/init.rs index 36bf639..ca99da8 100644 --- a/src/win32/init.rs +++ b/src/win32/init.rs @@ -16,7 +16,7 @@ local_data_key!(WINDOW: (ffi::HWND, Sender<Event>)) pub fn new_window(builder_dimensions: Option<(uint, uint)>, builder_title: String, builder_monitor: Option<super::MonitorID>, - builder_gl_version: Option<(uint, uint)>, + builder_gl_version: Option<(uint, uint)>, builder_vsync: bool, builder_headless: bool) -> Result<Window, String> { use std::mem; @@ -346,6 +346,14 @@ pub fn new_window(builder_dimensions: Option<(uint, uint)>, builder_title: Strin lib }; + // handling vsync + if builder_vsync { + if extra_functions.SwapIntervalEXT.is_loaded() { + unsafe { ffi::wgl::MakeCurrent(hdc, context) }; + extra_functions.SwapIntervalEXT(1); + } + } + // building the struct let window = Window{ window: real_window, |