... and here the patch
diff --git a/dlls/gdi/driver.c b/dlls/gdi/driver.c
index 9f40a8d..012d882 100644
--- a/dlls/gdi/driver.c
+++ b/dlls/gdi/driver.c
@@ -194,6 +194,33 @@ #define GET_FUNC(name) driver->funcs.p##
         GET_FUNC(StrokePath);
         GET_FUNC(SwapBuffers);
         GET_FUNC(WidenPath);
+
+        /* Wine OpenGL implementation */
+        GET_FUNC(WineGL_wglChoosePixelFormat);
+        GET_FUNC(WineGL_wglCopyContext);
+        GET_FUNC(WineGL_wglCreateContext);
+        GET_FUNC(WineGL_wglCreateLayerContext);
+        GET_FUNC(WineGL_wglDeleteContext);
+        GET_FUNC(WineGL_wglDescribeLayerPlane);
+        GET_FUNC(WineGL_wglDescribePixelFormat);
+        GET_FUNC(WineGL_wglGetCurrentContext);
+        GET_FUNC(WineGL_wglGetCurrentDC);
+        GET_FUNC(WineGL_wglGetDefaultProcAddress);
+        GET_FUNC(WineGL_wglGetLayerPaletteEntries);
+        GET_FUNC(WineGL_wglGetPixelFormat);
+        GET_FUNC(WineGL_wglGetProcAddress);
+        GET_FUNC(WineGL_wglMakeCurrent);
+        GET_FUNC(WineGL_wglRealizeLayerPalette);
+        GET_FUNC(WineGL_wglSetLayerPaletteEntries);
+        GET_FUNC(WineGL_wglSetPixelFormat);
+        GET_FUNC(WineGL_wglShareLists);
+        GET_FUNC(WineGL_wglSwapBuffers);
+        GET_FUNC(WineGL_wglSwapLayerBuffers);
+        GET_FUNC(WineGL_wglUseFontBitmaps);
+        GET_FUNC(WineGL_wglUseFontOutlines);
+        
+        GET_FUNC(WineGL_glGetIntegerv);
+
 #undef GET_FUNC
     }
     else memset( &driver->funcs, 0, sizeof(driver->funcs) );
@@ -705,3 +732,147 @@ INT WINAPI DrawEscape(HDC hdc, INT nEsca
     FIXME("DrawEscape, stub\n");
     return 0;
 }
