diff options
author | tomaka <pierre.krieger1708@gmail.com> | 2015-07-21 17:49:52 +0200 |
---|---|---|
committer | tomaka <pierre.krieger1708@gmail.com> | 2015-07-21 17:49:52 +0200 |
commit | 04a651320ba00571a0b2af9ae25c6d6c696c2803 (patch) | |
tree | 7ba2cf8fbc9ebd9acb1f7854ee4bfef7a5028a44 /src/api/egl/mod.rs | |
parent | ca1eb8dc533301060e2b2768646b15d79c8be60c (diff) | |
parent | 7fe828bed3c1e01c0868d83eada0f2f36209c989 (diff) | |
download | glutin-04a651320ba00571a0b2af9ae25c6d6c696c2803.tar.gz glutin-04a651320ba00571a0b2af9ae25c6d6c696c2803.zip |
Merge pull request #532 from tomaka/precise-errors
Precise errors
Diffstat (limited to 'src/api/egl/mod.rs')
-rw-r--r-- | src/api/egl/mod.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/api/egl/mod.rs b/src/api/egl/mod.rs index d22c009..328a11e 100644 --- a/src/api/egl/mod.rs +++ b/src/api/egl/mod.rs @@ -68,7 +68,7 @@ impl Context { } else if egl.BindAPI(ffi::egl::OPENGL_ES_API) != 0 { (None, Api::OpenGlEs) } else { - return Err(CreationError::NotSupported); + return Err(CreationError::OpenGlVersionNotSupported); } } else { (None, Api::OpenGlEs) @@ -77,21 +77,21 @@ impl Context { GlRequest::Specific(Api::OpenGlEs, version) => { if egl_version >= (1, 2) { if egl.BindAPI(ffi::egl::OPENGL_ES_API) == 0 { - return Err(CreationError::NotSupported); + return Err(CreationError::OpenGlVersionNotSupported); } } (Some(version), Api::OpenGlEs) }, GlRequest::Specific(Api::OpenGl, version) => { if egl_version < (1, 4) { - return Err(CreationError::NotSupported); + return Err(CreationError::OpenGlVersionNotSupported); } if egl.BindAPI(ffi::egl::OPENGL_API) == 0 { - return Err(CreationError::NotSupported); + return Err(CreationError::OpenGlVersionNotSupported); } (Some(version), Api::OpenGl) }, - GlRequest::Specific(_, _) => return Err(CreationError::NotSupported), + GlRequest::Specific(_, _) => return Err(CreationError::OpenGlVersionNotSupported), GlRequest::GlThenGles { opengles_version, opengl_version } => { if egl_version >= (1, 4) { if egl.BindAPI(ffi::egl::OPENGL_API) != 0 { @@ -99,7 +99,7 @@ impl Context { } else if egl.BindAPI(ffi::egl::OPENGL_ES_API) != 0 { (Some(opengles_version), Api::OpenGlEs) } else { - return Err(CreationError::NotSupported); + return Err(CreationError::OpenGlVersionNotSupported); } } else { (Some(opengles_version), Api::OpenGlEs) @@ -245,7 +245,7 @@ impl<'a> ContextPrototype<'a> { { ctxt } else { - return Err(CreationError::NotSupported); + return Err(CreationError::OpenGlVersionNotSupported); } } else { @@ -267,7 +267,7 @@ impl<'a> ContextPrototype<'a> { { ctxt } else { - return Err(CreationError::NotSupported); + return Err(CreationError::OpenGlVersionNotSupported); } } }; @@ -434,7 +434,7 @@ unsafe fn create_context(egl: &ffi::egl::Egl, display: ffi::egl::types::EGLDispl context_attributes.push(ffi::egl::NO_RESET_NOTIFICATION as libc::c_int); flags = flags | ffi::egl::CONTEXT_OPENGL_ROBUST_ACCESS as libc::c_int; } else { - return Err(CreationError::NotSupported); + return Err(CreationError::RobustnessNotSupported); } }, @@ -454,7 +454,7 @@ unsafe fn create_context(egl: &ffi::egl::Egl, display: ffi::egl::types::EGLDispl context_attributes.push(ffi::egl::LOSE_CONTEXT_ON_RESET as libc::c_int); flags = flags | ffi::egl::CONTEXT_OPENGL_ROBUST_ACCESS as libc::c_int; } else { - return Err(CreationError::NotSupported); + return Err(CreationError::RobustnessNotSupported); } }, @@ -488,7 +488,7 @@ unsafe fn create_context(egl: &ffi::egl::Egl, display: ffi::egl::types::EGLDispl // robustness is not supported match gl_robustness { Robustness::RobustNoResetNotification | Robustness::RobustLoseContextOnReset => { - return Err(CreationError::NotSupported); + return Err(CreationError::RobustnessNotSupported); }, _ => () } @@ -504,7 +504,7 @@ unsafe fn create_context(egl: &ffi::egl::Egl, display: ffi::egl::types::EGLDispl if context.is_null() { match egl.GetError() as u32 { - ffi::egl::BAD_ATTRIBUTE => return Err(CreationError::NotSupported), + ffi::egl::BAD_ATTRIBUTE => return Err(CreationError::OpenGlVersionNotSupported), e => panic!("eglCreateContext failed: 0x{:x}", e), } } |