Introduced GlProfile enum

This commit is contained in:
Dzmitry Malyshau 2015-04-30 23:06:22 -04:00
parent a42f1f5833
commit 171986c7e8
5 changed files with 42 additions and 27 deletions

View file

@ -3,6 +3,7 @@
use BuilderAttribs;
use CreationError;
use GlContext;
use GlProfile;
use GlRequest;
use Api;
use PixelFormat;
@ -52,14 +53,15 @@ impl Context {
},
}
if let Some(core) = builder.gl_core {
if let Some(profile) = builder.gl_profile {
let flag = match profile {
GlProfile::Compatibility =>
ffi::glx_extra::CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
GlProfile::Core =>
ffi::glx_extra::CONTEXT_CORE_PROFILE_BIT_ARB,
};
attributes.push(ffi::glx_extra::CONTEXT_PROFILE_MASK_ARB as libc::c_int);
attributes.push(if core {
ffi::glx_extra::CONTEXT_CORE_PROFILE_BIT_ARB
} else {
ffi::glx_extra::CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB
} as libc::c_int
);
attributes.push(flag as libc::c_int);
}
if builder.gl_debug {