aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/glx/mod.rs
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2015-05-13 07:20:40 +0200
committertomaka <pierre.krieger1708@gmail.com>2015-05-13 07:20:40 +0200
commit41af4406cbf88869ecf687ef536cb902e5f1ebd1 (patch)
tree11cb79dcd1fde140434918b740a95badcdc2548c /src/api/glx/mod.rs
parentea20580719e0d89296f133dfb5285b99d19b1310 (diff)
parent9a144a6869a12e25dc4685fdf7ee86feb2bdf078 (diff)
downloadglutin-41af4406cbf88869ecf687ef536cb902e5f1ebd1.tar.gz
glutin-41af4406cbf88869ecf687ef536cb902e5f1ebd1.zip
Merge pull request #448 from vberger/x-wayland-split
Make platform::linux generic over X11 and Wayland
Diffstat (limited to 'src/api/glx/mod.rs')
-rw-r--r--src/api/glx/mod.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/api/glx/mod.rs b/src/api/glx/mod.rs
index 9cda90e..3c0c8a0 100644
--- a/src/api/glx/mod.rs
+++ b/src/api/glx/mod.rs
@@ -14,6 +14,8 @@ use std::{mem, ptr};
use api::x11::ffi;
+use platform::Window as PlatformWindow;
+
pub struct Context {
glx: ffi::glx::Glx,
display: *mut ffi::Display,
@@ -80,9 +82,12 @@ impl Context {
});
let share = if let Some(win) = builder.sharing {
- match win.x.context {
- ::api::x11::Context::Glx(ref c) => c.context,
- _ => panic!("Cannot share contexts between different APIs")
+ match win {
+ &PlatformWindow::X(ref win) => match win.x.context {
+ ::api::x11::Context::Glx(ref c) => c.context,
+ _ => panic!("Cannot share contexts between different APIs")
+ },
+ _ => panic!("Cannot use glx on a non-X11 window.")
}
} else {
ptr::null()