Commit bfa3c956 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

winex11.drv: Factor out describe_pixel_format() function.

parent 7d2fb577
...@@ -1533,8 +1533,7 @@ void destroy_gl_drawable( HWND hwnd ) ...@@ -1533,8 +1533,7 @@ void destroy_gl_drawable( HWND hwnd )
* *
* Get the pixel-format descriptor associated to the given id * Get the pixel-format descriptor associated to the given id
*/ */
static int WINAPI glxdrv_wglDescribePixelFormat( HDC hdc, int iPixelFormat, static int WINAPI describe_pixel_format( int iPixelFormat, PIXELFORMATDESCRIPTOR *ppfd, BOOL allow_offscreen )
UINT nBytes, PIXELFORMATDESCRIPTOR *ppfd)
{ {
/*XVisualInfo *vis;*/ /*XVisualInfo *vis;*/
int value; int value;
...@@ -1543,23 +1542,13 @@ static int WINAPI glxdrv_wglDescribePixelFormat( HDC hdc, int iPixelFormat, ...@@ -1543,23 +1542,13 @@ static int WINAPI glxdrv_wglDescribePixelFormat( HDC hdc, int iPixelFormat,
if (!has_opengl()) return 0; if (!has_opengl()) return 0;
TRACE("(%p,%d,%d,%p)\n", hdc, iPixelFormat, nBytes, ppfd);
if (!ppfd) return nb_onscreen_formats;
/* Look for the iPixelFormat in our list of supported formats. If it is supported we get the index in the FBConfig table and the number of supported formats back */ /* Look for the iPixelFormat in our list of supported formats. If it is supported we get the index in the FBConfig table and the number of supported formats back */
fmt = get_pixel_format(gdi_display, iPixelFormat, FALSE /* Offscreen */); fmt = get_pixel_format(gdi_display, iPixelFormat, allow_offscreen);
if (!fmt) { if (!fmt) {
WARN("unexpected format %d\n", iPixelFormat); WARN("unexpected format %d\n", iPixelFormat);
return 0; return 0;
} }
if (nBytes < sizeof(PIXELFORMATDESCRIPTOR)) {
ERR("Wrong structure size !\n");
/* Should set error */
return 0;
}
memset(ppfd, 0, sizeof(PIXELFORMATDESCRIPTOR)); memset(ppfd, 0, sizeof(PIXELFORMATDESCRIPTOR));
ppfd->nSize = sizeof(PIXELFORMATDESCRIPTOR); ppfd->nSize = sizeof(PIXELFORMATDESCRIPTOR);
ppfd->nVersion = 1; ppfd->nVersion = 1;
...@@ -1662,6 +1651,28 @@ static int WINAPI glxdrv_wglDescribePixelFormat( HDC hdc, int iPixelFormat, ...@@ -1662,6 +1651,28 @@ static int WINAPI glxdrv_wglDescribePixelFormat( HDC hdc, int iPixelFormat,
return nb_onscreen_formats; return nb_onscreen_formats;
} }
/**
* glxdrv_DescribePixelFormat
*
* Get the pixel-format descriptor associated to the given id
*/
static int WINAPI glxdrv_wglDescribePixelFormat( HDC hdc, int iPixelFormat,
UINT nBytes, PIXELFORMATDESCRIPTOR *ppfd)
{
TRACE("(%p,%d,%d,%p)\n", hdc, iPixelFormat, nBytes, ppfd);
if (!ppfd) return nb_onscreen_formats;
if (nBytes < sizeof(PIXELFORMATDESCRIPTOR))
{
ERR("Wrong structure size !\n");
/* Should set error */
return 0;
}
return describe_pixel_format(iPixelFormat, ppfd, FALSE);
}
/*********************************************************************** /***********************************************************************
* glxdrv_wglGetPixelFormat * glxdrv_wglGetPixelFormat
*/ */
......
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