aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/osmesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/osmesa')
-rw-r--r--src/api/osmesa/mod.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/api/osmesa/mod.rs b/src/api/osmesa/mod.rs
index 056e2d1..ca34e93 100644
--- a/src/api/osmesa/mod.rs
+++ b/src/api/osmesa/mod.rs
@@ -1,13 +1,14 @@
-#![cfg(any(target_os = "linux", target_os = "freebsd"))]
+#![cfg(any(target_os = "linux", target_os = "freebsd", target_os = "dragonfly"))]
extern crate osmesa_sys;
use Api;
-use BuilderAttribs;
use ContextError;
use CreationError;
+use GlAttributes;
use GlContext;
use PixelFormat;
+use PixelFormatRequirements;
use Robustness;
use libc;
use std::{mem, ptr};
@@ -32,20 +33,23 @@ impl From<CreationError> for OsMesaCreationError {
}
impl OsMesaContext {
- pub fn new(builder: BuilderAttribs) -> Result<OsMesaContext, OsMesaCreationError> {
+ pub fn new(dimensions: (u32, u32), pf_reqs: &PixelFormatRequirements,
+ opengl: &GlAttributes<&OsMesaContext>) -> Result<OsMesaContext, OsMesaCreationError>
+ {
if let Err(_) = osmesa_sys::OsMesa::try_loading() {
return Err(OsMesaCreationError::NotSupported);
}
- let dimensions = builder.dimensions.unwrap();
+ if opengl.sharing.is_some() { unimplemented!() } // TODO: proper error
- match builder.gl_robustness {
+ match opengl.robustness {
Robustness::RobustNoResetNotification | Robustness::RobustLoseContextOnReset => {
return Err(CreationError::RobustnessNotSupported.into());
},
_ => ()
}
+ // TODO: use `pf_reqs` for the format
// TODO: check OpenGL version and return `OpenGlVersionNotSupported` if necessary
Ok(OsMesaContext {