aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2015-07-21 17:49:52 +0200
committertomaka <pierre.krieger1708@gmail.com>2015-07-21 17:49:52 +0200
commit04a651320ba00571a0b2af9ae25c6d6c696c2803 (patch)
tree7ba2cf8fbc9ebd9acb1f7854ee4bfef7a5028a44 /src/lib.rs
parentca1eb8dc533301060e2b2768646b15d79c8be60c (diff)
parent7fe828bed3c1e01c0868d83eada0f2f36209c989 (diff)
downloadglutin-04a651320ba00571a0b2af9ae25c6d6c696c2803.tar.gz
glutin-04a651320ba00571a0b2af9ae25c6d6c696c2803.zip
Merge pull request #532 from tomaka/precise-errors
Precise errors
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index d43dcfb..9821c9f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -108,7 +108,11 @@ pub trait GlContext {
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum CreationError {
OsError(String),
+ /// TODO: remove this error
NotSupported,
+ RobustnessNotSupported,
+ OpenGlVersionNotSupported,
+ NoAvailablePixelFormat,
}
impl CreationError {
@@ -116,6 +120,12 @@ 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.",
+ CreationError::OpenGlVersionNotSupported => "The requested OpenGL version is not \
+ supported.",
+ CreationError::NoAvailablePixelFormat => "Couldn't find any pixel format that matches \
+ the criterias.",
}
}
}
@@ -465,7 +475,7 @@ impl<'a> BuilderAttribs<'a> {
}
current_result.or(current_software_result)
- .ok_or(CreationError::NotSupported)
+ .ok_or(CreationError::NoAvailablePixelFormat)
}
}