Handle errors from MakeCurrent and SwapBuffers

This commit is contained in:
Pierre Krieger 2015-06-16 10:15:31 +02:00
parent e48c853b9c
commit f6c26ec593
20 changed files with 123 additions and 62 deletions

View file

@ -1,5 +1,6 @@
#![cfg(target_os = "emscripten")]
use ContextError;
use GlContext;
pub use api::emscripten::{Window, WindowProxy, MonitorID, get_available_monitors};
@ -15,7 +16,7 @@ impl HeadlessContext {
}
impl GlContext for HeadlessContext {
unsafe fn make_current(&self) {
unsafe fn make_current(&self) -> Result<(), ContextError> {
self.0.make_current()
}
@ -27,7 +28,7 @@ impl GlContext for HeadlessContext {
self.0.get_proc_address(addr)
}
fn swap_buffers(&self) {
fn swap_buffers(&self) -> Result<(), ContextError> {
self.0.swap_buffers()
}