aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/glx
diff options
context:
space:
mode:
authorVictor Berger <victor.berger@m4x.org>2015-05-12 22:47:34 +0200
committerVictor Berger <victor.berger@m4x.org>2015-05-12 22:49:03 +0200
commit310b44f35be8146623d8e5fbbe380ae14f30de72 (patch)
tree8103ea05599c35ea2559f11ef4392702523c17a4 /src/api/glx
parent3279f15f9f0ff24c644479e73923a0cb64f99fda (diff)
downloadglutin-310b44f35be8146623d8e5fbbe380ae14f30de72.tar.gz
glutin-310b44f35be8146623d8e5fbbe380ae14f30de72.zip
Make platform::linux generic over X11 and Wayland.
Diffstat (limited to 'src/api/glx')
-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()