From a32439efc52226e3529114693a63acf3ef7977cc Mon Sep 17 00:00:00 2001
From: Ken Thomases <ken@codeweavers.com>
Date: Thu, 27 Feb 2014 14:59:20 -0600
Subject: DONTSEND: opengl32: Define custom WGL extension WGL_WINE_surface.
To: wine-patches <wine-patches@winehq.org>

---
 dlls/opengl32/opengl_ext.c  |    8 ++++++--
 dlls/opengl32/opengl_norm.c |    8 ++++++++
 include/wine/wgl_driver.h   |    7 ++++++-
 3 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/dlls/opengl32/opengl_ext.c b/dlls/opengl32/opengl_ext.c
index 81aa43a..e06b0af 100644
--- a/dlls/opengl32/opengl_ext.c
+++ b/dlls/opengl32/opengl_ext.c
@@ -14,7 +14,7 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(opengl);
 
-const int extension_registry_size = 2351;
+const int extension_registry_size = 2355;
 
 static void WINAPI glAccumxOES( GLenum op, GLfixed value ) {
   const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
@@ -13996,7 +13996,7 @@ static void WINAPI glWriteMaskEXT( GLuint res, GLuint in, GLenum outX, GLenum ou
   funcs->ext.p_glWriteMaskEXT( res, in, outX, outY, outZ, outW );
 }
 
-const OpenGL_extension extension_registry[2351] = {
+const OpenGL_extension extension_registry[2355] = {
   { "glAccumxOES", "GL_OES_fixed_point", glAccumxOES },
   { "glActiveProgramEXT", "GL_EXT_separate_shader_objects", glActiveProgramEXT },
   { "glActiveShaderProgram", "GL_ARB_separate_shader_objects GL_VERSION_4_1", glActiveShaderProgram },
@@ -16332,7 +16332,9 @@ const OpenGL_extension extension_registry[2351] = {
   { "wglChoosePixelFormatARB", "WGL_ARB_pixel_format", wglChoosePixelFormatARB },
   { "wglCreateContextAttribsARB", "WGL_ARB_create_context", wglCreateContextAttribsARB },
   { "wglCreatePbufferARB", "WGL_ARB_pbuffer", wglCreatePbufferARB },
+  { "wglCreateSurfaceWINE", "WGL_WINE_surface", wglCreateSurfaceWINE },
   { "wglDestroyPbufferARB", "WGL_ARB_pbuffer", wglDestroyPbufferARB },
+  { "wglDestroySurfaceWINE", "WGL_WINE_surface", wglDestroySurfaceWINE },
   { "wglFreeMemoryNV", "WGL_NV_vertex_array_range", wglFreeMemoryNV },
   { "wglGetCurrentReadDCARB", "WGL_ARB_make_current_read", wglGetCurrentReadDCARB },
   { "wglGetExtensionsStringARB", "WGL_ARB_extensions_string", wglGetExtensionsStringARB },
@@ -16340,10 +16342,12 @@ const OpenGL_extension extension_registry[2351] = {
   { "wglGetPbufferDCARB", "WGL_ARB_pbuffer", wglGetPbufferDCARB },
   { "wglGetPixelFormatAttribfvARB", "WGL_ARB_pixel_format", wglGetPixelFormatAttribfvARB },
   { "wglGetPixelFormatAttribivARB", "WGL_ARB_pixel_format", wglGetPixelFormatAttribivARB },
+  { "wglGetSurfaceDCWINE", "WGL_WINE_surface", wglGetSurfaceDCWINE },
   { "wglGetSwapIntervalEXT", "WGL_EXT_swap_control", wglGetSwapIntervalEXT },
   { "wglMakeContextCurrentARB", "WGL_ARB_make_current_read", wglMakeContextCurrentARB },
   { "wglQueryPbufferARB", "WGL_ARB_pbuffer", wglQueryPbufferARB },
   { "wglReleasePbufferDCARB", "WGL_ARB_pbuffer", wglReleasePbufferDCARB },
+  { "wglReleaseSurfaceDCWINE", "WGL_WINE_surface", wglReleaseSurfaceDCWINE },
   { "wglReleaseTexImageARB", "WGL_ARB_render_texture", wglReleaseTexImageARB },
   { "wglSetPbufferAttribARB", "WGL_ARB_render_texture", wglSetPbufferAttribARB },
   { "wglSetPixelFormatWINE", "WGL_WINE_pixel_format_passthrough", wglSetPixelFormatWINE },
diff --git a/dlls/opengl32/opengl_norm.c b/dlls/opengl32/opengl_norm.c
index 78a72ef..51cbb4f 100644
--- a/dlls/opengl32/opengl_norm.c
+++ b/dlls/opengl32/opengl_norm.c
@@ -5706,7 +5706,9 @@ static BOOL null_wglBindTexImageARB( struct wgl_pbuffer * hPbuffer, int iBuffer
 static BOOL null_wglChoosePixelFormatARB( HDC hdc, const int* piAttribIList, const FLOAT* pfAttribFList, UINT nMaxFormats, int* piFormats, UINT* nNumFormats ) { return 0; }
 static struct wgl_context * null_wglCreateContextAttribsARB( HDC hDC, struct wgl_context * hShareContext, const int* attribList ) { return 0; }
 static struct wgl_pbuffer * null_wglCreatePbufferARB( HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList ) { return 0; }
+static struct wgl_surface * null_wglCreateSurfaceWINE( HDC hdc ) { return 0; }
 static BOOL null_wglDestroyPbufferARB( struct wgl_pbuffer * hPbuffer ) { return 0; }
+static BOOL null_wglDestroySurfaceWINE( struct wgl_surface * surface ) { return 0; }
 static void null_wglFreeMemoryNV( void* pointer ) { }
 static HDC null_wglGetCurrentReadDCARB( void ) { return 0; }
 static const char* null_wglGetExtensionsStringARB( HDC hdc ) { return 0; }
@@ -5714,10 +5716,12 @@ static const char* null_wglGetExtensionsStringEXT( void ) { return 0; }
 static HDC null_wglGetPbufferDCARB( struct wgl_pbuffer * hPbuffer ) { return 0; }
 static BOOL null_wglGetPixelFormatAttribfvARB( HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT* pfValues ) { return 0; }
 static BOOL null_wglGetPixelFormatAttribivARB( HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int* piValues ) { return 0; }
+static HDC null_wglGetSurfaceDCWINE( struct wgl_surface * surface ) { return 0; }
 static int null_wglGetSwapIntervalEXT( void ) { return 0; }
 static BOOL null_wglMakeContextCurrentARB( HDC hDrawDC, HDC hReadDC, struct wgl_context * hglrc ) { return 0; }
 static BOOL null_wglQueryPbufferARB( struct wgl_pbuffer * hPbuffer, int iAttribute, int* piValue ) { return 0; }
 static int null_wglReleasePbufferDCARB( struct wgl_pbuffer * hPbuffer, HDC hDC ) { return 0; }
+static BOOL null_wglReleaseSurfaceDCWINE( struct wgl_surface * surface, HDC hdc ) { return 0; }
 static BOOL null_wglReleaseTexImageARB( struct wgl_pbuffer * hPbuffer, int iBuffer ) { return 0; }
 static BOOL null_wglSetPbufferAttribARB( struct wgl_pbuffer * hPbuffer, const int* piAttribList ) { return 0; }
 static BOOL null_wglSetPixelFormatWINE( HDC hdc, int format ) { return 0; }
@@ -8411,7 +8415,9 @@ struct opengl_funcs null_opengl_funcs =
         null_wglChoosePixelFormatARB,
         null_wglCreateContextAttribsARB,
         null_wglCreatePbufferARB,
+        null_wglCreateSurfaceWINE,
         null_wglDestroyPbufferARB,
+        null_wglDestroySurfaceWINE,
         null_wglFreeMemoryNV,
         null_wglGetCurrentReadDCARB,
         null_wglGetExtensionsStringARB,
@@ -8419,10 +8425,12 @@ struct opengl_funcs null_opengl_funcs =
         null_wglGetPbufferDCARB,
         null_wglGetPixelFormatAttribfvARB,
         null_wglGetPixelFormatAttribivARB,
+        null_wglGetSurfaceDCWINE,
         null_wglGetSwapIntervalEXT,
         null_wglMakeContextCurrentARB,
         null_wglQueryPbufferARB,
         null_wglReleasePbufferDCARB,
+        null_wglReleaseSurfaceDCWINE,
         null_wglReleaseTexImageARB,
         null_wglSetPbufferAttribARB,
         null_wglSetPixelFormatWINE,
diff --git a/include/wine/wgl_driver.h b/include/wine/wgl_driver.h
index 7dbf6a1..5e8ccec 100644
--- a/include/wine/wgl_driver.h
+++ b/include/wine/wgl_driver.h
@@ -7,10 +7,11 @@
 #define WINE_GLAPI
 #endif
 
-#define WINE_WGL_DRIVER_VERSION 11
+#define WINE_WGL_DRIVER_VERSION 12
 
 struct wgl_context;
 struct wgl_pbuffer;
+struct wgl_surface;
 
 struct opengl_funcs
 {
@@ -2705,7 +2706,9 @@ struct opengl_funcs
         BOOL       (WINE_GLAPI *p_wglChoosePixelFormatARB)(HDC,const int*,const FLOAT*,UINT,int*,UINT*);
         struct wgl_context * (WINE_GLAPI *p_wglCreateContextAttribsARB)(HDC,struct wgl_context *,const int*);
         struct wgl_pbuffer * (WINE_GLAPI *p_wglCreatePbufferARB)(HDC,int,int,int,const int*);
+        struct wgl_surface * (WINE_GLAPI *p_wglCreateSurfaceWINE)(HDC);
         BOOL       (WINE_GLAPI *p_wglDestroyPbufferARB)(struct wgl_pbuffer *);
+        BOOL       (WINE_GLAPI *p_wglDestroySurfaceWINE)(struct wgl_surface *);
         void       (WINE_GLAPI *p_wglFreeMemoryNV)(void*);
         HDC        (WINE_GLAPI *p_wglGetCurrentReadDCARB)(void);
         const char* (WINE_GLAPI *p_wglGetExtensionsStringARB)(HDC);
@@ -2713,10 +2716,12 @@ struct opengl_funcs
         HDC        (WINE_GLAPI *p_wglGetPbufferDCARB)(struct wgl_pbuffer *);
         BOOL       (WINE_GLAPI *p_wglGetPixelFormatAttribfvARB)(HDC,int,int,UINT,const int*,FLOAT*);
         BOOL       (WINE_GLAPI *p_wglGetPixelFormatAttribivARB)(HDC,int,int,UINT,const int*,int*);
+        HDC        (WINE_GLAPI *p_wglGetSurfaceDCWINE)(struct wgl_surface *);
         int        (WINE_GLAPI *p_wglGetSwapIntervalEXT)(void);
         BOOL       (WINE_GLAPI *p_wglMakeContextCurrentARB)(HDC,HDC,struct wgl_context *);
         BOOL       (WINE_GLAPI *p_wglQueryPbufferARB)(struct wgl_pbuffer *,int,int*);
         int        (WINE_GLAPI *p_wglReleasePbufferDCARB)(struct wgl_pbuffer *,HDC);
+        BOOL       (WINE_GLAPI *p_wglReleaseSurfaceDCWINE)(struct wgl_surface *,HDC);
         BOOL       (WINE_GLAPI *p_wglReleaseTexImageARB)(struct wgl_pbuffer *,int);
         BOOL       (WINE_GLAPI *p_wglSetPbufferAttribARB)(struct wgl_pbuffer *,const int*);
         BOOL       (WINE_GLAPI *p_wglSetPixelFormatWINE)(HDC,int);
-- 
1.7.7.4

