aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/caca/mod.rs
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2015-05-04 10:40:25 +0200
committertomaka <pierre.krieger1708@gmail.com>2015-05-04 10:40:25 +0200
commit01007dbfd4b5f98a03b660e9c76f1d01fb78cd22 (patch)
tree82698fd27ad9bcc48b384f54fea172cf683cee78 /src/api/caca/mod.rs
parentf0309cb16588da65268fdfe959ad70fe28702054 (diff)
parentace4808facf085c4ccd068d33b9ab9f018e9072e (diff)
downloadglutin-01007dbfd4b5f98a03b660e9c76f1d01fb78cd22.tar.gz
glutin-01007dbfd4b5f98a03b660e9c76f1d01fb78cd22.zip
Merge pull request #423 from tomaka/remove-headless
Remove the "headless" feature
Diffstat (limited to 'src/api/caca/mod.rs')
-rw-r--r--src/api/caca/mod.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/api/caca/mod.rs b/src/api/caca/mod.rs
index da7810a..1e3840c 100644
--- a/src/api/caca/mod.rs
+++ b/src/api/caca/mod.rs
@@ -1,7 +1,7 @@
-#![cfg(all(any(target_os = "linux", target_os = "freebsd"), feature="headless"))]
+#![cfg(any(target_os = "linux", target_os = "freebsd"))]
use libc;
-use api::osmesa::OsMesaContext;
+use api::osmesa::{OsMesaContext, OsMesaCreationError};
use Api;
use BuilderAttribs;
@@ -83,7 +83,12 @@ impl<'a> Iterator for WaitEventsIterator<'a> {
impl Window {
pub fn new(builder: BuilderAttribs) -> Result<Window, CreationError> {
- let opengl = try!(OsMesaContext::new(builder));
+ let opengl = match OsMesaContext::new(builder) {
+ Err(OsMesaCreationError::NotSupported) => return Err(CreationError::NotSupported),
+ Err(OsMesaCreationError::CreationError(e)) => return Err(e),
+ Ok(c) => c
+ };
+
let opengl_dimensions = opengl.get_dimensions();
let libcaca = match ffi::LibCaca::open(&Path::new("libcaca.so.0")) {