aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.rs
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2015-06-17 07:36:00 +0200
committertomaka <pierre.krieger1708@gmail.com>2015-06-17 07:36:00 +0200
commit90b28c205219df732d83e403f98abab31e6e52d4 (patch)
tree1008d78cf5c7280c9ddeea512033a92e07f989d1 /src/window.rs
parent2d1e503f77434fc0dd3f2715625ce1a972fdf62f (diff)
parentf6c26ec593ba96d89cb3476c815d6f33a915bfdd (diff)
downloadglutin-90b28c205219df732d83e403f98abab31e6e52d4.tar.gz
glutin-90b28c205219df732d83e403f98abab31e6e52d4.zip
Merge pull request #486 from tomaka/context-error
Handle errors from MakeCurrent and SwapBuffers
Diffstat (limited to 'src/window.rs')
-rw-r--r--src/window.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/window.rs b/src/window.rs
index 578c237..9f8ed48 100644
--- a/src/window.rs
+++ b/src/window.rs
@@ -3,6 +3,7 @@ use std::default::Default;
use Api;
use BuilderAttribs;
+use ContextError;
use CreationError;
use CursorState;
use Event;
@@ -339,7 +340,7 @@ impl Window {
/// Sets the context as the current context.
#[inline]
- pub unsafe fn make_current(&self) {
+ pub unsafe fn make_current(&self) -> Result<(), ContextError> {
self.window.make_current()
}
@@ -366,7 +367,7 @@ impl Window {
/// is refreshed. However drivers can choose to override your vsync settings, which means that
/// you can't know in advance whether `swap_buffers` will block or not.
#[inline]
- pub fn swap_buffers(&self) {
+ pub fn swap_buffers(&self) -> Result<(), ContextError> {
self.window.swap_buffers()
}
@@ -449,7 +450,7 @@ impl gl_common::GlFunctionsSource for Window {
}
impl GlContext for Window {
- unsafe fn make_current(&self) {
+ unsafe fn make_current(&self) -> Result<(), ContextError> {
self.make_current()
}
@@ -461,7 +462,7 @@ impl GlContext for Window {
self.get_proc_address(addr)
}
- fn swap_buffers(&self) {
+ fn swap_buffers(&self) -> Result<(), ContextError> {
self.swap_buffers()
}