From 58b3bfb4fba22ecdb6f846f88f8a74e13ecae8ec Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Mon, 21 Sep 2015 09:33:41 +0200 Subject: Extract PixelFormatRequirements from BuilderAttribs --- src/api/cocoa/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/api/cocoa/mod.rs') diff --git a/src/api/cocoa/mod.rs b/src/api/cocoa/mod.rs index e3feda2..a682489 100644 --- a/src/api/cocoa/mod.rs +++ b/src/api/cocoa/mod.rs @@ -471,16 +471,16 @@ impl Window { // full color size and hope for the best. Another hiccup is that // `NSOpenGLPFAColorSize` also includes `NSOpenGLPFAAlphaSize`, // so we have to account for that as well. - let alpha_depth = builder.alpha_bits.unwrap_or(8); - let color_depth = builder.color_bits.unwrap_or(24) + alpha_depth; + let alpha_depth = builder.pf_reqs.alpha_bits.unwrap_or(8); + let color_depth = builder.pf_reqs.color_bits.unwrap_or(24) + alpha_depth; let mut attributes = vec![ NSOpenGLPFADoubleBuffer as u32, NSOpenGLPFAClosestPolicy as u32, NSOpenGLPFAColorSize as u32, color_depth as u32, NSOpenGLPFAAlphaSize as u32, alpha_depth as u32, - NSOpenGLPFADepthSize as u32, builder.depth_bits.unwrap_or(24) as u32, - NSOpenGLPFAStencilSize as u32, builder.stencil_bits.unwrap_or(8) as u32, + NSOpenGLPFADepthSize as u32, builder.pf_reqs.depth_bits.unwrap_or(24) as u32, + NSOpenGLPFAStencilSize as u32, builder.pf_reqs.stencil_bits.unwrap_or(8) as u32, NSOpenGLPFAOpenGLProfile as u32, profile, ]; @@ -491,7 +491,7 @@ impl Window { attributes.push(NSOpenGLPFAColorFloat as u32); } - builder.multisampling.map(|samples| { + builder.pf_reqs.multisampling.map(|samples| { attributes.push(NSOpenGLPFAMultisample as u32); attributes.push(NSOpenGLPFASampleBuffers as u32); attributes.push(1); attributes.push(NSOpenGLPFASamples as u32); attributes.push(samples as u32); -- cgit v1.2.3