+
+
+/*******************************************************************
+ * OpenGL wrapper functions
+ */
+
+#define WINEGL_WRAPPER_CREATE(retType, funcName, argPrototype, args)          \
+retType WINAPI WineGLWrapper_##funcName argPrototype                          \
+{                                                                             \
+    return display_driver->funcs.pWineGL_##funcName args ;                    \
+}                                                                             \
+
+WINEGL_WRAPPER_CREATE(
+	INT, wglChoosePixelFormat, (HDC hdc, const PIXELFORMATDESCRIPTOR *pfd),
+	(hdc, pfd)
+)
+
+WINEGL_WRAPPER_CREATE(
+	BOOL, wglCopyContext, (HGLRC hglrc1, HGLRC hglrc2, UINT uint),
+	(hglrc1, hglrc2, uint)
+)
+
+WINEGL_WRAPPER_CREATE(
+	HGLRC, wglCreateContext, (HDC hdc),
+	(hdc)
+)
+
+WINEGL_WRAPPER_CREATE(
+	HGLRC, wglCreateLayerContext, (HDC hdc, INT i),
+	(hdc, i)
+)
+
+WINEGL_WRAPPER_CREATE(
+	BOOL, wglDeleteContext, (HGLRC hglrc),
+	(hglrc)
+)
+
+WINEGL_WRAPPER_CREATE(
+	BOOL, wglDescribeLayerPlane, (HDC hdc, INT i1, INT i2, UINT uint, LPLAYERPLANEDESCRIPTOR lpLPD),
+	(hdc, i1, i2, uint, lpLPD)
+)
+
+WINEGL_WRAPPER_CREATE(
+	INT, wglDescribePixelFormat, (HDC hdc, INT i, UINT uint, LPPIXELFORMATDESCRIPTOR lpPFD),
+	(hdc, i, uint, lpPFD)
+)
+
+WINEGL_WRAPPER_CREATE(
+	HGLRC, wglGetCurrentContext, (void),
+	()
+)
+
+WINEGL_WRAPPER_CREATE(
+	HDC, wglGetCurrentDC, (void),
+	()
+)
+
+WINEGL_WRAPPER_CREATE(
+	PROC, wglGetDefaultProcAddress, (LPCSTR lpcstr),
+	(lpcstr)
+)
+
+WINEGL_WRAPPER_CREATE(
+	INT, wglGetLayerPaletteEntries, (HDC hdc, INT i1, INT i2, INT i3, const COLORREF *cref),
+	(hdc, i1, i2, i3, cref)
+)
+
+WINEGL_WRAPPER_CREATE(
+    INT, wglGetPixelFormat, (HDC hdc),
+	(hdc)
+)
+
+WINEGL_WRAPPER_CREATE(
+	PROC, wglGetProcAddress, (LPCSTR lpcstr),
+	(lpcstr)
+)
+
+WINEGL_WRAPPER_CREATE(
+	BOOL, wglMakeCurrent, (HDC hdc, HGLRC hglrc),
+	(hdc, hglrc)
+)
+
+WINEGL_WRAPPER_CREATE(
+	BOOL, wglRealizeLayerPalette, (HDC hdc, INT i, BOOL b),
+	(hdc, i, b)
+)
+
+WINEGL_WRAPPER_CREATE(
+	INT, wglSetLayerPaletteEntries, (HDC hdc, INT i1, INT i2, INT i3, const COLORREF *cref), 
+	(hdc, i1, i2, i3, cref)
+)
+
+WINEGL_WRAPPER_CREATE(
+	BOOL, wglSetPixelFormat, (HDC hdc, INT i, const PIXELFORMATDESCRIPTOR *pfd),
+	(hdc, i, pfd)
+)
+
+WINEGL_WRAPPER_CREATE(
+	BOOL, wglShareLists, (HGLRC hglrc1, HGLRC hglrc2),
+	(hglrc1, hglrc2)
+)
+
+WINEGL_WRAPPER_CREATE(
+	BOOL, wglSwapBuffers, (HDC hdc),
+	(hdc)
+)
+
+WINEGL_WRAPPER_CREATE(
+	BOOL, wglSwapLayerBuffers, (HDC hdc, UINT uint),
+	(hdc, uint)
+)
+
+WINEGL_WRAPPER_CREATE(
+	BOOL, wglUseFontBitmaps, (HDC hdc, DWORD dw1, DWORD dw2, DWORD dw3),
+	(hdc, dw1, dw2, dw3)
+)
+
+WINEGL_WRAPPER_CREATE(
+	BOOL, wglUseFontOutlines, (HDC hdc, DWORD dw1, DWORD dw2, DWORD dw3, FLOAT f1, FLOAT f2, INT i, LPGLYPHMETRICSFLOAT lpGMF),	
+	(hdc, dw1, dw2, dw3, f1, f2, i, lpGMF)
+)
+
+WINEGL_WRAPPER_CREATE(
+	VOID, glGetIntegerv, (DWORD pname, INT *params),
+	(pname, params)
+)
+
+
+/*******************************************************************
+ * low-level driver functions
+ */
+
+void * WINAPI wineGetDCPrivate(HDC hdc)
+{
+    void * ret = NULL;
+    DC * dc = DC_GetDCPtr(hdc);
+
+    if (dc) {
+        ret = (void *) dc->physDev;
+        GDI_ReleaseObj(hdc);
+    }
+
+    return ret;  
+}
diff --git a/dlls/gdi/gdi32.spec b/dlls/gdi/gdi32.spec
index 1c245d8..ac189db 100644
--- a/dlls/gdi/gdi32.spec
+++ b/dlls/gdi/gdi32.spec
@@ -522,3 +522,36 @@ #
 @ cdecl DIB_CreateDIBSection(long ptr long ptr long long long)
 @ cdecl GDI_GetObjPtr(long long)
 @ cdecl GDI_ReleaseObj(long)
