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/headless.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/headless.rs') diff --git a/src/headless.rs b/src/headless.rs index 997d87a..8ee81d8 100644 --- a/src/headless.rs +++ b/src/headless.rs @@ -1,5 +1,6 @@ use Api; use BuilderAttribs; +use ContextError; use CreationError; use GlRequest; use GlContext; @@ -69,7 +70,7 @@ impl HeadlessContext { /// Creates a new OpenGL context /// Sets the context as the current context. #[inline] - pub unsafe fn make_current(&self) { + pub unsafe fn make_current(&self) -> Result<(), ContextError> { self.context.make_current() } @@ -105,7 +106,7 @@ impl gl_common::GlFunctionsSource for HeadlessContext { } impl GlContext for HeadlessContext { - unsafe fn make_current(&self) { + unsafe fn make_current(&self) -> Result<(), ContextError> { self.context.make_current() } @@ -117,7 +118,7 @@ impl GlContext for HeadlessContext { self.context.get_proc_address(addr) } - fn swap_buffers(&self) { + fn swap_buffers(&self) -> Result<(), ContextError> { self.context.swap_buffers() } -- cgit v1.2.3