Alexandre Julliard : winex11: Move wglShareLists to the internal OpenGL extension functions.

Alexandre Julliard julliard at winehq.org
Mon Jun 25 13:24:12 CDT 2012


Module: wine
Branch: master
Commit: beeba895d3ff2b92366a29aa332a846548ff5f0b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=beeba895d3ff2b92366a29aa332a846548ff5f0b

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jun 25 12:12:40 2012 +0200

winex11: Move wglShareLists to the internal OpenGL extension functions.

---

 dlls/opengl32/wgl.c       |   15 ++++++++++-----
 dlls/wined3d/directx.c    |    2 ++
 dlls/wined3d/wined3d_gl.h |    3 +--
 dlls/winex11.drv/opengl.c |    7 ++++---
 4 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c
index 7953275..ca3fee2 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -52,7 +52,6 @@ static struct
     BOOL  (WINAPI *p_wglCopyContext)(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask);
     BOOL  (WINAPI *p_wglDeleteContext)(HGLRC hglrc);
     BOOL  (WINAPI *p_wglMakeCurrent)(HDC hdc, HGLRC hglrc);
-    BOOL  (WINAPI *p_wglShareLists)(HGLRC hglrc1, HGLRC hglrc2);
     HDC   (WINAPI *p_wglGetCurrentDC)(void);
     HGLRC (WINAPI *p_wglCreateContext)(HDC hdc);
     HGLRC (WINAPI *p_wglGetCurrentContext)(void);
@@ -60,10 +59,11 @@ static struct
     INT   (WINAPI *p_DescribePixelFormat)(HDC hdc, INT iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd);
     INT   (WINAPI *p_GetPixelFormat)(HDC hdc);
 
-    /* Interal WGL function */
+    /* internal WGL functions */
     void  (WINAPI *p_wglGetIntegerv)(GLenum pname, GLint* params);
     void  (WINAPI *p_wglFinish)(void);
     void  (WINAPI *p_wglFlush)(void);
+    BOOL  (WINAPI *p_wglShareLists)(HGLRC hglrc1, HGLRC hglrc2);
 } wine_wgl;
 
 #ifdef SONAME_LIBGLU
@@ -128,7 +128,12 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
  */
 BOOL WINAPI wglShareLists(HGLRC hglrc1, HGLRC hglrc2)
 {
-  return wine_wgl.p_wglShareLists(hglrc1, hglrc2);
+    if (!hglrc1 || !hglrc2)
+    {
+        SetLastError(ERROR_INVALID_HANDLE);
+        return FALSE;
+    }
+    return wine_wgl.p_wglShareLists(hglrc1, hglrc2);
 }
 
 /***********************************************************************
@@ -919,7 +924,6 @@ static BOOL process_attach(void)
   wine_wgl.p_wglCopyContext = (void *)GetProcAddress(mod_gdi32, "wglCopyContext");
   wine_wgl.p_wglDeleteContext = (void *)GetProcAddress(mod_gdi32, "wglDeleteContext");
   wine_wgl.p_wglMakeCurrent = (void *)GetProcAddress(mod_gdi32, "wglMakeCurrent");
-  wine_wgl.p_wglShareLists = (void *)GetProcAddress(mod_gdi32, "wglShareLists");
   wine_wgl.p_wglGetCurrentDC = (void *)GetProcAddress(mod_gdi32, "wglGetCurrentDC");
   wine_wgl.p_wglCreateContext = (void *)GetProcAddress(mod_gdi32, "wglCreateContext");
   wine_wgl.p_wglGetCurrentContext = (void *)GetProcAddress(mod_gdi32, "wglGetCurrentContext");
@@ -927,10 +931,11 @@ static BOOL process_attach(void)
   wine_wgl.p_DescribePixelFormat = (void *)GetProcAddress(mod_gdi32, "DescribePixelFormat");
   wine_wgl.p_GetPixelFormat = (void *)GetProcAddress(mod_gdi32, "GetPixelFormat");
 
-  /* Interal WGL function */
+  /* internal WGL functions */
   wine_wgl.p_wglGetIntegerv = (void *)wine_wgl.p_wglGetProcAddress("wglGetIntegerv");
   wine_wgl.p_wglFinish = (void *)wine_wgl.p_wglGetProcAddress("wglFinish");
   wine_wgl.p_wglFlush = (void *)wine_wgl.p_wglGetProcAddress("wglFlush");
