aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/caca
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/caca
parenta8d3342468cc1f490fddb361d54215d9e889271f (diff)
downloadglutin-62bafe2130db5aaf32bd46091581086ae435e4cf.tar.gz
glutin-62bafe2130db5aaf32bd46091581086ae435e4cf.zip
Remove BuilderAttribs
Diffstat (limited to 'src/api/caca')
-rw-r--r--src/api/caca/mod.rs14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/api/caca/mod.rs b/src/api/caca/mod.rs
index 3b4018e..c1a19c7 100644
--- a/src/api/caca/mod.rs
+++ b/src/api/caca/mod.rs
@@ -5,14 +5,16 @@ use libc;
use api::osmesa::{OsMesaContext, OsMesaCreationError};
use Api;
-use BuilderAttribs;
use ContextError;
use CreationError;
use Event;
+use GlAttributes;
use GlContext;
use PixelFormat;
+use PixelFormatRequirements;
use CursorState;
use MouseCursor;
+use WindowAttributes;
use std::collections::VecDeque;
use std::path::Path;
@@ -84,8 +86,14 @@ impl<'a> Iterator for WaitEventsIterator<'a> {
}
impl Window {
- pub fn new(builder: BuilderAttribs) -> Result<Window, CreationError> {
- let opengl = match OsMesaContext::new(builder) {
+ pub fn new(window: &WindowAttributes, pf_reqs: &PixelFormatRequirements,
+ opengl: &GlAttributes<&Window>) -> Result<Window, CreationError>
+ {
+ let opengl = opengl.clone().map_sharing(|w| &w.opengl);
+
+ let opengl = match OsMesaContext::new(window.dimensions.unwrap_or((800, 600)), pf_reqs,
+ &opengl)
+ {
Err(OsMesaCreationError::NotSupported) => return Err(CreationError::NotSupported),
Err(OsMesaCreationError::CreationError(e)) => return Err(e),
Ok(c) => c