diff options
author | Dzmitry Malyshau <kvarkus@gmail.com> | 2015-04-30 23:06:22 -0400 |
---|---|---|
committer | Dzmitry Malyshau <kvarkus@gmail.com> | 2015-05-01 07:32:48 -0400 |
commit | 171986c7e86063862d16208296c011cd5828bcad (patch) | |
tree | e750667b22097fba290848ed2510bd67a80a6ae6 /src/api/cocoa | |
parent | a42f1f58333a9899d36e18e641f3f52517dd58b1 (diff) | |
download | glutin-171986c7e86063862d16208296c011cd5828bcad.tar.gz glutin-171986c7e86063862d16208296c011cd5828bcad.zip |
Introduced GlProfile enum
Diffstat (limited to 'src/api/cocoa')
-rw-r--r-- | src/api/cocoa/mod.rs | 9 |
1 files changed, 5 insertions, 4 deletions
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<IdRef>, Option<PixelFormat>), 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, |