mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 02:04:46 +00:00
opengl32: Avoid calling back the wglMakeCurrent win32 thunk.
This commit is contained in:
parent
b003fa795e
commit
8c17811312
|
@ -483,27 +483,6 @@ static HGLRC wrap_wglCreateContext( HDC hdc )
|
|||
return ret;
|
||||
}
|
||||
|
||||
static BOOL wrap_wglDeleteContext( HGLRC hglrc )
|
||||
{
|
||||
struct wgl_handle *ptr = get_handle_ptr( hglrc, HANDLE_CONTEXT );
|
||||
|
||||
if (!ptr) return FALSE;
|
||||
|
||||
if (ptr->u.context->tid && ptr->u.context->tid != GetCurrentThreadId())
|
||||
{
|
||||
SetLastError( ERROR_BUSY );
|
||||
release_handle_ptr( ptr );
|
||||
return FALSE;
|
||||
}
|
||||
if (hglrc == NtCurrentTeb()->glCurrentRC) wglMakeCurrent( 0, 0 );
|
||||
ptr->funcs->wgl.p_wglDeleteContext( ptr->u.context->drv_ctx );
|
||||
HeapFree( GetProcessHeap(), 0, ptr->u.context->disabled_exts );
|
||||
HeapFree( GetProcessHeap(), 0, ptr->u.context->extensions );
|
||||
HeapFree( GetProcessHeap(), 0, ptr->u.context );
|
||||
free_handle_ptr( ptr );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL wrap_wglMakeCurrent( HDC hdc, HGLRC hglrc )
|
||||
{
|
||||
BOOL ret = TRUE;
|
||||
|
@ -547,6 +526,27 @@ static BOOL wrap_wglMakeCurrent( HDC hdc, HGLRC hglrc )
|
|||
return ret;
|
||||
}
|
||||
|
||||
static BOOL wrap_wglDeleteContext( HGLRC hglrc )
|
||||
{
|
||||
struct wgl_handle *ptr = get_handle_ptr( hglrc, HANDLE_CONTEXT );
|
||||
|
||||
if (!ptr) return FALSE;
|
||||
|
||||
if (ptr->u.context->tid && ptr->u.context->tid != GetCurrentThreadId())
|
||||
{
|
||||
SetLastError( ERROR_BUSY );
|
||||
release_handle_ptr( ptr );
|
||||
return FALSE;
|
||||
}
|
||||
if (hglrc == NtCurrentTeb()->glCurrentRC) wrap_wglMakeCurrent( 0, 0 );
|
||||
ptr->funcs->wgl.p_wglDeleteContext( ptr->u.context->drv_ctx );
|
||||
HeapFree( GetProcessHeap(), 0, ptr->u.context->disabled_exts );
|
||||
HeapFree( GetProcessHeap(), 0, ptr->u.context->extensions );
|
||||
HeapFree( GetProcessHeap(), 0, ptr->u.context );
|
||||
free_handle_ptr( ptr );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL wrap_wglShareLists( HGLRC hglrcSrc, HGLRC hglrcDst )
|
||||
{
|
||||
BOOL ret = FALSE;
|
||||
|
|
Loading…
Reference in a new issue