opengl32: Use wrappers for wglCreateContext and wglMakeCurrent instead of directly forwarding to gdi32.

This commit is contained in:
Louis Lenders 2011-10-30 22:13:34 +01:00 committed by Alexandre Julliard
parent e14e83837f
commit 8a2e38cc45
2 changed files with 29 additions and 12 deletions

View File

@ -336,7 +336,7 @@
@ stdcall glViewport( long long long long ) wine_glViewport
@ stdcall wglChoosePixelFormat(long ptr) gdi32.ChoosePixelFormat
@ stdcall wglCopyContext(long long long) gdi32.wglCopyContext
@ stdcall wglCreateContext(long) gdi32.wglCreateContext
@ stdcall wglCreateContext(long)
@ stdcall wglCreateLayerContext(long long)
@ stdcall wglDeleteContext(long) gdi32.wglDeleteContext
@ stdcall wglDescribeLayerPlane(long long long long ptr)
@ -347,7 +347,7 @@
@ stdcall wglGetLayerPaletteEntries(long long long long ptr)
@ stdcall wglGetPixelFormat(long) gdi32.GetPixelFormat
@ stdcall wglGetProcAddress(str)
@ stdcall wglMakeCurrent(long long) gdi32.wglMakeCurrent
@ stdcall wglMakeCurrent(long long)
@ stdcall wglRealizeLayerPalette(long long long)
@ stdcall wglSetLayerPaletteEntries(long long long long ptr)
@ stdcall wglSetPixelFormat(long long ptr) gdi32.SetPixelFormat

View File

@ -45,16 +45,15 @@
WINE_DEFAULT_DEBUG_CHANNEL(wgl);
WINE_DECLARE_DEBUG_CHANNEL(opengl);
typedef struct wine_wgl_s {
PROC WINAPI (*p_wglGetProcAddress)(LPCSTR lpszProc);
void WINAPI (*p_wglGetIntegerv)(GLenum pname, GLint* params);
void WINAPI (*p_wglFinish)(void);
void WINAPI (*p_wglFlush)(void);
} wine_wgl_t;
/** global wgl object */
static wine_wgl_t wine_wgl;
static struct
{
PROC (WINAPI *p_wglGetProcAddress)(LPCSTR lpszProc);
BOOL (WINAPI *p_wglMakeCurrent)(HDC hdc, HGLRC hglrc);
HGLRC (WINAPI *p_wglCreateContext)(HDC hdc);
void (WINAPI *p_wglGetIntegerv)(GLenum pname, GLint* params);
void (WINAPI *p_wglFinish)(void);
void (WINAPI *p_wglFlush)(void);
} wine_wgl;
#ifdef SONAME_LIBGLU
#define MAKE_FUNCPTR(f) static typeof(f) * p##f;
@ -116,6 +115,22 @@ void enter_gl(void)
const GLubyte * WINAPI wine_glGetString( GLenum name );
/***********************************************************************
* wglMakeCurrent (OPENGL32.@)
*/
BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
{
return wine_wgl.p_wglMakeCurrent(hdc, hglrc);
}
/***********************************************************************
* wglCreateContext (OPENGL32.@)
*/
HGLRC WINAPI wglCreateContext(HDC hdc)
{
return wine_wgl.p_wglCreateContext(hdc);
}
/***********************************************************************
* wglCreateLayerContext (OPENGL32.@)
*/
@ -720,6 +735,8 @@ static BOOL process_attach(void)
wine_tsx11_unlock_ptr = (void *)GetProcAddress( mod_x11, "wine_tsx11_unlock" );
wine_wgl.p_wglGetProcAddress = (void *)GetProcAddress(mod_gdi32, "wglGetProcAddress");
wine_wgl.p_wglMakeCurrent = (void *)GetProcAddress(mod_gdi32, "wglMakeCurrent");
wine_wgl.p_wglCreateContext = (void *)GetProcAddress(mod_gdi32, "wglCreateContext");
/* Interal WGL function */
wine_wgl.p_wglGetIntegerv = (void *)wine_wgl.p_wglGetProcAddress("wglGetIntegerv");