aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTomaka17 <pierre.krieger1708@gmail.com>2014-11-05 15:22:21 +0100
committerTomaka17 <pierre.krieger1708@gmail.com>2014-11-05 15:32:01 +0100
commit7ce851dad9102c28ee2fd372ed9fd62e73364da9 (patch)
tree54f1b395234484522b34994b2d4ae36292d916af /src
parent2e44edea60a19919be467a1228ae971e7b988fec (diff)
downloadglutin-7ce851dad9102c28ee2fd372ed9fd62e73364da9.tar.gz
glutin-7ce851dad9102c28ee2fd372ed9fd62e73364da9.zip
Update for changes in gl-rs
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs16
-rw-r--r--src/win32/init.rs2
2 files changed, 17 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index f1f8d5a..a976da5 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -31,6 +31,8 @@
#[phase(plugin)] extern crate compile_msg;
#[phase(plugin)] extern crate gl_generator;
+
+extern crate gl_common;
extern crate libc;
#[cfg(target_os = "macos")]
@@ -397,6 +399,13 @@ impl Window {
}
}
+#[cfg(feature = "window")]
+impl gl_common::GlFunctionsSource for Window {
+ fn get_proc_addr(&self, addr: &str) -> *const libc::c_void {
+ self.get_proc_address(addr)
+ }
+}
+
/// Represents a headless OpenGL context.
#[cfg(feature = "headless")]
pub struct HeadlessContext {
@@ -421,6 +430,13 @@ impl HeadlessContext {
}
}
+#[cfg(feature = "headless")]
+impl gl_common::GlFunctionsSource for HeadlessContext {
+ fn get_proc_addr(&self, addr: &str) -> *const libc::c_void {
+ self.get_proc_address(addr)
+ }
+}
+
/// An iterator for the `poll_events` function.
// Implementation note: we retreive the list once, then serve each element by one by one.
// This may change in the future.
diff --git a/src/win32/init.rs b/src/win32/init.rs
index bf84973..73a6a6a 100644
--- a/src/win32/init.rs
+++ b/src/win32/init.rs
@@ -350,7 +350,7 @@ pub fn new_window(builder_dimensions: Option<(uint, uint)>, builder_title: Strin
if builder_vsync {
if extra_functions.SwapIntervalEXT.is_loaded() {
unsafe { ffi::wgl::MakeCurrent(hdc, context) };
- if extra_functions.SwapIntervalEXT(1) == 0 {
+ if unsafe { extra_functions.SwapIntervalEXT(1) } == 0 {
tx.send(Err(format!("wglSwapIntervalEXT failed")));
unsafe { ffi::wgl::DeleteContext(context); }
unsafe { ffi::DestroyWindow(real_window); }