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!" );