From c698adf0670839e72c2b609d6d8d48e23c25a3dc Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Thu, 15 Nov 2007 12:57:21 +0000 Subject: [PATCH] Implement wglGetDefaultProcAddress ------------------------------------ Simple copy the wglGetProcAddress, it is only one different between them it is wglGetProcAddress should call on glflush to clear the interface before it give the address. svn path=/trunk/; revision=30459 --- reactos/dll/win32/opengl32/opengl32.def | 2 +- reactos/dll/win32/opengl32/wgl.c | 31 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/reactos/dll/win32/opengl32/opengl32.def b/reactos/dll/win32/opengl32/opengl32.def index ac1f89a3997..666dd92ebe0 100644 --- a/reactos/dll/win32/opengl32/opengl32.def +++ b/reactos/dll/win32/opengl32/opengl32.def @@ -383,7 +383,7 @@ wglDescribeLayerPlane@20=rosglDescribeLayerPlane@20 wglDescribePixelFormat@16=rosglDescribePixelFormat@16 wglGetCurrentContext@0=rosglGetCurrentContext@0 wglGetCurrentDC@0=rosglGetCurrentDC@0 -;wglGetDefaultProcAddress=rosglGetDefaultProcAddress@ +wglGetDefaultProcAddress=rosglGetDefaultProcAddress@4 wglGetLayerPaletteEntries@20=rosglGetLayerPaletteEntries@20 wglGetPixelFormat@4=rosglGetPixelFormat@4 wglGetProcAddress@4=rosglGetProcAddress@4 diff --git a/reactos/dll/win32/opengl32/wgl.c b/reactos/dll/win32/opengl32/wgl.c index 96be9621474..105b0c4932e 100644 --- a/reactos/dll/win32/opengl32/wgl.c +++ b/reactos/dll/win32/opengl32/wgl.c @@ -909,6 +909,37 @@ rosglGetProcAddress( LPCSTR proc ) PROC func; GLDRIVERDATA *icd; + /* FIXME we should Flush the gl here */ + + if (OPENGL32_threaddata->glrc == NULL) + { + DBGPRINT( "Error: No current GLRC!" ); + SetLastError( ERROR_INVALID_FUNCTION ); + return NULL; + } + + icd = OPENGL32_threaddata->glrc->icd; + func = icd->DrvGetProcAddress( proc ); + if (func != NULL) + { + DBGPRINT( "Info: Proc \"%s\" loaded from ICD.", proc ); + return func; + } + + /* FIXME: Should we return wgl/gl 1.1 functions? */ + SetLastError( ERROR_PROC_NOT_FOUND ); + return NULL; +} + +PROC +APIENTRY +rosglGetDefaultProcAddress( LPCSTR proc ) +{ + PROC func; + GLDRIVERDATA *icd; + + /* wglGetDefaultProcAddress does not flush the gl */ + if (OPENGL32_threaddata->glrc == NULL) { DBGPRINT( "Error: No current GLRC!" );