Skip to content

Commit

Permalink
Merge pull request #422 from Ryman/fixosx
Browse files Browse the repository at this point in the history
Fix further compilation of cocoa
  • Loading branch information
tomaka committed May 2, 2015
2 parents ef45318 + 81d0dc9 commit 1e714a5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/api/cocoa/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ impl Window {
// TODO: perhaps we should return error from create_context so we can
// determine the cause of failure and possibly recover?
let (context, pf) = match Window::create_context(*view, &builder) {
(Some(context), Some(pf)) => (context, pf),
(_, _) => { return Err(OsError(format!("Couldn't create OpenGL context"))); },
Ok((Some(context), Some(pf))) => (context, pf),
_ => { return Err(OsError(format!("Couldn't create OpenGL context"))); },
};

unsafe {
Expand Down Expand Up @@ -473,12 +473,12 @@ impl Window {
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(GlProfile::Core)) |
(_, Some(3 ... 4, _), Some(GlProfile::Compatibility)) =>
(_, 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,
(_, Some(3 ... 4, _), _) => NSOpenGLProfileVersion4_1Core as u32,
(_, Some((1 ... 2, _)), _) => NSOpenGLProfileVersionLegacy as u32,
(_, Some((3, 0 ... 2)), _) => NSOpenGLProfileVersion3_2Core as u32,
(_, Some((3 ... 4, _)), _) => NSOpenGLProfileVersion4_1Core as u32,
_ => return Err(CreationError::NotSupported),
};

Expand Down

0 comments on commit 1e714a5

Please sign in to comment.