aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/win32
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/win32
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/win32')
-rw-r--r--src/api/win32/init.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/api/win32/init.rs b/src/api/win32/init.rs
index 39b9d97..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,6 +375,23 @@ unsafe fn create_context(extra: Option<(&gl::wgl_extra::Wgl, &BuilderAttribs<'st
},
}
+ 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(flag as libc::c_int);
+ } else {
+ return Err(CreationError::NotSupported);
+ }
+ }
+
if builder.gl_debug {
attributes.push(gl::wgl_extra::CONTEXT_FLAGS_ARB as libc::c_int);
attributes.push(gl::wgl_extra::CONTEXT_DEBUG_BIT_ARB as libc::c_int);