wglSetPixelFormat should ignore the ppfd parameter.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
This commit is contained in:
Morgan Armand 2011-11-02 20:12:39 +01:00 committed by José Fonseca
parent 0be1f79770
commit c7fc4067eb
2 changed files with 11 additions and 5 deletions

View file

@ -172,8 +172,10 @@ wglSetPixelFormat(
int iPixelFormat,
const PIXELFORMATDESCRIPTOR *ppfd )
{
if (ppfd->nSize != sizeof( PIXELFORMATDESCRIPTOR ))
return FALSE;
/* SetPixelFormat (hence wglSetPixelFormat) must not touch ppfd, per
* http://msdn.microsoft.com/en-us/library/dd369049(v=vs.85).aspx
*/
(void) ppfd;
return DrvSetPixelFormat( hdc, iPixelFormat );
}

View file

@ -335,9 +335,13 @@ WINGDIAPI BOOL GLAPIENTRY wglSetPixelFormat(HDC hdc,int iPixelFormat,
const PIXELFORMATDESCRIPTOR *ppfd)
{
(void) hdc;
if(iPixelFormat < 1 || iPixelFormat > npfd ||
ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR)) {
/* SetPixelFormat (hence wglSetPixelFormat) must not touch ppfd, per
* http://msdn.microsoft.com/en-us/library/dd369049(v=vs.85).aspx
*/
(void) ppfd;
if(iPixelFormat < 1 || iPixelFormat > npfd) {
SetLastError(0);
return(FALSE);
}