From a42f1f58333a9899d36e18e641f3f52517dd58b1 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Wed, 29 Apr 2015 23:05:47 -0400 Subject: Implemented gl_core flag --- src/api/win32/init.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/api/win32') diff --git a/src/api/win32/init.rs b/src/api/win32/init.rs index 39b9d97..3837069 100644 --- a/src/api/win32/init.rs +++ b/src/api/win32/init.rs @@ -374,6 +374,22 @@ unsafe fn create_context(extra: Option<(&gl::wgl_extra::Wgl, &BuilderAttribs<'st }, } + if let Some(core) = builder.gl_core { + if is_extension_supported(extra_functions, hdc, + "WGL_ARB_create_context_profile") + { + 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 + ); + } 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); -- cgit v1.2.3