aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/x11
diff options
context:
space:
mode:
authorPierre Krieger <pierre.krieger1708@gmail.com>2015-06-16 10:15:31 +0200
committerPierre Krieger <pierre.krieger1708@gmail.com>2015-06-16 10:44:44 +0200
commitf6c26ec593ba96d89cb3476c815d6f33a915bfdd (patch)
treecc204a0cdfed5c3431f1e26cc2da10048d8c3474 /src/api/x11
parente48c853b9c7a617bf8ba5f31b5fb2088c90c0ee7 (diff)
downloadglutin-f6c26ec593ba96d89cb3476c815d6f33a915bfdd.tar.gz
glutin-f6c26ec593ba96d89cb3476c815d6f33a915bfdd.zip
Handle errors from MakeCurrent and SwapBuffers
Diffstat (limited to 'src/api/x11')
-rw-r--r--src/api/x11/window.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/api/x11/window.rs b/src/api/x11/window.rs
index ba0fe52..c0c5917 100644
--- a/src/api/x11/window.rs
+++ b/src/api/x11/window.rs
@@ -9,6 +9,7 @@ use std::collections::VecDeque;
use std::sync::{Arc, Mutex};
use Api;
+use ContextError;
use CursorState;
use GlContext;
use GlRequest;
@@ -800,11 +801,11 @@ impl Window {
}
impl GlContext for Window {
- unsafe fn make_current(&self) {
+ unsafe fn make_current(&self) -> Result<(), ContextError> {
match self.x.context {
Context::Glx(ref ctxt) => ctxt.make_current(),
Context::Egl(ref ctxt) => ctxt.make_current(),
- Context::None => {}
+ Context::None => Ok(())
}
}
@@ -824,11 +825,11 @@ impl GlContext for Window {
}
}
- fn swap_buffers(&self) {
+ fn swap_buffers(&self) -> Result<(), ContextError> {
match self.x.context {
Context::Glx(ref ctxt) => ctxt.swap_buffers(),
Context::Egl(ref ctxt) => ctxt.swap_buffers(),
- Context::None => {}
+ Context::None => Ok(())
}
}