aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/glx
diff options
context:
space:
mode:
authorDzmitry Malyshau <kvarkus@gmail.com>2015-04-30 23:06:22 -0400
committerDzmitry Malyshau <kvarkus@gmail.com>2015-05-01 07:32:48 -0400
commit171986c7e86063862d16208296c011cd5828bcad (patch)
treee750667b22097fba290848ed2510bd67a80a6ae6 /src/api/glx
parenta42f1f58333a9899d36e18e641f3f52517dd58b1 (diff)
downloadglutin-171986c7e86063862d16208296c011cd5828bcad.tar.gz
glutin-171986c7e86063862d16208296c011cd5828bcad.zip
Introduced GlProfile enum
Diffstat (limited to 'src/api/glx')
-rw-r--r--src/api/glx/mod.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/api/glx/mod.rs b/src/api/glx/mod.rs
index b0efc37..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,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 {