diff options
Diffstat (limited to 'src/headless.rs')
-rw-r--r-- | src/headless.rs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/headless.rs b/src/headless.rs index 997d87a..69f9aab 100644 --- a/src/headless.rs +++ b/src/headless.rs @@ -1,9 +1,11 @@ use Api; use BuilderAttribs; +use ContextError; use CreationError; use GlRequest; use GlContext; use PixelFormat; +use Robustness; use gl_common; use libc; @@ -42,6 +44,12 @@ impl HeadlessRendererBuilder { self } + /// Sets the robustness of the OpenGL context. See the docs of `Robustness`. + pub fn with_gl_robustness(mut self, robustness: Robustness) -> HeadlessRendererBuilder { + self.attribs.gl_robustness = robustness; + self + } + /// Builds the headless context. /// /// Error should be very rare and only occur in case of permission denied, incompatible system, @@ -69,7 +77,7 @@ impl HeadlessContext { /// Creates a new OpenGL context /// Sets the context as the current context. #[inline] - pub unsafe fn make_current(&self) { + pub unsafe fn make_current(&self) -> Result<(), ContextError> { self.context.make_current() } @@ -105,7 +113,7 @@ impl gl_common::GlFunctionsSource for HeadlessContext { } impl GlContext for HeadlessContext { - unsafe fn make_current(&self) { + unsafe fn make_current(&self) -> Result<(), ContextError> { self.context.make_current() } @@ -117,7 +125,7 @@ impl GlContext for HeadlessContext { self.context.get_proc_address(addr) } - fn swap_buffers(&self) { + fn swap_buffers(&self) -> Result<(), ContextError> { self.context.swap_buffers() } |