aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2015-07-19 15:04:13 +0200
committertomaka <pierre.krieger1708@gmail.com>2015-07-19 15:04:13 +0200
commit3ab8b68631aefa4b2e3de0646a90bca3fb697366 (patch)
treebedebb0d10a8fc82a23af4738a9a6a525e201694
parent896640f2e0fd659e952e492c1b74841624db8d08 (diff)
parent9299de025647a6b40cc699ed0728fe6b33ec980e (diff)
downloadglutin-3ab8b68631aefa4b2e3de0646a90bca3fb697366.tar.gz
glutin-3ab8b68631aefa4b2e3de0646a90bca3fb697366.zip
Merge pull request #528 from tomaka/fix-egl
Fix EGL context creation
-rw-r--r--src/api/egl/mod.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/api/egl/mod.rs b/src/api/egl/mod.rs
index 0cb6dbd..d22c009 100644
--- a/src/api/egl/mod.rs
+++ b/src/api/egl/mod.rs
@@ -472,9 +472,13 @@ unsafe fn create_context(egl: &ffi::egl::Egl, display: ffi::egl::types::EGLDispl
if egl_version >= &(1, 5) {
context_attributes.push(ffi::egl::CONTEXT_OPENGL_DEBUG as i32);
context_attributes.push(ffi::egl::TRUE as i32);
- } else {
- flags = flags | ffi::egl::CONTEXT_OPENGL_DEBUG_BIT_KHR as i32;
}
+
+ // TODO: using this flag sometimes generates an error
+ // there was a change in the specs that added this flag, so it may not be
+ // supported everywhere ; however it is not possible to know whether it is
+ // supported or not
+ //flags = flags | ffi::egl::CONTEXT_OPENGL_DEBUG_BIT_KHR as i32;
}
context_attributes.push(ffi::egl::CONTEXT_FLAGS_KHR as i32);
@@ -499,7 +503,10 @@ unsafe fn create_context(egl: &ffi::egl::Egl, display: ffi::egl::types::EGLDispl
context_attributes.as_ptr());
if context.is_null() {
- return Err(CreationError::NotSupported);
+ match egl.GetError() as u32 {
+ ffi::egl::BAD_ATTRIBUTE => return Err(CreationError::NotSupported),
+ e => panic!("eglCreateContext failed: 0x{:x}", e),
+ }
}
Ok(context)