aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.rs')
-rw-r--r--src/window.rs22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/window.rs b/src/window.rs
index 664868b..8757efc 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;
@@ -11,6 +12,7 @@ use GlProfile;
use GlRequest;
use MouseCursor;
use PixelFormat;
+use Robustness;
use native_monitor::NativeMonitorId;
use gl_common;
@@ -83,6 +85,12 @@ impl<'a> WindowBuilder<'a> {
self
}
+ /// Sets the robustness of the OpenGL context. See the docs of `Robustness`.
+ pub fn with_gl_robustness(mut self, robustness: Robustness) -> WindowBuilder<'a> {
+ self.attribs.gl_robustness = robustness;
+ self
+ }
+
/// Requests that the window has vsync enabled.
pub fn with_vsync(mut self) -> WindowBuilder<'a> {
self.attribs.vsync = true;
@@ -230,12 +238,6 @@ impl Window {
builder.build()
}
- /// Returns true if the window has previously been closed by the user.
- #[inline]
- pub fn is_closed(&self) -> bool {
- self.window.is_closed()
- }
-
/// Modifies the title of the window.
///
/// This is a no-op if the window has already been closed.
@@ -345,7 +347,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()
}
@@ -372,7 +374,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()
}
@@ -455,7 +457,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()
}
@@ -467,7 +469,7 @@ impl GlContext for Window {
self.get_proc_address(addr)
}
- fn swap_buffers(&self) {
+ fn swap_buffers(&self) -> Result<(), ContextError> {
self.swap_buffers()
}