gdi32: Forward DescribePixelFormat to opengl32 which in turn calls GdiDescribePixelFormat.

This commit is contained in:
Alexandre Julliard 2012-06-25 21:59:11 +02:00
parent 81cd178ae1
commit e9f270bd41
4 changed files with 26 additions and 19 deletions

View File

@ -169,7 +169,7 @@
@ stub GdiDeleteLocalDC @ stub GdiDeleteLocalDC
@ stub GdiDeleteLocalObject @ stub GdiDeleteLocalObject
# @ stub GdiDeleteSpoolFileHandle # @ stub GdiDeleteSpoolFileHandle
# @ stub GdiDescribePixelFormat @ stdcall GdiDescribePixelFormat(long long long ptr)
@ stub GdiDllInitialize @ stub GdiDllInitialize
@ stdcall GdiDrawStream(long long ptr) @ stdcall GdiDrawStream(long long ptr)
# @ stub GdiEndDocEMF # @ stub GdiEndDocEMF

View File

@ -41,6 +41,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wgl);
static const WCHAR opengl32W[] = {'o','p','e','n','g','l','3','2','.','d','l','l',0}; static const WCHAR opengl32W[] = {'o','p','e','n','g','l','3','2','.','d','l','l',0};
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 HDC default_hdc = 0; static HDC default_hdc = 0;
@ -237,3 +238,17 @@ INT WINAPI ChoosePixelFormat( HDC hdc, const PIXELFORMATDESCRIPTOR *pfd )
} }
return wglChoosePixelFormat( hdc, pfd ); return wglChoosePixelFormat( hdc, pfd );
} }
/******************************************************************************
* DescribePixelFormat (GDI32.@)
*/
INT WINAPI DescribePixelFormat( HDC hdc, INT fmt, UINT size, PIXELFORMATDESCRIPTOR *pfd )
{
if (!wglDescribePixelFormat)
{
if (!opengl32) opengl32 = LoadLibraryW( opengl32W );
if (!(wglDescribePixelFormat = (void *)GetProcAddress( opengl32, "wglDescribePixelFormat" )))
return 0;
}
return wglDescribePixelFormat( hdc, fmt, size, pfd );
}

View File

@ -547,20 +547,11 @@ INT WINAPI GetPixelFormat( HDC hdc )
/****************************************************************************** /******************************************************************************
* DescribePixelFormat [GDI32.@] * GdiDescribePixelFormat [GDI32.@]
* Gets info about pixel format from DC
* *
* PARAMS * Probably not the correct semantics, it's supposed to be an internal backend for DescribePixelFormat.
* hdc [I] Device context
* iPixelFormat [I] Pixel format selector
* nBytes [I] Size of buffer
* ppfd [O] Pointer to structure to receive pixel format data
*
* RETURNS
* Success: Maximum pixel format index of the device context
* Failure: 0
*/ */
INT WINAPI DescribePixelFormat( HDC hdc, INT iPixelFormat, UINT nBytes, INT WINAPI GdiDescribePixelFormat( HDC hdc, INT iPixelFormat, UINT nBytes,
LPPIXELFORMATDESCRIPTOR ppfd ) LPPIXELFORMATDESCRIPTOR ppfd )
{ {
INT ret = 0; INT ret = 0;

View File

@ -51,7 +51,6 @@ static struct
BOOL (WINAPI *p_SetPixelFormat)(HDC hdc, INT iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd); 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_DescribePixelFormat)(HDC hdc, INT iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd);
INT (WINAPI *p_GetPixelFormat)(HDC hdc); INT (WINAPI *p_GetPixelFormat)(HDC hdc);
/* internal WGL functions */ /* internal WGL functions */
@ -89,6 +88,8 @@ static char* internal_gl_extensions = NULL;
const GLubyte * WINAPI wine_glGetString( GLenum name ); const GLubyte * WINAPI wine_glGetString( GLenum name );
extern INT WINAPI GdiDescribePixelFormat( HDC hdc, INT fmt, UINT size, PIXELFORMATDESCRIPTOR *pfd );
/*********************************************************************** /***********************************************************************
* wglSetPixelFormat(OPENGL32.@) * wglSetPixelFormat(OPENGL32.@)
*/ */
@ -184,7 +185,7 @@ INT WINAPI wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd)
ppfd->cColorBits, ppfd->cRedBits, ppfd->cGreenBits, ppfd->cBlueBits, ppfd->cAlphaBits, ppfd->cColorBits, ppfd->cRedBits, ppfd->cGreenBits, ppfd->cBlueBits, ppfd->cAlphaBits,
ppfd->cAccumBits, ppfd->cDepthBits, ppfd->cStencilBits, ppfd->cAuxBuffers ); ppfd->cAccumBits, ppfd->cDepthBits, ppfd->cStencilBits, ppfd->cAuxBuffers );
count = wine_wgl.p_DescribePixelFormat( hdc, 0, 0, NULL ); count = GdiDescribePixelFormat( hdc, 0, 0, NULL );
if (!count) return 0; if (!count) return 0;
best_format = 0; best_format = 0;
@ -197,7 +198,7 @@ INT WINAPI wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd)
for (i = 1; i <= count; i++) for (i = 1; i <= count; i++)
{ {
if (!wine_wgl.p_DescribePixelFormat( hdc, i, sizeof(format), &format )) continue; if (!GdiDescribePixelFormat( hdc, i, sizeof(format), &format )) continue;
if (ppfd->iPixelType != format.iPixelType) if (ppfd->iPixelType != format.iPixelType)
{ {
@ -338,8 +339,9 @@ INT WINAPI wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd)
INT WINAPI wglDescribePixelFormat(HDC hdc, INT iPixelFormat, UINT nBytes, INT WINAPI wglDescribePixelFormat(HDC hdc, INT iPixelFormat, UINT nBytes,
LPPIXELFORMATDESCRIPTOR ppfd) LPPIXELFORMATDESCRIPTOR ppfd)
{ {
return wine_wgl.p_DescribePixelFormat(hdc, iPixelFormat, nBytes, ppfd); return GdiDescribePixelFormat(hdc, iPixelFormat, nBytes, ppfd);
} }
/*********************************************************************** /***********************************************************************
* wglGetPixelFormat (OPENGL32.@) * wglGetPixelFormat (OPENGL32.@)
*/ */
@ -1087,7 +1089,6 @@ static BOOL process_attach(void)
wine_wgl.p_SetPixelFormat = (void *)GetProcAddress(mod_gdi32, "SetPixelFormat"); 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_DescribePixelFormat = (void *)GetProcAddress(mod_gdi32, "DescribePixelFormat");
wine_wgl.p_GetPixelFormat = (void *)GetProcAddress(mod_gdi32, "GetPixelFormat"); wine_wgl.p_GetPixelFormat = (void *)GetProcAddress(mod_gdi32, "GetPixelFormat");
/* internal WGL functions */ /* internal WGL functions */