Commit c0139457 authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent e9f270bd
......@@ -214,7 +214,7 @@
@ stub GdiSetAttrs
@ stdcall GdiSetBatchLimit(long)
# @ stub GdiSetLastError
# @ stub GdiSetPixelFormat
@ stdcall GdiSetPixelFormat(long long ptr)
@ stub GdiSetServerAttr
# @ stub GdiStartDocEMF
# @ stub GdiStartPageEMF
......
......@@ -42,6 +42,7 @@ static const WCHAR opengl32W[] = {'o','p','e','n','g','l','3','2','.','d','l','l
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 HDC default_hdc = 0;
......@@ -252,3 +253,17 @@ INT WINAPI DescribePixelFormat( HDC hdc, INT fmt, UINT size, PIXELFORMATDESCRIPT
}
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 );
}
......@@ -486,20 +486,11 @@ COLORREF WINAPI GetPixel( HDC hdc, INT x, INT y )
/******************************************************************************
* SetPixelFormat [GDI32.@]
* Sets pixel format of device context
* GdiSetPixelFormat [GDI32.@]
*
* PARAMS
* 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
* Probably not the correct semantics, it's supposed to be an internal backend for SetPixelFormat.
*/
BOOL WINAPI SetPixelFormat( HDC hdc, INT iPixelFormat,
const PIXELFORMATDESCRIPTOR *ppfd)
BOOL WINAPI GdiSetPixelFormat( HDC hdc, INT iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd)
{
INT bRet = FALSE;
DC * dc = get_dc_ptr( hdc );
......
......@@ -48,7 +48,6 @@ WINE_DECLARE_DEBUG_CHANNEL(opengl);
static struct
{
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);
HGLRC (WINAPI *p_wglCreateContext)(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 );
/* 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 );
/***********************************************************************
* wglSetPixelFormat(OPENGL32.@)
......@@ -96,7 +97,7 @@ extern INT WINAPI GdiDescribePixelFormat( HDC hdc, INT fmt, UINT size, PIXELFORM
BOOL WINAPI wglSetPixelFormat( HDC hdc, INT iPixelFormat,
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_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_wglCreateContext = (void *)GetProcAddress(mod_gdi32, "wglCreateContext");
wine_wgl.p_GetPixelFormat = (void *)GetProcAddress(mod_gdi32, "GetPixelFormat");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment