gdi32: Forward SwapBuffers to opengl32 which in turn calls GdiSwapBuffers.

This commit is contained in:
Alexandre Julliard 2012-06-25 22:45:28 +02:00
parent c013945728
commit 67e7eda96c
4 changed files with 22 additions and 12 deletions

View file

@ -218,7 +218,7 @@
@ stub GdiSetServerAttr
# @ stub GdiStartDocEMF
# @ stub GdiStartPageEMF
# @ stub GdiSwapBuffers
@ stdcall GdiSwapBuffers(long)
@ stdcall GdiTransparentBlt(long long long long long long long long long long long)
# @ stub GdiValidateHandle
@ stub GdiWinWatchClose

View file

@ -43,6 +43,7 @@ static HMODULE opengl32;
static INT (WINAPI *wglChoosePixelFormat)(HDC,const PIXELFORMATDESCRIPTOR *);
static INT (WINAPI *wglDescribePixelFormat)(HDC,INT,UINT,PIXELFORMATDESCRIPTOR*);
static BOOL (WINAPI *wglSetPixelFormat)(HDC,INT,const PIXELFORMATDESCRIPTOR*);
static BOOL (WINAPI *wglSwapBuffers)(HDC);
static HDC default_hdc = 0;
@ -267,3 +268,17 @@ BOOL WINAPI SetPixelFormat( HDC hdc, INT fmt, const PIXELFORMATDESCRIPTOR *pfd )
}
return wglSetPixelFormat( hdc, fmt, pfd );
}
/******************************************************************************
* SwapBuffers (GDI32.@)
*/
BOOL WINAPI SwapBuffers( HDC hdc )
{
if (!wglSwapBuffers)
{
if (!opengl32) opengl32 = LoadLibraryW( opengl32W );
if (!(wglSwapBuffers = (void *)GetProcAddress( opengl32, "wglSwapBuffers" )))
return 0;
}
return wglSwapBuffers( hdc );
}

View file

@ -562,17 +562,11 @@ INT WINAPI GdiDescribePixelFormat( HDC hdc, INT iPixelFormat, UINT nBytes,
/******************************************************************************
* SwapBuffers [GDI32.@]
* Exchanges front and back buffers of window
* GdiSwapBuffers [GDI32.@]
*
* PARAMS
* hdc [I] Device context whose buffers get swapped
*
* RETURNS
* Success: TRUE
* Failure: FALSE
* Probably not the correct semantics, it's supposed to be an internal backend for SwapBuffers.
*/
BOOL WINAPI SwapBuffers( HDC hdc )
BOOL WINAPI GdiSwapBuffers( HDC hdc )
{
INT bRet = FALSE;
DC * dc = get_dc_ptr( hdc );

View file

@ -90,6 +90,7 @@ const GLubyte * WINAPI wine_glGetString( GLenum name );
/* internal GDI functions */
extern INT WINAPI GdiDescribePixelFormat( HDC hdc, INT fmt, UINT size, PIXELFORMATDESCRIPTOR *pfd );
extern BOOL WINAPI GdiSetPixelFormat( HDC hdc, INT fmt, const PIXELFORMATDESCRIPTOR *pfd );
extern BOOL WINAPI GdiSwapBuffers( HDC hdc );
/***********************************************************************
* wglSetPixelFormat(OPENGL32.@)
@ -560,7 +561,7 @@ BOOL WINAPI wglSwapLayerBuffers(HDC hdc,
TRACE_(opengl)("(%p, %08x)\n", hdc, fuPlanes);
if (fuPlanes & WGL_SWAP_MAIN_PLANE) {
if (!SwapBuffers(hdc)) return FALSE;
if (!GdiSwapBuffers(hdc)) return FALSE;
fuPlanes &= ~WGL_SWAP_MAIN_PLANE;
}
@ -1062,7 +1063,7 @@ void WINAPI wine_glGetIntegerv( GLenum pname, GLint* params )
*/
BOOL WINAPI DECLSPEC_HOTPATCH wglSwapBuffers( HDC hdc )
{
return SwapBuffers(hdc);
return GdiSwapBuffers(hdc);
}
/* This is for brain-dead applications that use OpenGL functions before even