gdi32: Forward SetPixelFormat to opengl32 which in turn calls GdiSetPixelFormat.

This commit is contained in:
Alexandre Julliard 2012-06-25 22:03:59 +02:00
parent e9f270bd41
commit c013945728
4 changed files with 22 additions and 16 deletions

View File

@ -214,7 +214,7 @@
@ stub GdiSetAttrs @ stub GdiSetAttrs
@ stdcall GdiSetBatchLimit(long) @ stdcall GdiSetBatchLimit(long)
# @ stub GdiSetLastError # @ stub GdiSetLastError
# @ stub GdiSetPixelFormat @ stdcall GdiSetPixelFormat(long long ptr)
@ stub GdiSetServerAttr @ stub GdiSetServerAttr
# @ stub GdiStartDocEMF # @ stub GdiStartDocEMF
# @ stub GdiStartPageEMF # @ stub GdiStartPageEMF

View File

@ -42,6 +42,7 @@ static const WCHAR opengl32W[] = {'o','p','e','n','g','l','3','2','.','d','l','l
static HMODULE opengl32; static HMODULE opengl32;
static INT (WINAPI *wglChoosePixelFormat)(HDC,const PIXELFORMATDESCRIPTOR *); static INT (WINAPI *wglChoosePixelFormat)(HDC,const PIXELFORMATDESCRIPTOR *);
static INT (WINAPI *wglDescribePixelFormat)(HDC,INT,UINT,PIXELFORMATDESCRIPTOR*); static INT (WINAPI *wglDescribePixelFormat)(HDC,INT,UINT,PIXELFORMATDESCRIPTOR*);
static BOOL (WINAPI *wglSetPixelFormat)(HDC,INT,const PIXELFORMATDESCRIPTOR*);
static HDC default_hdc = 0; static HDC default_hdc = 0;
@ -252,3 +253,17 @@ INT WINAPI DescribePixelFormat( HDC hdc, INT fmt, UINT size, PIXELFORMATDESCRIPT
} }
return wglDescribePixelFormat( hdc, fmt, size, pfd ); return wglDescribePixelFormat( hdc, fmt, size, pfd );
} }
/******************************************************************************
* SetPixelFormat (GDI32.@)
*/
BOOL WINAPI SetPixelFormat( HDC hdc, INT fmt, const PIXELFORMATDESCRIPTOR *pfd )
{
if (!wglSetPixelFormat)
{
if (!opengl32) opengl32 = LoadLibraryW( opengl32W );
if (!(wglSetPixelFormat = (void *)GetProcAddress( opengl32, "wglSetPixelFormat" )))
return 0;
}
return wglSetPixelFormat( hdc, fmt, pfd );
}

View File

@ -486,20 +486,11 @@ COLORREF WINAPI GetPixel( HDC hdc, INT x, INT y )
/****************************************************************************** /******************************************************************************
* SetPixelFormat [GDI32.@] * GdiSetPixelFormat [GDI32.@]
* Sets pixel format of device context
* *
* PARAMS * Probably not the correct semantics, it's supposed to be an internal backend for SetPixelFormat.
* hdc [I] Device context to search for best pixel match
* iPixelFormat [I] Pixel format index
* ppfd [I] Pixel format for which a match is sought
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*/ */
BOOL WINAPI SetPixelFormat( HDC hdc, INT iPixelFormat, BOOL WINAPI GdiSetPixelFormat( HDC hdc, INT iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd)
const PIXELFORMATDESCRIPTOR *ppfd)
{ {
INT bRet = FALSE; INT bRet = FALSE;
DC * dc = get_dc_ptr( hdc ); DC * dc = get_dc_ptr( hdc );

View File

@ -48,7 +48,6 @@ WINE_DECLARE_DEBUG_CHANNEL(opengl);
static struct static struct
{ {
PROC (WINAPI *p_wglGetProcAddress)(LPCSTR lpszProc); PROC (WINAPI *p_wglGetProcAddress)(LPCSTR lpszProc);
BOOL (WINAPI *p_SetPixelFormat)(HDC hdc, INT iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd);
BOOL (WINAPI *p_wglMakeCurrent)(HDC hdc, HGLRC hglrc); BOOL (WINAPI *p_wglMakeCurrent)(HDC hdc, HGLRC hglrc);
HGLRC (WINAPI *p_wglCreateContext)(HDC hdc); HGLRC (WINAPI *p_wglCreateContext)(HDC hdc);
INT (WINAPI *p_GetPixelFormat)(HDC hdc); INT (WINAPI *p_GetPixelFormat)(HDC hdc);
@ -88,7 +87,9 @@ static char* internal_gl_extensions = NULL;
const GLubyte * WINAPI wine_glGetString( GLenum name ); const GLubyte * WINAPI wine_glGetString( GLenum name );
/* internal GDI functions */
extern INT WINAPI GdiDescribePixelFormat( HDC hdc, INT fmt, UINT size, PIXELFORMATDESCRIPTOR *pfd ); extern INT WINAPI GdiDescribePixelFormat( HDC hdc, INT fmt, UINT size, PIXELFORMATDESCRIPTOR *pfd );
extern BOOL WINAPI GdiSetPixelFormat( HDC hdc, INT fmt, const PIXELFORMATDESCRIPTOR *pfd );
/*********************************************************************** /***********************************************************************
* wglSetPixelFormat(OPENGL32.@) * wglSetPixelFormat(OPENGL32.@)
@ -96,7 +97,7 @@ extern INT WINAPI GdiDescribePixelFormat( HDC hdc, INT fmt, UINT size, PIXELFORM
BOOL WINAPI wglSetPixelFormat( HDC hdc, INT iPixelFormat, BOOL WINAPI wglSetPixelFormat( HDC hdc, INT iPixelFormat,
const PIXELFORMATDESCRIPTOR *ppfd) const PIXELFORMATDESCRIPTOR *ppfd)
{ {
return wine_wgl.p_SetPixelFormat(hdc, iPixelFormat, ppfd); return GdiSetPixelFormat(hdc, iPixelFormat, ppfd);
} }
/*********************************************************************** /***********************************************************************
@ -1086,7 +1087,6 @@ static BOOL process_attach(void)
wine_tsx11_unlock_ptr = (void *)GetProcAddress( mod_x11, "wine_tsx11_unlock" ); wine_tsx11_unlock_ptr = (void *)GetProcAddress( mod_x11, "wine_tsx11_unlock" );
wine_wgl.p_wglGetProcAddress = (void *)GetProcAddress(mod_gdi32, "wglGetProcAddress"); wine_wgl.p_wglGetProcAddress = (void *)GetProcAddress(mod_gdi32, "wglGetProcAddress");
wine_wgl.p_SetPixelFormat = (void *)GetProcAddress(mod_gdi32, "SetPixelFormat");
wine_wgl.p_wglMakeCurrent = (void *)GetProcAddress(mod_gdi32, "wglMakeCurrent"); wine_wgl.p_wglMakeCurrent = (void *)GetProcAddress(mod_gdi32, "wglMakeCurrent");
wine_wgl.p_wglCreateContext = (void *)GetProcAddress(mod_gdi32, "wglCreateContext"); wine_wgl.p_wglCreateContext = (void *)GetProcAddress(mod_gdi32, "wglCreateContext");
wine_wgl.p_GetPixelFormat = (void *)GetProcAddress(mod_gdi32, "GetPixelFormat"); wine_wgl.p_GetPixelFormat = (void *)GetProcAddress(mod_gdi32, "GetPixelFormat");