aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/glx
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2015-05-01 14:07:10 +0200
committertomaka <pierre.krieger1708@gmail.com>2015-05-01 14:07:10 +0200
commit4882a94080636735b8a8ef78203e7d77ff893370 (patch)
tree5924231baabffe9316d16defe4415b65a6eafd6e /src/api/glx
parentcb9a8043f273b8d76ba0c1d1aa092888383f28d9 (diff)
parent171986c7e86063862d16208296c011cd5828bcad (diff)
downloadglutin-4882a94080636735b8a8ef78203e7d77ff893370.tar.gz
glutin-4882a94080636735b8a8ef78203e7d77ff893370.zip
Merge pull request #409 from kvark/core
GL core profile flag
Diffstat (limited to 'src/api/glx')
-rw-r--r--src/api/glx/mod.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/api/glx/mod.rs b/src/api/glx/mod.rs
index 7aa77e7..cb61dfa 100644
--- a/src/api/glx/mod.rs
+++ b/src/api/glx/mod.rs
@@ -3,6 +3,7 @@
use BuilderAttribs;
use CreationError;
use GlContext;
+use GlProfile;
use GlRequest;
use Api;
use PixelFormat;
@@ -52,6 +53,17 @@ impl Context {
},
}
+ 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(flag as libc::c_int);
+ }
+
if builder.gl_debug {
attributes.push(ffi::glx_extra::CONTEXT_FLAGS_ARB as libc::c_int);
attributes.push(ffi::glx_extra::CONTEXT_DEBUG_BIT_ARB as libc::c_int);
@@ -184,8 +196,6 @@ unsafe impl Sync for Context {}
impl Drop for Context {
fn drop(&mut self) {
- use std::ptr;
-
unsafe {
// we don't call MakeCurrent(0, 0) because we are not sure that the context
// is still the current one