mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-30 21:30:03 -04:00
Switch EGL to use only pf_reqs and opengl
This commit is contained in:
@@ -349,6 +349,7 @@ impl Window {
|
||||
Egl(::api::egl::ContextPrototype<'a>),
|
||||
}
|
||||
let builder_clone = builder.clone();
|
||||
let builder_clone_opengl = builder_clone.opengl.clone().map_sharing(|_| unimplemented!());
|
||||
let context = match builder.opengl.version {
|
||||
GlRequest::Latest | GlRequest::Specific(Api::OpenGl, _) | GlRequest::GlThenGles { .. } => {
|
||||
// GLX should be preferred over EGL, otherwise crashes may occur
|
||||
@@ -356,14 +357,14 @@ impl Window {
|
||||
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 _)))))
|
||||
Prototype::Egl(try!(EglContext::new(egl.clone(), &builder_clone.pf_reqs, &builder_clone_opengl, egl::NativeDisplay::X11(Some(display.display as *const _)))))
|
||||
} else {
|
||||
return Err(CreationError::NotSupported);
|
||||
}
|
||||
},
|
||||
GlRequest::Specific(Api::OpenGlEs, _) => {
|
||||
if let Some(ref egl) = display.egl {
|
||||
Prototype::Egl(try!(EglContext::new(egl.clone(), &builder_clone, egl::NativeDisplay::X11(Some(display.display as *const _)))))
|
||||
Prototype::Egl(try!(EglContext::new(egl.clone(), &builder_clone.pf_reqs, &builder_clone_opengl, egl::NativeDisplay::X11(Some(display.display as *const _)))))
|
||||
} else {
|
||||
return Err(CreationError::NotSupported);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user