1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-01 07:14:31 +00:00

opengl32: Prefer formats with depth if unspecified in wglChoosePixelFormat().

This commit is contained in:
Paul Gofman 2024-05-13 20:15:30 -06:00 committed by Alexandre Julliard
parent bdba9407d9
commit 6a31983779
2 changed files with 9 additions and 1 deletions

View File

@ -326,6 +326,7 @@ static void test_choosepixelformat(void)
ok( ret_fmt.cAlphaShift == 24, "Got %u.\n", ret_fmt.cAlphaShift );
else
ok( !ret_fmt.cAlphaShift, "Got %u.\n", ret_fmt.cAlphaShift );
ok( ret_fmt.cDepthBits, "Got %u.\n", ret_fmt.cDepthBits );
pfd.dwFlags |= PFD_DOUBLEBUFFER_DONTCARE;
ok( test_pfd(&pfd, NULL), "PFD_DOUBLEBUFFER_DONTCARE failed\n" );

View File

@ -284,7 +284,14 @@ INT WINAPI wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd)
continue;
}
}
if (ppfd->dwFlags & PFD_DEPTH_DONTCARE && format.cDepthBits < best.cDepthBits)
if (ppfd->dwFlags & PFD_DEPTH_DONTCARE)
{
if (format.cDepthBits < best.cDepthBits)
goto found;
continue;
}
if (!ppfd->cDepthBits && format.cDepthBits > best.cDepthBits)
goto found;
continue;