diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index bd7f7d22e98..49f1e4700b4 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -564,18 +564,6 @@ INT WINAPI wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd) continue; } } - if (ppfd->cDepthBits && !(ppfd->dwFlags & PFD_DEPTH_DONTCARE)) - { - if (((ppfd->cDepthBits > best.cDepthBits) && (format.cDepthBits > best.cDepthBits)) || - ((format.cDepthBits >= ppfd->cDepthBits) && (format.cDepthBits < best.cDepthBits))) - goto found; - - if (best.cDepthBits != format.cDepthBits) - { - TRACE( "depth mismatch for iPixelFormat=%d\n", i ); - continue; - } - } if (ppfd->cStencilBits) { if (((ppfd->cStencilBits > best.cStencilBits) && (format.cStencilBits > best.cStencilBits)) || @@ -588,6 +576,18 @@ INT WINAPI wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd) continue; } } + if (ppfd->cDepthBits && !(ppfd->dwFlags & PFD_DEPTH_DONTCARE)) + { + if (((ppfd->cDepthBits > best.cDepthBits) && (format.cDepthBits > best.cDepthBits)) || + ((format.cDepthBits >= ppfd->cDepthBits) && (format.cDepthBits < best.cDepthBits))) + goto found; + + if (best.cDepthBits != format.cDepthBits) + { + TRACE( "depth mismatch for iPixelFormat=%d\n", i ); + continue; + } + } if (ppfd->cAuxBuffers) { if (((ppfd->cAuxBuffers > best.cAuxBuffers) && (format.cAuxBuffers > best.cAuxBuffers)) ||