diff options
author | tomaka <pierre.krieger1708@gmail.com> | 2015-12-20 10:58:28 +0100 |
---|---|---|
committer | tomaka <pierre.krieger1708@gmail.com> | 2015-12-20 10:58:28 +0100 |
commit | 1f5f997a68ec411fc3409a35f2c5e118811f3cd0 (patch) | |
tree | a5001d48c8d54373851f87b56d99ac7dc662117f /src/api/cocoa | |
parent | 87f0edea7ba872720152b5da296f0bd052d4c954 (diff) | |
parent | 61bca52217471eca4c4aff1dd84b980966be4bfc (diff) | |
download | glutin-1f5f997a68ec411fc3409a35f2c5e118811f3cd0.tar.gz glutin-1f5f997a68ec411fc3409a35f2c5e118811f3cd0.zip |
Merge pull request #677 from tomaka/pf
No longer manually enumerate pixel formats
Diffstat (limited to 'src/api/cocoa')
-rw-r--r-- | src/api/cocoa/mod.rs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/api/cocoa/mod.rs b/src/api/cocoa/mod.rs index c9e35a8..eae344c 100644 --- a/src/api/cocoa/mod.rs +++ b/src/api/cocoa/mod.rs @@ -13,6 +13,7 @@ use GlProfile; use GlRequest; use PixelFormat; use PixelFormatRequirements; +use ReleaseBehavior; use Robustness; use WindowAttributes; use native_monitor::NativeMonitorId; @@ -491,6 +492,8 @@ impl Window { let alpha_depth = pf_reqs.alpha_bits.unwrap_or(8); let color_depth = pf_reqs.color_bits.unwrap_or(24) + alpha_depth; + // TODO: handle hardware_accelerated parameter of pf_reqs + let mut attributes = vec![ NSOpenGLPFADoubleBuffer as u32, NSOpenGLPFAClosestPolicy as u32, @@ -501,10 +504,19 @@ impl Window { NSOpenGLPFAOpenGLProfile as u32, profile, ]; - // A color depth higher than 64 implies we're using either 16-bit - // floats or 32-bit floats and OS X requires a flag to be set - // accordingly. - if color_depth >= 64 { + if pf_reqs.release_behavior != ReleaseBehavior::Flush { + return Err(CreationError::NoAvailablePixelFormat); + } + + if pf_reqs.stereoscopy { + unimplemented!(); // TODO: + } + + if pf_reqs.double_buffer == Some(false) { + unimplemented!(); // TODO: + } + + if pf_reqs.float_color_buffer { attributes.push(NSOpenGLPFAColorFloat as u32); } |