From 171986c7e86063862d16208296c011cd5828bcad Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Thu, 30 Apr 2015 23:06:22 -0400 Subject: Introduced GlProfile enum --- src/api/cocoa/mod.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/api/cocoa') diff --git a/src/api/cocoa/mod.rs b/src/api/cocoa/mod.rs index bbc110d..a58001d 100644 --- a/src/api/cocoa/mod.rs +++ b/src/api/cocoa/mod.rs @@ -11,6 +11,7 @@ use Api; use BuilderAttribs; use CreationError; use GlContext; +use GlProfile; use GlRequest; use PixelFormat; use native_monitor::NativeMonitorId; @@ -470,11 +471,11 @@ impl Window { } fn create_context(view: id, builder: &BuilderAttribs) -> Result<(Option, Option), CreationError> { - let profile = match (builder.gl_version, builder.gl_version.to_gl_version(), builder.gl_core) { - (GlRequest::Latest, _, Some(false)) => NSOpenGLProfileVersionLegacy as u32, + let profile = match (builder.gl_version, builder.gl_version.to_gl_version(), builder.gl_profile) { + (GlRequest::Latest, _, Some(GlProfile::Compatibility)) => NSOpenGLProfileVersionLegacy as u32, (GlRequest::Latest, _, _) => NSOpenGLProfileVersion4_1Core as u32, - (_, Some(1 ... 2, _), Some(true)) | - (_, Some(3 ... 4, _), Some(false)) => + (_, Some(1 ... 2, _), Some(GlProfile::Core)) | + (_, Some(3 ... 4, _), Some(GlProfile::Compatibility)) => return Err(CreationError::NotSupported), (_, Some(1 ... 2, _), _) => NSOpenGLProfileVersionLegacy as u32, (_, Some(3, 0 ... 2), _) => NSOpenGLProfileVersion3_2Core as u32, -- cgit v1.2.3