From f6c26ec593ba96d89cb3476c815d6f33a915bfdd Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Tue, 16 Jun 2015 10:15:31 +0200 Subject: Handle errors from MakeCurrent and SwapBuffers --- src/api/x11/window.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/api/x11/window.rs') 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(()) } } -- cgit v1.2.3