diff options
author | tomaka <pierre.krieger1708@gmail.com> | 2015-08-14 21:46:51 +0200 |
---|---|---|
committer | tomaka <pierre.krieger1708@gmail.com> | 2015-08-14 21:46:51 +0200 |
commit | c5d11ebca2159cbd6e67b018997a2587d202f0ce (patch) | |
tree | 6640a550e4471be961214bd578b783de99ae96cb /src/api | |
parent | 5c60456e16b118f2d2cbbe5344fa887cbeb59cc8 (diff) | |
parent | 6c73209746331f1fe3bac402b58c1702798f7e62 (diff) | |
download | glutin-c5d11ebca2159cbd6e67b018997a2587d202f0ce.tar.gz glutin-c5d11ebca2159cbd6e67b018997a2587d202f0ce.zip |
Merge pull request #569 from zetok/glx
Prefer GLX over EGL
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/x11/window.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/api/x11/window.rs b/src/api/x11/window.rs index f6f944d..36b60e4 100644 --- a/src/api/x11/window.rs +++ b/src/api/x11/window.rs @@ -351,10 +351,12 @@ impl Window { let builder_clone = builder.clone(); let context = match builder.gl_version { GlRequest::Latest | GlRequest::Specific(Api::OpenGl, _) | GlRequest::GlThenGles { .. } => { - if let Some(ref egl) = display.egl { - Prototype::Egl(try!(EglContext::new(egl.clone(), &builder_clone, egl::NativeDisplay::X11(Some(display.display as *const _))))) - } else if let Some(ref glx) = display.glx { + // GLX should be preferred over EGL, otherwise crashes may occur + // on X11 – issue #314 + if let Some(ref glx) = display.glx { Prototype::Glx(try!(GlxContext::new(glx.clone(), &display.xlib, &builder_clone, display.display))) + } else if let Some(ref egl) = display.egl { + Prototype::Egl(try!(EglContext::new(egl.clone(), &builder_clone, egl::NativeDisplay::X11(Some(display.display as *const _))))) } else { return Err(CreationError::NotSupported); } |