From 3c1f6ec61bc25dd843c777e896b26cf250c9939a Mon Sep 17 00:00:00 2001 From: Louis Lenders Date: Sun, 30 Oct 2011 22:13:34 +0100 Subject: opengl32:use wrappers for wglCreateContext and wglMakeCurrent instead of directly forwarding to gdi32. --- dlls/opengl32/opengl32.spec | 4 ++-- dlls/opengl32/wgl.c | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/dlls/opengl32/opengl32.spec b/dlls/opengl32/opengl32.spec index 9bd232f..3fcaa3c 100644 --- a/dlls/opengl32/opengl32.spec +++ b/dlls/opengl32/opengl32.spec @@ -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 diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index cd60eb2..2f969f8 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -47,6 +47,8 @@ WINE_DECLARE_DEBUG_CHANNEL(opengl); typedef struct wine_wgl_s { 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); @@ -117,6 +119,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.@) */ HGLRC WINAPI wglCreateLayerContext(HDC hdc, @@ -720,6 +738,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"); -- 1.7.5.4