aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPierre Krieger <pierre.krieger1708@gmail.com>2015-05-20 18:46:10 +0200
committerPierre Krieger <pierre.krieger1708@gmail.com>2015-05-24 09:10:45 +0200
commit9117bcf3d3f441c86c85b04ce54e135d28fcb2e1 (patch)
tree300996b7cb0e58aff01f390da77c76d94b3a8c5c /src
parent81314f91d82dff07f6da3409dd1280a68d4dcd60 (diff)
downloadglutin-9117bcf3d3f441c86c85b04ce54e135d28fcb2e1.tar.gz
glutin-9117bcf3d3f441c86c85b04ce54e135d28fcb2e1.zip
Switch to dwmapi
Diffstat (limited to 'src')
-rw-r--r--src/api/win32/init.rs12
-rw-r--r--src/lib.rs2
2 files changed, 5 insertions, 9 deletions
diff --git a/src/api/win32/init.rs b/src/api/win32/init.rs
index 1252354..f46c395 100644
--- a/src/api/win32/init.rs
+++ b/src/api/win32/init.rs
@@ -25,6 +25,7 @@ use std::sync::mpsc::channel;
use winapi;
use kernel32;
+use dwmapi;
use user32;
use api::wgl;
@@ -223,15 +224,8 @@ unsafe fn init(title: Vec<u16>, builder: BuilderAttribs<'static>,
fTransitionOnMaximized: 0,
};
- let dll = kernel32::LoadLibraryA(b"dwmapi.dll\0".as_ptr() as *const _);
- if !dll.is_null() {
- let pr = kernel32::GetProcAddress(dll, b"DwmEnableBlurBehindWindow\0".as_ptr() as *const _);
- if !pr.is_null() {
- let pr: unsafe extern "system" fn(winapi::HWND, *const winapi::DWM_BLURBEHIND)
- -> winapi::HRESULT = mem::transmute(pr);
- pr(real_window.0, &bb);
- }
- kernel32::FreeLibrary(dll);
+ unsafe {
+ dwmapi::DwmEnableBlurBehindWindow(real_window.0, &bb);
}
}
diff --git a/src/lib.rs b/src/lib.rs
index d2aaf46..612206e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -40,6 +40,8 @@ extern crate kernel32;
extern crate gdi32;
#[cfg(target_os = "windows")]
extern crate user32;
+#[cfg(target_os = "windows")]
+extern crate dwmapi;
#[cfg(target_os = "macos")]
#[macro_use]
extern crate objc;