+
+################################################################
+# OpenGL wrapper functions
+#
+@ stdcall WineGLWrapper_wglChoosePixelFormat(long ptr)
+@ stdcall WineGLWrapper_wglCopyContext(long long long)
+@ stdcall WineGLWrapper_wglCreateContext(long)
+@ stdcall WineGLWrapper_wglCreateLayerContext(long long)
+@ stdcall WineGLWrapper_wglDeleteContext(long)
+@ stdcall WineGLWrapper_wglDescribeLayerPlane(long long long long long)
+@ stdcall WineGLWrapper_wglDescribePixelFormat(long long long ptr)
+@ stdcall WineGLWrapper_wglGetCurrentContext()
+@ stdcall WineGLWrapper_wglGetCurrentDC()
+@ stdcall WineGLWrapper_wglGetDefaultProcAddress(str)
+@ stdcall WineGLWrapper_wglGetLayerPaletteEntries(long long long long ptr)
+@ stdcall WineGLWrapper_wglGetPixelFormat(long)
+@ stdcall WineGLWrapper_wglGetProcAddress(str)
+@ stdcall WineGLWrapper_wglMakeCurrent(long long)
+@ stdcall WineGLWrapper_wglRealizeLayerPalette(long long long)
+@ stdcall WineGLWrapper_wglSetLayerPaletteEntries(long long long long ptr)
+@ stdcall WineGLWrapper_wglSetPixelFormat(long long ptr)
+@ stdcall WineGLWrapper_wglShareLists(long long)
+@ stdcall WineGLWrapper_wglSwapBuffers(long)
+@ stdcall WineGLWrapper_wglSwapLayerBuffers(long long)
+@ stdcall WineGLWrapper_wglUseFontBitmaps(long long long long)
+@ stdcall WineGLWrapper_wglUseFontOutlines(long long long long long long long ptr)
+
+@ stdcall WineGLWrapper_glGetIntegerv(long ptr)
+
+################################################################
+# low-level driver functions
+#
+@ stdcall wineGetDCPrivate(long)
diff --git a/dlls/gdi/gdi_private.h b/dlls/gdi/gdi_private.h
index dfdb008..5f73528 100644
--- a/dlls/gdi/gdi_private.h
+++ b/dlls/gdi/gdi_private.h
@@ -182,6 +182,32 @@ typedef struct tagDC_FUNCS
     BOOL     (*pStrokePath)(PHYSDEV);
     BOOL     (*pSwapBuffers)(PHYSDEV);
     BOOL     (*pWidenPath)(PHYSDEV);
+
+    /* OpenGL driver functions */
+    INT      (*pWineGL_wglChoosePixelFormat)(HDC,const PIXELFORMATDESCRIPTOR *);
+    BOOL     (*pWineGL_wglCopyContext)(HGLRC,HGLRC,UINT);
+    HGLRC    (*pWineGL_wglCreateContext)(HDC);
+    HGLRC    (*pWineGL_wglCreateLayerContext)(HDC,INT);
+    BOOL     (*pWineGL_wglDeleteContext)(HGLRC);
+    BOOL     (*pWineGL_wglDescribeLayerPlane)(HDC,INT,INT,UINT,LPLAYERPLANEDESCRIPTOR);
+    INT      (*pWineGL_wglDescribePixelFormat)(HDC,INT,UINT,LPPIXELFORMATDESCRIPTOR);
+    HGLRC    (*pWineGL_wglGetCurrentContext)(void);
+    HDC      (*pWineGL_wglGetCurrentDC)(void);
+    PROC     (*pWineGL_wglGetDefaultProcAddress)(LPCSTR);
+    INT      (*pWineGL_wglGetLayerPaletteEntries)(HDC,INT,INT,INT,const COLORREF *);
+    INT      (*pWineGL_wglGetPixelFormat)(HDC);
+    PROC     (*pWineGL_wglGetProcAddress)(LPCSTR);
+    BOOL     (*pWineGL_wglMakeCurrent)(HDC,HGLRC);
+    BOOL     (*pWineGL_wglRealizeLayerPalette)(HDC,INT,BOOL);
+    INT      (*pWineGL_wglSetLayerPaletteEntries)(HDC,INT,INT,INT,const COLORREF *);
+    BOOL     (*pWineGL_wglSetPixelFormat)(HDC,INT,const PIXELFORMATDESCRIPTOR *);
+    BOOL     (*pWineGL_wglShareLists)(HGLRC,HGLRC);
+    BOOL     (*pWineGL_wglSwapBuffers)(HDC);
+    BOOL     (*pWineGL_wglSwapLayerBuffers)(HDC,UINT);
+    BOOL     (*pWineGL_wglUseFontBitmaps)(HDC,DWORD,DWORD,DWORD);
+    BOOL     (*pWineGL_wglUseFontOutlines)(HDC,DWORD,DWORD,DWORD,FLOAT,FLOAT,INT,LPGLYPHMETRICSFLOAT);
+    
+    VOID     (*pWineGL_glGetIntegerv)(DWORD,INT*);
 } DC_FUNCTIONS;
 
 /* It should not be necessary to access the contents of the GdiPath


Reply via email to