diff options
author | Dzmitry Malyshau <kvarkus@gmail.com> | 2015-04-30 23:06:22 -0400 |
---|---|---|
committer | Dzmitry Malyshau <kvarkus@gmail.com> | 2015-05-01 07:32:48 -0400 |
commit | 171986c7e86063862d16208296c011cd5828bcad (patch) | |
tree | e750667b22097fba290848ed2510bd67a80a6ae6 /src/api/win32 | |
parent | a42f1f58333a9899d36e18e641f3f52517dd58b1 (diff) | |
download | glutin-171986c7e86063862d16208296c011cd5828bcad.tar.gz glutin-171986c7e86063862d16208296c011cd5828bcad.zip |
Introduced GlProfile enum
Diffstat (limited to 'src/api/win32')
-rw-r--r-- | src/api/win32/init.rs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/api/win32/init.rs b/src/api/win32/init.rs index 3837069..e5b0b3a 100644 --- a/src/api/win32/init.rs +++ b/src/api/win32/init.rs @@ -17,6 +17,7 @@ use BuilderAttribs; use CreationError; use CreationError::OsError; use CursorState; +use GlProfile; use GlRequest; use PixelFormat; @@ -374,17 +375,18 @@ unsafe fn create_context(extra: Option<(&gl::wgl_extra::Wgl, &BuilderAttribs<'st }, } - if let Some(core) = builder.gl_core { + if let Some(profile) = builder.gl_profile { if is_extension_supported(extra_functions, hdc, "WGL_ARB_create_context_profile") { + let flag = match profile { + GlProfile::Compatibility => + gl::wgl_extra::CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB, + GlProfile::Core => + gl::wgl_extra::CONTEXT_CORE_PROFILE_BIT_ARB, + }; attributes.push(gl::wgl_extra::CONTEXT_PROFILE_MASK_ARB as libc::c_int); - attributes.push(if core { - gl::wgl_extra::CONTEXT_CORE_PROFILE_BIT_ARB - } else { - gl::wgl_extra::CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB - } as libc::c_int - ); + attributes.push(flag as libc::c_int); } else { return Err(CreationError::NotSupported); } |