wgl: Move wglDeleteContext to gdi32.

This commit is contained in:
Roderick Colenbrander 2006-10-16 23:28:33 +02:00 committed by Alexandre Julliard
parent 449e8557fd
commit 7eea8b9312
5 changed files with 28 additions and 12 deletions

View file

@ -197,6 +197,7 @@ static struct graphics_driver *create_driver( HMODULE module )
/* OpenGL32 */
GET_FUNC(wglCreateContext);
GET_FUNC(wglDeleteContext);
GET_FUNC(wglMakeCurrent);
GET_FUNC(wglShareLists);
GET_FUNC(wglUseFontBitmapsA);

View file

@ -185,6 +185,7 @@ typedef struct tagDC_FUNCS
/* OpenGL32 */
HGLRC (*pwglCreateContext)(PHYSDEV);
BOOL (*pwglDeleteContext)(HGLRC);
BOOL (*pwglMakeCurrent)(PHYSDEV, HGLRC);
BOOL (*pwglShareLists)(HGLRC hglrc1, HGLRC hglrc2);
BOOL (*pwglUseFontBitmapsA)(PHYSDEV, DWORD, DWORD, DWORD);

View file

@ -79,6 +79,31 @@ HGLRC WINAPI wglCreateContext(HDC hdc)
return ret;
}
/***********************************************************************
* wglDeleteContext (OPENGL32.@)
*/
BOOL WINAPI wglDeleteContext(HGLRC hglrc)
{
DC *dc;
BOOL ret = FALSE;
OPENGL_Context ctx = (OPENGL_Context)hglrc;
TRACE("hglrc: (%p)\n", hglrc);
if(ctx == NULL)
return FALSE;
/* Retrieve the HDC associated with the context to access the display driver */
dc = DC_GetDCPtr(ctx->hdc);
if (!dc) return FALSE;
if (!dc->funcs->pwglDeleteContext) FIXME(" :stub\n");
else ret = dc->funcs->pwglDeleteContext(hglrc);
GDI_ReleaseObj(ctx->hdc);
return ret;
}
/***********************************************************************
* wglGetCurrentContext (OPENGL32.@)
*/

View file

@ -378,7 +378,7 @@
@ stdcall wglCopyContext(long long long)
@ stdcall wglCreateContext(long) gdi32.wglCreateContext
@ stdcall wglCreateLayerContext(long long)
@ stdcall wglDeleteContext(long)
@ stdcall wglDeleteContext(long) gdi32.wglDeleteContext
@ stdcall wglDescribeLayerPlane(long long long long ptr)
@ stdcall wglDescribePixelFormat(long long long ptr) gdi32.DescribePixelFormat
@ stdcall wglGetCurrentContext() gdi32.wglGetCurrentContext

View file

@ -47,7 +47,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wgl);
WINE_DECLARE_DEBUG_CHANNEL(opengl);
typedef struct wine_wgl_s {
BOOL WINAPI (*p_wglDeleteContext)(HGLRC hglrc);
PROC WINAPI (*p_wglGetProcAddress)(LPCSTR lpszProc);
void WINAPI (*p_wglGetIntegerv)(GLenum pname, GLint* params);
@ -147,15 +146,6 @@ BOOL WINAPI wglCopyContext(HGLRC hglrcSrc,
return FALSE;
}
/***********************************************************************
* wglDeleteContext (OPENGL32.@)
*/
BOOL WINAPI wglDeleteContext(HGLRC hglrc)
{
TRACE("(%p)\n", hglrc);
return wine_wgl.p_wglDeleteContext(hglrc);
}
/***********************************************************************
* wglDescribeLayerPlane (OPENGL32.@)
*/
@ -622,7 +612,6 @@ static BOOL process_attach(void)
wine_tsx11_unlock_ptr = (void *)GetProcAddress( mod, "wine_tsx11_unlock" );
/* Load WGL function pointers from winex11.drv */
wine_wgl.p_wglDeleteContext = (void *)GetProcAddress(mod, "wglDeleteContext");
wine_wgl.p_wglGetProcAddress = (void *)GetProcAddress(mod, "wglGetProcAddress");
/* Interal WGL function */