Handle errors from MakeCurrent and SwapBuffers
This commit is contained in:
parent
e48c853b9c
commit
f6c26ec593
20 changed files with 123 additions and 62 deletions
|
|
@ -11,6 +11,7 @@ use std::sync::{
|
|||
};
|
||||
use std::sync::mpsc::Receiver;
|
||||
use libc;
|
||||
use ContextError;
|
||||
use {CreationError, Event, MouseCursor};
|
||||
use CursorState;
|
||||
use GlContext;
|
||||
|
|
@ -315,7 +316,7 @@ impl Window {
|
|||
}
|
||||
|
||||
impl GlContext for Window {
|
||||
unsafe fn make_current(&self) {
|
||||
unsafe fn make_current(&self) -> Result<(), ContextError> {
|
||||
match self.context {
|
||||
Context::Wgl(ref c) => c.make_current(),
|
||||
Context::Egl(ref c) => c.make_current(),
|
||||
|
|
@ -336,7 +337,7 @@ impl GlContext for Window {
|
|||
}
|
||||
}
|
||||
|
||||
fn swap_buffers(&self) {
|
||||
fn swap_buffers(&self) -> Result<(), ContextError> {
|
||||
match self.context {
|
||||
Context::Wgl(ref c) => c.swap_buffers(),
|
||||
Context::Egl(ref c) => c.swap_buffers(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue