Stefan Leichter : opengl32: Replace the remaining forwards of wgl functions to gdi32. dll in the spec file with wrapper function.

Alexandre Julliard julliard at winehq.org
Fri Jan 6 15:31:36 CST 2012


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

Author: Stefan Leichter <Stefan.Leichter at camline.com>
Date:   Fri Jan  6 11:00:18 2012 +0100

opengl32: Replace the remaining forwards of wgl functions to gdi32.dll in the spec file with wrapper function.

---

 dlls/opengl32/opengl32.spec |   22 ++++----
 dlls/opengl32/wgl.c         |  113 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 124 insertions(+), 11 deletions(-)

diff --git a/dlls/opengl32/opengl32.spec b/dlls/opengl32/opengl32.spec
index 3fcaa3c..a83a142 100644
--- a/dlls/opengl32/opengl32.spec
+++ b/dlls/opengl32/opengl32.spec
@@ -334,27 +334,27 @@
 @  stdcall glVertex4sv( ptr ) wine_glVertex4sv
 @  stdcall glVertexPointer( long long long ptr ) wine_glVertexPointer
 @  stdcall glViewport( long long long long ) wine_glViewport
-@  stdcall wglChoosePixelFormat(long ptr) gdi32.ChoosePixelFormat
-@  stdcall wglCopyContext(long long long) gdi32.wglCopyContext
+@  stdcall wglChoosePixelFormat(long ptr)
+@  stdcall wglCopyContext(long long long)
 @  stdcall wglCreateContext(long)
 @  stdcall wglCreateLayerContext(long long)
-@  stdcall wglDeleteContext(long) gdi32.wglDeleteContext
+@  stdcall wglDeleteContext(long)
 @  stdcall wglDescribeLayerPlane(long long long long ptr)
-@  stdcall wglDescribePixelFormat(long long long ptr) gdi32.DescribePixelFormat
-@  stdcall wglGetCurrentContext() gdi32.wglGetCurrentContext
-@  stdcall wglGetCurrentDC() gdi32.wglGetCurrentDC
+@  stdcall wglDescribePixelFormat(long long long ptr)
+@  stdcall wglGetCurrentContext()
+@  stdcall wglGetCurrentDC()
 @  stub    wglGetDefaultProcAddress
 @  stdcall wglGetLayerPaletteEntries(long long long long ptr)
-@  stdcall wglGetPixelFormat(long) gdi32.GetPixelFormat
+@  stdcall wglGetPixelFormat(long)
 @  stdcall wglGetProcAddress(str)
 @  stdcall wglMakeCurrent(long long)
 @  stdcall wglRealizeLayerPalette(long long long)
 @  stdcall wglSetLayerPaletteEntries(long long long long ptr)
-@  stdcall wglSetPixelFormat(long long ptr) gdi32.SetPixelFormat
-@  stdcall wglShareLists(long long) gdi32.wglShareLists
+@  stdcall wglSetPixelFormat(long long ptr)
+@  stdcall wglShareLists(long long)
 @  stdcall wglSwapBuffers(long)
 @  stdcall wglSwapLayerBuffers(long long)
-@  stdcall wglUseFontBitmapsA(long long long long) gdi32.wglUseFontBitmapsA
-@  stdcall wglUseFontBitmapsW(long long long long) gdi32.wglUseFontBitmapsW
+@  stdcall wglUseFontBitmapsA(long long long long)
+@  stdcall wglUseFontBitmapsW(long long long long)
 @  stdcall wglUseFontOutlinesA(long long long long long long long ptr)
 @  stdcall wglUseFontOutlinesW(long long long long long long long ptr)
diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c
index 74f3d88..cdd6686 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -48,8 +48,21 @@ WINE_DECLARE_DEBUG_CHANNEL(opengl);
 static struct
 {
     PROC  (WINAPI *p_wglGetProcAddress)(LPCSTR  lpszProc);
+    BOOL  (WINAPI *p_SetPixelFormat)(HDC hdc, INT iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd);
+    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);
+    BOOL  (WINAPI *p_wglUseFontBitmapsA)(HDC hdc, DWORD first, DWORD count, DWORD listBase);
+    BOOL  (WINAPI *p_wglUseFontBitmapsW)(HDC hdc, DWORD first, DWORD count, DWORD listBase);
+    HDC   (WINAPI *p_wglGetCurrentDC)(void);
     HGLRC (WINAPI *p_wglCreateContext)(HDC hdc);
+    HGLRC (WINAPI *p_wglGetCurrentContext)(void);
+    INT   (WINAPI *p_ChoosePixelFormat)(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd);
+    INT   (WINAPI *p_DescribePixelFormat)(HDC hdc, INT iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd);
+    INT   (WINAPI *p_GetPixelFormat)(HDC hdc);
+
+    /* Interal WGL function */
     void  (WINAPI *p_wglGetIntegerv)(GLenum pname, GLint* params);
     void  (WINAPI *p_wglFinish)(void);
     void  (WINAPI *p_wglFlush)(void);
@@ -116,6 +129,31 @@ void enter_gl(void)
 const GLubyte * WINAPI wine_glGetString( GLenum name );
 
 /***********************************************************************
+ *		 wglSetPixelFormat(OPENGL32.@)
+ */
+BOOL WINAPI wglSetPixelFormat( HDC hdc, INT iPixelFormat,
+                               const PIXELFORMATDESCRIPTOR *ppfd)
+{
+  return wine_wgl.p_SetPixelFormat(hdc, iPixelFormat, ppfd);
+}
+
+/***********************************************************************
+ *		wglCopyContext (OPENGL32.@)
+ */
+BOOL WINAPI wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask)
+{
+  return wine_wgl.p_wglCopyContext(hglrcSrc, hglrcDst, mask);
+}
+
+/***********************************************************************
+ *		wglDeleteContext (OPENGL32.@)
+ */
+BOOL WINAPI wglDeleteContext(HGLRC hglrc)
+{
+  return wine_wgl.p_wglDeleteContext(hglrc);
+}
+
+/***********************************************************************
  *		wglMakeCurrent (OPENGL32.@)
  */
 BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
@@ -124,6 +162,38 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
 }
 
 /***********************************************************************
+ *		wglShareLists (OPENGL32.@)
+ */
+BOOL WINAPI wglShareLists(HGLRC hglrc1, HGLRC hglrc2)
+{
+  return wine_wgl.p_wglShareLists(hglrc1, hglrc2);
+}
+
+/***********************************************************************
+ *		wglUseFontBitmapsA (OPENGL32.@)
+ */
+BOOL WINAPI wglUseFontBitmapsA(HDC hdc, DWORD first, DWORD count, DWORD listBase)
+{
+  return wine_wgl.p_wglUseFontBitmapsA(hdc, first, count, listBase);
+}
+
+/***********************************************************************
+ *		wglUseFontBitmapsW (OPENGL32.@)
+ */
+BOOL WINAPI wglUseFontBitmapsW(HDC hdc, DWORD first, DWORD count, DWORD listBase)
+{
+  return wine_wgl.p_wglUseFontBitmapsW(hdc, first, count, listBase);
+}
+
+/***********************************************************************
+ *		wglGetCurrentDC (OPENGL32.@)
+ */
+HDC WINAPI wglGetCurrentDC(void)
+{
+  return wine_wgl.p_wglGetCurrentDC();
+}
+
+/***********************************************************************
  *		wglCreateContext (OPENGL32.@)
  */
 HGLRC WINAPI wglCreateContext(HDC hdc)
@@ -132,6 +202,38 @@ HGLRC WINAPI wglCreateContext(HDC hdc)
 }
 
 /***********************************************************************
+ *		wglGetCurrentContext (OPENGL32.@)
+ */
+HGLRC WINAPI wglGetCurrentContext(void)
+{
+  return wine_wgl.p_wglGetCurrentContext();
+}
+
+/***********************************************************************
+ *		wglChoosePixelFormat (OPENGL32.@)
+ */
+INT WINAPI wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd)
+{
+  return wine_wgl.p_ChoosePixelFormat(hdc, ppfd);
+}
+
+/***********************************************************************
+ *		wglDescribePixelFormat (OPENGL32.@)
+ */
+INT WINAPI wglDescribePixelFormat(HDC hdc, INT iPixelFormat, UINT nBytes,
+                                LPPIXELFORMATDESCRIPTOR ppfd)
+{
+  return wine_wgl.p_DescribePixelFormat(hdc, iPixelFormat, nBytes, ppfd);
+}
+/***********************************************************************
+ *		wglGetPixelFormat (OPENGL32.@)
+ */
+INT WINAPI wglGetPixelFormat(HDC hdc)
+{
+  return wine_wgl.p_GetPixelFormat(hdc);
+}
+
+/***********************************************************************
  *		wglCreateLayerContext (OPENGL32.@)
  */
 HGLRC WINAPI wglCreateLayerContext(HDC hdc,
@@ -735,8 +837,19 @@ static BOOL process_attach(void)
   wine_tsx11_unlock_ptr = (void *)GetProcAddress( mod_x11, "wine_tsx11_unlock" );
 
   wine_wgl.p_wglGetProcAddress = (void *)GetProcAddress(mod_gdi32, "wglGetProcAddress");
+  wine_wgl.p_SetPixelFormat = (void *)GetProcAddress(mod_gdi32, "SetPixelFormat");
+  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_wglUseFontBitmapsA = (void *)GetProcAddress(mod_gdi32, "wglUseFontBitmapsA");
+  wine_wgl.p_wglUseFontBitmapsW = (void *)GetProcAddress(mod_gdi32, "wglUseFontBitmapsW");
+  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");
+  wine_wgl.p_ChoosePixelFormat = (void *)GetProcAddress(mod_gdi32, "ChoosePixelFormat");
+  wine_wgl.p_DescribePixelFormat = (void *)GetProcAddress(mod_gdi32, "DescribePixelFormat");
+  wine_wgl.p_GetPixelFormat = (void *)GetProcAddress(mod_gdi32, "GetPixelFormat");
 
   /* Interal WGL function */
   wine_wgl.p_wglGetIntegerv = (void *)wine_wgl.p_wglGetProcAddress("wglGetIntegerv");




More information about the wine-cvs mailing list