From 171986c7e86063862d16208296c011cd5828bcad Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Thu, 30 Apr 2015 23:06:22 -0400 Subject: Introduced GlProfile enum --- src/api/glx/mod.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/api/glx') 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 { -- cgit v1.2.3