aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/glx
diff options
context:
space:
mode:
authorDzmitry Malyshau <kvarkus@gmail.com>2015-04-29 23:05:47 -0400
committerDzmitry Malyshau <kvarkus@gmail.com>2015-04-30 22:50:15 -0400
commita42f1f58333a9899d36e18e641f3f52517dd58b1 (patch)
tree8e11e18d3bb3fc4f5a3a5a65eb7c895d515c105c /src/api/glx
parentc1ca5d1d87166daa20d4ae2a9a0a7c8d4ba2ba63 (diff)
downloadglutin-a42f1f58333a9899d36e18e641f3f52517dd58b1.tar.gz
glutin-a42f1f58333a9899d36e18e641f3f52517dd58b1.zip
Implemented gl_core flag
Diffstat (limited to 'src/api/glx')
-rw-r--r--src/api/glx/mod.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/api/glx/mod.rs b/src/api/glx/mod.rs
index 7aa77e7..b0efc37 100644
--- a/src/api/glx/mod.rs
+++ b/src/api/glx/mod.rs
@@ -52,6 +52,16 @@ impl Context {
},
}
+ if let Some(core) = builder.gl_core {
+ 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
+ );
+ }
+
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 +194,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