aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/osmesa
diff options
context:
space:
mode:
authorPierre Krieger <pierre.krieger1708@gmail.com>2015-09-21 13:15:43 +0200
committerPierre Krieger <pierre.krieger1708@gmail.com>2015-09-21 14:03:05 +0200
commit62bafe2130db5aaf32bd46091581086ae435e4cf (patch)
tree03056bc49bd5ec0da9e155176a74c2d23a8fc603 /src/api/osmesa
parenta8d3342468cc1f490fddb361d54215d9e889271f (diff)
downloadglutin-62bafe2130db5aaf32bd46091581086ae435e4cf.tar.gz
glutin-62bafe2130db5aaf32bd46091581086ae435e4cf.zip
Remove BuilderAttribs
Diffstat (limited to 'src/api/osmesa')
-rw-r--r--src/api/osmesa/mod.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/api/osmesa/mod.rs b/src/api/osmesa/mod.rs
index 2debc7e..ca34e93 100644
--- a/src/api/osmesa/mod.rs
+++ b/src/api/osmesa/mod.rs
@@ -3,11 +3,12 @@
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.window.dimensions.unwrap();
+ if opengl.sharing.is_some() { unimplemented!() } // TODO: proper error
- match builder.opengl.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 {