From 7d458366a4d9ad595a4410f5f35c931d49475f83 Mon Sep 17 00:00:00 2001
From: Roderick Colenbrander <thunderbird2k@gmail.com>
Date: Tue, 17 Nov 2009 11:50:25 +0100
Subject: [PATCH 3/3] Add support for WGL_ARB_create_context_profile which is required for OpenGL 3.2.

---
 dlls/winex11.drv/opengl.c |    7 +++++++
 include/wine/wgl.h        |    7 +++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 699ff4d..ac2e1dc 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -2249,6 +2249,10 @@ HGLRC X11DRV_wglCreateContextAttribsARB(X11DRV_PDEVICE *physDev, HGLRC hShareCon
                     pContextAttribList[0] = GLX_CONTEXT_FLAGS_ARB;
                     pContextAttribList[1] = pAttribList[1];
                     break;
+                case WGL_CONTEXT_PROFILE_MASK_ARB:
+                    pContextAttribList[0] = GLX_CONTEXT_PROFILE_MASK_ARB;
+                    pContextAttribList[1] = pAttribList[1];
+                    break;                
                 default:
                     ERR("Unhandled attribList pair: %#x %#x\n", pAttribList[0], pAttribList[1]);
             }
@@ -3539,6 +3543,9 @@ static void X11DRV_WineGL_LoadExtensions(void)
     if(glxRequireExtension("GLX_ARB_create_context"))
     {
         register_extension(&WGL_ARB_create_context);
+
+        if(glxRequireExtension("GLX_ARB_create_context_profile"))
+            register_extension_string("WGL_ARB_create_context_profile");
     }
 
     if(glxRequireExtension("GLX_ARB_fbconfig_float"))
diff --git a/include/wine/wgl.h b/include/wine/wgl.h
index a102109..599f736 100644
--- a/include/wine/wgl.h
+++ b/include/wine/wgl.h
@@ -200,13 +200,20 @@
 #define WGL_CONTEXT_MINOR_VERSION_ARB  0x2092
 #define WGL_CONTEXT_LAYER_PLANE_ARB    0x2093
 #define WGL_CONTEXT_FLAGS_ARB          0x2094
+#define WGL_CONTEXT_PROFILE_MASK_ARB   0x9126
+#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB    0x00000001
+#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
 #define ERROR_INVALID_VERSION_ARB      0x2095
+#define ERROR_INVALID_PROFILE_ARB      0x2096
 #ifndef GLX_ARB_create_context
 #define GLX_CONTEXT_DEBUG_BIT_ARB          0x00000001
 #define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
 #define GLX_CONTEXT_MAJOR_VERSION_ARB      0x2091
 #define GLX_CONTEXT_MINOR_VERSION_ARB      0x2092
 #define GLX_CONTEXT_FLAGS_ARB              0x2094
+#define GLX_CONTEXT_PROFILE_MASK_ARB       0x9126
+#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB   0x00000001
+#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
 #endif
 
 /** 
-- 
1.6.3.3

