aboutsummaryrefslogtreecommitdiffstats
path: root/src/win32/mod.rs
diff options
context:
space:
mode:
authorTomaka17 <pierre.krieger1708@gmail.com>2014-09-12 15:51:43 +0200
committerTomaka17 <pierre.krieger1708@gmail.com>2014-09-12 15:51:43 +0200
commit2af367b55caf948ec254c0ffabda8c6263d01690 (patch)
tree3702b0bd6278f2537298f37213d9ea1c68599e5b /src/win32/mod.rs
parent3043cb2848e1eb1c45fc1f534d2696371faddfc6 (diff)
downloadglutin-2af367b55caf948ec254c0ffabda8c6263d01690.tar.gz
glutin-2af367b55caf948ec254c0ffabda8c6263d01690.zip
Use the gl_generator macro to generate the bindings for WGL
Diffstat (limited to 'src/win32/mod.rs')
-rw-r--r--src/win32/mod.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/win32/mod.rs b/src/win32/mod.rs
index cf889cb..faff374 100644
--- a/src/win32/mod.rs
+++ b/src/win32/mod.rs
@@ -75,7 +75,7 @@ impl Window {
use libc;
unsafe {
- ffi::SetWindowPos(self.window, ptr::mut_null(), x as libc::c_int, y as libc::c_int,
+ ffi::SetWindowPos(self.window, ptr::null(), x as libc::c_int, y as libc::c_int,
0, 0, ffi::SWP_NOZORDER | ffi::SWP_NOSIZE);
ffi::UpdateWindow(self.window);
}
@@ -116,7 +116,7 @@ impl Window {
use libc;
unsafe {
- ffi::SetWindowPos(self.window, ptr::mut_null(), 0, 0, x as libc::c_int,
+ ffi::SetWindowPos(self.window, ptr::null(), 0, 0, x as libc::c_int,
y as libc::c_int, ffi::SWP_NOZORDER | ffi::SWP_NOREPOSITION);
ffi::UpdateWindow(self.window);
}
@@ -172,7 +172,8 @@ impl Window {
/// See the docs in the crate root file.
pub unsafe fn make_current(&self) {
- ffi::wglMakeCurrent(self.hdc, self.context)
+ // TODO: check return value
+ ffi::wgl::MakeCurrent(self.hdc, self.context);
}
/// See the docs in the crate root file.
@@ -181,7 +182,7 @@ impl Window {
unsafe {
addr.with_c_str(|s| {
- let p = ffi::wglGetProcAddress(s) as *const ();
+ let p = ffi::wgl::GetProcAddress(s) as *const ();
if !p.is_null() { return p; }
ffi::GetProcAddress(self.gl_library, s) as *const ()
})
@@ -203,8 +204,8 @@ impl Window {
impl Drop for Window {
fn drop(&mut self) {
use std::ptr;
- unsafe { ffi::wglMakeCurrent(ptr::mut_null(), ptr::mut_null()); }
- unsafe { ffi::wglDeleteContext(self.context); }
+ unsafe { ffi::wgl::MakeCurrent(ptr::null(), ptr::null()); }
+ unsafe { ffi::wgl::DeleteContext(self.context); }
unsafe { ffi::DestroyWindow(self.window); }
}
}