winex11: Move wglShareLists to the internal OpenGL extension functions.

This commit is contained in:
Alexandre Julliard 2012-06-25 12:12:40 +02:00
parent 1bca4fb5ae
commit beeba895d3
4 changed files with 17 additions and 10 deletions

View File

@ -52,7 +52,6 @@ static struct
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);
HDC (WINAPI *p_wglGetCurrentDC)(void);
HGLRC (WINAPI *p_wglCreateContext)(HDC hdc);
HGLRC (WINAPI *p_wglGetCurrentContext)(void);
@ -60,10 +59,11 @@ static struct
INT (WINAPI *p_DescribePixelFormat)(HDC hdc, INT iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd);
INT (WINAPI *p_GetPixelFormat)(HDC hdc);
/* Interal WGL function */
/* internal WGL functions */
void (WINAPI *p_wglGetIntegerv)(GLenum pname, GLint* params);
void (WINAPI *p_wglFinish)(void);
void (WINAPI *p_wglFlush)(void);
BOOL (WINAPI *p_wglShareLists)(HGLRC hglrc1, HGLRC hglrc2);
} wine_wgl;
#ifdef SONAME_LIBGLU
@ -128,7 +128,12 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
*/
BOOL WINAPI wglShareLists(HGLRC hglrc1, HGLRC hglrc2)
{
return wine_wgl.p_wglShareLists(hglrc1, hglrc2);
if (!hglrc1 || !hglrc2)
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
return wine_wgl.p_wglShareLists(hglrc1, hglrc2);
}
/***********************************************************************
@ -919,7 +924,6 @@ static BOOL process_attach(void)
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_wglGetCurrentDC = (void *)GetProcAddress(mod_gdi32, "wglGetCurrentDC");
wine_wgl.p_wglCreateContext = (void *)GetProcAddress(mod_gdi32, "wglCreateContext");
wine_wgl.p_wglGetCurrentContext = (void *)GetProcAddress(mod_gdi32, "wglGetCurrentContext");
@ -927,10 +931,11 @@ static BOOL process_attach(void)
wine_wgl.p_DescribePixelFormat = (void *)GetProcAddress(mod_gdi32, "DescribePixelFormat");
wine_wgl.p_GetPixelFormat = (void *)GetProcAddress(mod_gdi32, "GetPixelFormat");
/* Interal WGL function */
/* internal WGL functions */
wine_wgl.p_wglGetIntegerv = (void *)wine_wgl.p_wglGetProcAddress("wglGetIntegerv");
wine_wgl.p_wglFinish = (void *)wine_wgl.p_wglGetProcAddress("wglFinish");
wine_wgl.p_wglFlush = (void *)wine_wgl.p_wglGetProcAddress("wglFlush");
wine_wgl.p_wglShareLists = (void *)wine_wgl.p_wglGetProcAddress("wglShareLists");
if (!RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\OpenGL", &hkey)) {
if (!RegQueryValueExA( hkey, "DisabledExtensions", 0, NULL, NULL, &size)) {

View File

@ -5359,9 +5359,11 @@ static BOOL InitAdapters(struct wined3d *wined3d)
#ifdef USE_WIN32_OPENGL
wglFinish = (void*)GetProcAddress(mod_gl, "glFinish");
wglFlush = (void*)GetProcAddress(mod_gl, "glFlush");
pwglShareLists = (void*)GetProcAddress(mod_gl, "wglShareLists");
#else
wglFinish = (void*)pwglGetProcAddress("wglFinish");
wglFlush = (void*)pwglGetProcAddress("wglFlush");
pwglShareLists = (void*)pwglGetProcAddress("wglShareLists");
#endif
glEnableWINE = glEnable;

View File

@ -1717,8 +1717,7 @@ BOOL (WINAPI *pwglShareLists)(HGLRC, HGLRC) DECLSPEC_HIDDEN;
USE_WGL_FUNC(wglGetCurrentContext) \
USE_WGL_FUNC(wglGetCurrentDC) \
USE_WGL_FUNC(wglGetProcAddress) \
USE_WGL_FUNC(wglMakeCurrent) \
USE_WGL_FUNC(wglShareLists)
USE_WGL_FUNC(wglMakeCurrent)
/* OpenGL extensions. */
enum wined3d_gl_extension

View File

@ -1948,11 +1948,11 @@ static BOOL glxdrv_wglMakeContextCurrentARB( PHYSDEV draw_dev, PHYSDEV read_dev,
}
/**
* glxdrv_wglShareLists
* X11DRV_wglShareLists
*
* For OpenGL32 wglShareLists.
*/
static BOOL glxdrv_wglShareLists(HGLRC hglrc1, HGLRC hglrc2)
static BOOL WINAPI X11DRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2)
{
Wine_GLContext *org = (Wine_GLContext *) hglrc1;
Wine_GLContext *dest = (Wine_GLContext *) hglrc2;
@ -3254,6 +3254,7 @@ static const WineGLExtension WGL_internal_functions =
{ "wglGetIntegerv", X11DRV_wglGetIntegerv },
{ "wglFinish", X11DRV_wglFinish },
{ "wglFlush", X11DRV_wglFlush },
{ "wglShareLists", X11DRV_wglShareLists },
}
};
@ -3762,7 +3763,7 @@ static const struct gdi_dc_funcs glxdrv_funcs =
glxdrv_wglMakeContextCurrentARB, /* pwglMakeContextCurrentARB */
glxdrv_wglMakeCurrent, /* pwglMakeCurrent */
glxdrv_wglSetPixelFormatWINE, /* pwglSetPixelFormatWINE */
glxdrv_wglShareLists, /* pwglShareLists */
NULL, /* pwglShareLists */
NULL, /* pwglUseFontBitmapsA */
NULL, /* pwglUseFontBitmapsW */
GDI_PRIORITY_GRAPHICS_DRV + 20 /* priority */