diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 16a76dbb43a..9761bba5314 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -132,6 +132,14 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc) return wgl_driver->p_wglMakeCurrent(hdc, hglrc); } +/*********************************************************************** + * wglMakeContextCurrentARB (wrapper for the extension function returned by the driver) + */ +static BOOL WINAPI wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC hglrc ) +{ + return wgl_driver->p_wglMakeContextCurrentARB( draw_hdc, read_hdc, hglrc ); +} + /*********************************************************************** * wglShareLists (OPENGL32.@) */ @@ -487,7 +495,20 @@ PROC WINAPI wglGetProcAddress(LPCSTR lpszProc) { if (ext_ret == NULL) { /* If the function name starts with a 'w', it is a WGL extension */ if(lpszProc[0] == 'w') - return wine_wgl.p_wglGetProcAddress(lpszProc); + { + local_func = wine_wgl.p_wglGetProcAddress( lpszProc ); + if (local_func == (void *)1) /* special function that needs a wrapper */ + { + if (!strcmp( lpszProc, "wglMakeContextCurrentARB" )) + local_func = wglMakeContextCurrentARB; + else + { + FIXME( "wrapper missing for %s\n", lpszProc ); + local_func = NULL; + } + } + return local_func; + } /* We are dealing with an unknown GL extension */ WARN("Extension '%s' not defined in opengl32.dll's function table!\n", lpszProc); diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 4c1ce9c7d69..f99e98c1d44 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1654,12 +1654,10 @@ static BOOL glxdrv_wglMakeCurrent(HDC hdc, HGLRC hglrc) return ret; } -/** - * X11DRV_wglMakeContextCurrentARB - * - * For OpenGL32 wglMakeContextCurrentARB +/*********************************************************************** + * glxdrv_wglMakeContextCurrentARB */ -static BOOL WINAPI X11DRV_wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC hglrc ) +static BOOL glxdrv_wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC hglrc ) { Wine_GLContext *ctx = (Wine_GLContext *)hglrc; Wine_GLContext *prev_ctx = NtCurrentTeb()->glContext; @@ -3095,7 +3093,7 @@ static const WineGLExtension WGL_ARB_make_current_read = "WGL_ARB_make_current_read", { { "wglGetCurrentReadDCARB", X11DRV_wglGetCurrentReadDCARB }, - { "wglMakeContextCurrentARB", X11DRV_wglMakeContextCurrentARB }, + { "wglMakeContextCurrentARB", (void *)1 /* called through the glxdrv_wgl_funcs driver */ }, } }; @@ -3604,6 +3602,7 @@ static const struct wgl_funcs glxdrv_wgl_funcs = glxdrv_wglCopyContext, /* p_wglCopyContext */ glxdrv_wglDeleteContext, /* p_wglDeleteContext */ glxdrv_wglGetCurrentDC, /* p_wglGetCurrentDC */ + glxdrv_wglMakeContextCurrentARB, /* p_wglMakeContextCurrentARB */ glxdrv_wglMakeCurrent, /* p_wglMakeCurrent */ glxdrv_wglShareLists, /* p_wglShareLists */ }; diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index 7a17d0902d4..4f4ad940ead 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -203,7 +203,7 @@ struct gdi_dc_funcs }; /* increment this when you change the DC function table */ -#define WINE_GDI_DRIVER_VERSION 33 +#define WINE_GDI_DRIVER_VERSION 34 #define GDI_PRIORITY_NULL_DRV 0 /* null driver */ #define GDI_PRIORITY_FONT_DRV 100 /* any font driver */ @@ -236,6 +236,7 @@ struct wgl_funcs BOOL (*p_wglCopyContext)(HGLRC,HGLRC,UINT); BOOL (*p_wglDeleteContext)(HGLRC); HDC (*p_wglGetCurrentDC)(void); + BOOL (*p_wglMakeContextCurrentARB)(HDC,HDC,HGLRC); BOOL (*p_wglMakeCurrent)(HDC,HGLRC); BOOL (*p_wglShareLists)(HGLRC,HGLRC); };