+  wine_wgl.p_wglShareLists = (void *)wine_wgl.p_wglGetProcAddress("wglShareLists");
 
   if (!RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\OpenGL", &hkey)) {
     if (!RegQueryValueExA( hkey, "DisabledExtensions", 0, NULL, NULL, &size)) {
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index c102508..3e178db7 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -5359,9 +5359,11 @@ static BOOL InitAdapters(struct wined3d *wined3d)
 #ifdef USE_WIN32_OPENGL
     wglFinish = (void*)GetProcAddress(mod_gl, "glFinish");
     wglFlush = (void*)GetProcAddress(mod_gl, "glFlush");
+    pwglShareLists = (void*)GetProcAddress(mod_gl, "wglShareLists");
 #else
     wglFinish = (void*)pwglGetProcAddress("wglFinish");
     wglFlush = (void*)pwglGetProcAddress("wglFlush");
+    pwglShareLists = (void*)pwglGetProcAddress("wglShareLists");
 #endif
 
     glEnableWINE = glEnable;
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h
index d9a88db..ee4a133 100644
--- a/dlls/wined3d/wined3d_gl.h
+++ b/dlls/wined3d/wined3d_gl.h
@@ -1717,8 +1717,7 @@ BOOL (WINAPI *pwglShareLists)(HGLRC, HGLRC) DECLSPEC_HIDDEN;
     USE_WGL_FUNC(wglGetCurrentContext) \
     USE_WGL_FUNC(wglGetCurrentDC) \
     USE_WGL_FUNC(wglGetProcAddress) \
-    USE_WGL_FUNC(wglMakeCurrent) \
-    USE_WGL_FUNC(wglShareLists)
+    USE_WGL_FUNC(wglMakeCurrent)
 
 /* OpenGL extensions. */
 enum wined3d_gl_extension
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index b475af0..61f1791 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -1948,11 +1948,11 @@ static BOOL glxdrv_wglMakeContextCurrentARB( PHYSDEV draw_dev, PHYSDEV read_dev,
 }
 
 /**
- * glxdrv_wglShareLists
+ * X11DRV_wglShareLists
  *
  * For OpenGL32 wglShareLists.
  */
-static BOOL glxdrv_wglShareLists(HGLRC hglrc1, HGLRC hglrc2)
+static BOOL WINAPI X11DRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2)
 {
     Wine_GLContext *org  = (Wine_GLContext *) hglrc1;
     Wine_GLContext *dest = (Wine_GLContext *) hglrc2;
@@ -3254,6 +3254,7 @@ static const WineGLExtension WGL_internal_functions =
     { "wglGetIntegerv", X11DRV_wglGetIntegerv },
     { "wglFinish", X11DRV_wglFinish },
     { "wglFlush", X11DRV_wglFlush },
+    { "wglShareLists", X11DRV_wglShareLists },
   }
 };
 
@@ -3762,7 +3763,7 @@ static const struct gdi_dc_funcs glxdrv_funcs =
     glxdrv_wglMakeContextCurrentARB,    /* pwglMakeContextCurrentARB */
     glxdrv_wglMakeCurrent,              /* pwglMakeCurrent */
     glxdrv_wglSetPixelFormatWINE,       /* pwglSetPixelFormatWINE */
-    glxdrv_wglShareLists,               /* pwglShareLists */
+    NULL,                               /* pwglShareLists */
     NULL,                               /* pwglUseFontBitmapsA */
     NULL,                               /* pwglUseFontBitmapsW */
     GDI_PRIORITY_GRAPHICS_DRV + 20      /* priority */




More information about the wine-cvs mailing list