From 62bafe2130db5aaf32bd46091581086ae435e4cf Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Mon, 21 Sep 2015 13:15:43 +0200 Subject: Remove BuilderAttribs --- src/api/caca/mod.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/api/caca/mod.rs') 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 { - let opengl = match OsMesaContext::new(builder) { + pub fn new(window: &WindowAttributes, pf_reqs: &PixelFormatRequirements, + opengl: &GlAttributes<&Window>) -> Result + { + 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 -- cgit v1.2.3