Fix X11DRV_ChoosePixelFormat to choose 24 bpp as 32 bpp for depth

buffers (needed as many X11 drivers only support 24bpp).
This commit is contained in:
Raphael Junqueira 2005-05-10 08:26:08 +00:00 committed by Alexandre Julliard
parent 5e1b41854c
commit 075f8cfe8f
1 changed files with 9 additions and 1 deletions

View File

@ -203,7 +203,15 @@ int X11DRV_ChoosePixelFormat(X11DRV_PDEVICE *physDev,
if (ppfd->iPixelType == PFD_TYPE_RGBA) {
ADD2(GLX_RENDER_TYPE, GLX_RGBA_BIT);
ADD2(GLX_BUFFER_SIZE, ppfd->cColorBits);
if (32 == ppfd->cDepthBits) {
/**
* for 32 bpp depth buffers force to use 24.
* needed as some drivers don't support 32bpp
*/
TEST_AND_ADD2(ppfd->cDepthBits, GLX_DEPTH_SIZE, 24);
} else {
TEST_AND_ADD2(ppfd->cDepthBits, GLX_DEPTH_SIZE, ppfd->cDepthBits);
}
TEST_AND_ADD2(ppfd->cAlphaBits, GLX_ALPHA_SIZE, ppfd->cAlphaBits);
}
TEST_AND_ADD2(ppfd->cStencilBits, GLX_STENCIL_SIZE, ppfd->cStencilBits);