aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Krieger <pierre.krieger1708@gmail.com>2015-07-20 19:34:34 +0200
committerPierre Krieger <pierre.krieger1708@gmail.com>2015-07-20 19:34:34 +0200
commitba5adfa1e13e8be0dec888b3fbcb54fd30a9a673 (patch)
tree231965fb1e033d15a5e331c0eab38022fadfd7ce
parentca1eb8dc533301060e2b2768646b15d79c8be60c (diff)
downloadglutin-ba5adfa1e13e8be0dec888b3fbcb54fd30a9a673.tar.gz
glutin-ba5adfa1e13e8be0dec888b3fbcb54fd30a9a673.zip
Add CreationError::RobustnessNotSupported
-rw-r--r--src/api/cocoa/mod.rs2
-rw-r--r--src/api/egl/mod.rs6
-rw-r--r--src/api/glx/mod.rs2
-rw-r--r--src/api/osmesa/mod.rs2
-rw-r--r--src/api/wgl/mod.rs2
-rw-r--r--src/lib.rs3
6 files changed, 10 insertions, 7 deletions
diff --git a/src/api/cocoa/mod.rs b/src/api/cocoa/mod.rs
index 332244e..680c621 100644
--- a/src/api/cocoa/mod.rs
+++ b/src/api/cocoa/mod.rs
@@ -335,7 +335,7 @@ impl Window {
match builder.gl_robustness {
Robustness::RobustNoResetNotification | Robustness::RobustLoseContextOnReset => {
- return Err(CreationError::NotSupported);
+ return Err(CreationError::RobustnessNotSupported);
},
_ => ()
}
diff --git a/src/api/egl/mod.rs b/src/api/egl/mod.rs
index d22c009..3d6d681 100644
--- a/src/api/egl/mod.rs
+++ b/src/api/egl/mod.rs
@@ -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);
},
_ => ()
}
diff --git a/src/api/glx/mod.rs b/src/api/glx/mod.rs
index e0adde7..753bd74 100644
--- a/src/api/glx/mod.rs
+++ b/src/api/glx/mod.rs
@@ -301,7 +301,7 @@ fn create_context(glx: &ffi::glx::Glx, extra_functions: &ffi::glx_extra::Glx, ex
} else {
match robustness {
Robustness::RobustNoResetNotification | Robustness::RobustLoseContextOnReset => {
- return Err(CreationError::NotSupported);
+ return Err(CreationError::RobustnessNotSupported);
},
_ => ()
}
diff --git a/src/api/osmesa/mod.rs b/src/api/osmesa/mod.rs
index db0a1e7..15225b3 100644
--- a/src/api/osmesa/mod.rs
+++ b/src/api/osmesa/mod.rs
@@ -41,7 +41,7 @@ impl OsMesaContext {
match builder.gl_robustness {
Robustness::RobustNoResetNotification | Robustness::RobustLoseContextOnReset => {
- return Err(CreationError::NotSupported.into());
+ return Err(CreationError::RobustnessNotSupported.into());
},
_ => ()
}
diff --git a/src/api/wgl/mod.rs b/src/api/wgl/mod.rs
index 222620c..a90baff 100644
--- a/src/api/wgl/mod.rs
+++ b/src/api/wgl/mod.rs
@@ -290,7 +290,7 @@ unsafe fn create_context(extra: Option<(&gl::wgl_extra::Wgl, &BuilderAttribs<'st
} else {
match builder.gl_robustness {
Robustness::RobustNoResetNotification | Robustness::RobustLoseContextOnReset => {
- return Err(CreationError::NotSupported);
+ return Err(CreationError::RobustnessNotSupported);
},
_ => ()
}
diff --git a/src/lib.rs b/src/lib.rs
index d43dcfb..d5f563a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -109,6 +109,7 @@ pub trait GlContext {
pub enum CreationError {
OsError(String),
NotSupported,
+ RobustnessNotSupported,
}
impl CreationError {
@@ -116,6 +117,8 @@ impl CreationError {
match *self {
CreationError::OsError(ref text) => &text,
CreationError::NotSupported => "Some of the requested attributes are not supported",
+ CreationError::RobustnessNotSupported => "Your requested robustness, but it is \
+ not supported.",
}
}
}