opengl32: Don't fail with both PFD_DOUBLEBUFFER_DONTCARE and PFD_STEREO_DONTCARE.

Signed-off-by: Daniel Lehman <dlehman@esri.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Daniel Lehman 2017-06-21 16:00:22 -07:00 committed by Alexandre Julliard
parent 53ac519915
commit 079463828c
2 changed files with 5 additions and 1 deletions

View File

@ -277,7 +277,7 @@ static void test_choosepixelformat(void)
pfd.dwFlags |= PFD_DOUBLEBUFFER_DONTCARE;
ok( test_pfd(&pfd), "PFD_DOUBLEBUFFER_DONTCARE failed\n" );
pfd.dwFlags |= PFD_STEREO_DONTCARE;
todo_wine ok( test_pfd(&pfd), "PFD_DOUBLEBUFFER_DONTCARE|PFD_STEREO_DONTCARE failed\n" );
ok( test_pfd(&pfd), "PFD_DOUBLEBUFFER_DONTCARE|PFD_STEREO_DONTCARE failed\n" );
pfd.dwFlags &= ~PFD_DOUBLEBUFFER_DONTCARE;
ok( test_pfd(&pfd), "PFD_STEREO_DONTCARE failed\n" );
pfd.dwFlags &= ~PFD_STEREO_DONTCARE;

View File

@ -517,6 +517,8 @@ INT WINAPI wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd)
if (bestDBuffer != -1 && (format.dwFlags & PFD_DOUBLEBUFFER) != bestDBuffer) continue;
}
else if (!best_format)
goto found;
/* Stereo, see the comments above. */
if (!(ppfd->dwFlags & PFD_STEREO_DONTCARE))
@ -527,6 +529,8 @@ INT WINAPI wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd)
if (bestStereo != -1 && (format.dwFlags & PFD_STEREO) != bestStereo) continue;
}
else if (!best_format)
goto found;
/* Below we will do a number of checks to select the 'best' pixelformat.
* We assume the precedence cColorBits > cAlphaBits > cDepthBits > cStencilBits -> cAuxBuffers.