Removed NSOpenGLPFAOpenGLProfiles enum in favor of the one defined in the AppKit bindings

This commit is contained in:
Patrick Horlebein 2014-12-30 17:02:49 +01:00
parent b0dddb2d3f
commit 0e64651db8

View file

@ -45,15 +45,6 @@ static mut alt_pressed: bool = false;
static DELEGATE_NAME: &'static [u8] = b"glutin_window_delegate\0"; static DELEGATE_NAME: &'static [u8] = b"glutin_window_delegate\0";
static DELEGATE_STATE_IVAR: &'static [u8] = b"glutin_state"; static DELEGATE_STATE_IVAR: &'static [u8] = b"glutin_state";
// TODO: Should be added to cocoa bindings
#[allow(non_camel_case_types)]
#[deriving(Show)]
enum NSOpenGLPFAOpenGLProfiles {
NSOpenGLProfileVersionLegacy = 0x1000,
NSOpenGLProfileVersion3_2Core = 0x3200,
NSOpenGLProfileVersion4_1Core = 0x4100
}
struct DelegateState<'a> { struct DelegateState<'a> {
is_closed: bool, is_closed: bool,
context: id, context: id,
@ -271,12 +262,10 @@ impl Window {
} }
fn create_context(view: id, vsync: bool, gl_version: Option<(uint, uint)>) -> Option<id> { fn create_context(view: id, vsync: bool, gl_version: Option<(uint, uint)>) -> Option<id> {
let profile = { let profile = match gl_version {
match gl_version { None | Some((0...2, _)) | Some((3, 0)) => NSOpenGLProfileVersionLegacy as uint,
None | Some((0...2, _)) | Some((3, 0)) => NSOpenGLPFAOpenGLProfiles::NSOpenGLProfileVersionLegacy as uint, Some((3, 1...2)) => NSOpenGLProfileVersion3_2Core as uint,
Some((3, 1...2)) => NSOpenGLPFAOpenGLProfiles::NSOpenGLProfileVersion3_2Core as uint, Some((_, _)) => NSOpenGLProfileVersion4_1Core as uint,
Some((_, _)) => NSOpenGLPFAOpenGLProfiles::NSOpenGLProfileVersion4_1Core as uint,
}
}; };
unsafe { unsafe {
let attributes = [ let attributes = [