From a7521b518e01f193ca6ae7781a4b8e6a0d90ac23 Mon Sep 17 00:00:00 2001 From: "Asad M. Zaman" Date: Tue, 24 Aug 2004 22:48:22 +0000 Subject: [PATCH] fixes a bug of not being able to open a high-res window and failing. now it tries a lower resolution before giving up --- panda/src/dxgsg8/wdxGraphicsWindow8.cxx | 12 +++++++++++- panda/src/dxgsg9/wdxGraphicsWindow9.cxx | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/panda/src/dxgsg8/wdxGraphicsWindow8.cxx b/panda/src/dxgsg8/wdxGraphicsWindow8.cxx index b5bdfc27d8..7313b6ed54 100644 --- a/panda/src/dxgsg8/wdxGraphicsWindow8.cxx +++ b/panda/src/dxgsg8/wdxGraphicsWindow8.cxx @@ -1448,13 +1448,23 @@ search_for_device(wdxGraphicsPipe8 *dxpipe, DXDeviceInfo *device_info) { << (bCouldntFindValidZBuf ? "Couldnt find valid zbuffer format to go with FullScreen mode" : "No supported FullScreen modes") << " at " << dwRenderWidth << "x" << dwRenderHeight << " for device #" << _wcontext.CardIDNum <search_for_valid_displaymode(_wcontext,dwRenderWidth, dwRenderHeight, bNeedZBuffer, bWantStencil, &_wcontext.SupportedScreenDepthsMask, &bCouldntFindValidZBuf, &pixFmt, dx_force_16bpp_zbuffer, true); - return false; + + // if still D3DFMT_UNKNOWN return false + if (pixFmt == D3DFMT_UNKNOWN) + return false; } } } else { diff --git a/panda/src/dxgsg9/wdxGraphicsWindow9.cxx b/panda/src/dxgsg9/wdxGraphicsWindow9.cxx index 0cd80e73d9..fff1685b36 100755 --- a/panda/src/dxgsg9/wdxGraphicsWindow9.cxx +++ b/panda/src/dxgsg9/wdxGraphicsWindow9.cxx @@ -1435,13 +1435,23 @@ search_for_device(wdxGraphicsPipe9 *dxpipe, DXDeviceInfo *device_info) { << (bCouldntFindValidZBuf ? "Couldnt find valid zbuffer format to go with FullScreen mode" : "No supported FullScreen modes") << " at " << dwRenderWidth << "x" << dwRenderHeight << " for device #" << _wcontext.CardIDNum <search_for_valid_displaymode(_wcontext,dwRenderWidth, dwRenderHeight, bNeedZBuffer, bWantStencil, &_wcontext.SupportedScreenDepthsMask, &bCouldntFindValidZBuf, &pixFmt, dx_force_16bpp_zbuffer, true); - return false; + + // if still D3DFMT_UNKNOWN return false + if (pixFmt == D3DFMT_UNKNOWN) + return false; } } } else {