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/cocoa/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/api/cocoa/mod.rs') diff --git a/src/api/cocoa/mod.rs b/src/api/cocoa/mod.rs index 877aba7..aa408ff 100644 --- a/src/api/cocoa/mod.rs +++ b/src/api/cocoa/mod.rs @@ -8,6 +8,7 @@ use libc; use Api; use BuilderAttribs; +use ContextError; use GlContext; use GlProfile; use GlRequest; @@ -760,9 +761,10 @@ impl Window { } impl GlContext for Window { - unsafe fn make_current(&self) { + unsafe fn make_current(&self) -> Result<(), ContextError> { let _: () = msg_send![*self.context, update]; self.context.makeCurrentContext(); + Ok(()) } fn is_current(&self) -> bool { @@ -789,8 +791,9 @@ impl GlContext for Window { symbol as *const _ } - fn swap_buffers(&self) { + fn swap_buffers(&self) -> Result<(), ContextError> { unsafe { self.context.flushBuffer(); } + Ok(()) } fn get_api(&self) -> ::Api { -- cgit v1.2.3