mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
fixes a bug of not being able to open a high-res window and failing. now it tries a lower resolution before giving up
This commit is contained in:
parent
5eeb0c7eed
commit
a7521b518e
@ -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")
|
<< (bCouldntFindValidZBuf ? "Couldnt find valid zbuffer format to go with FullScreen mode" : "No supported FullScreen modes")
|
||||||
<< " at " << dwRenderWidth << "x" << dwRenderHeight << " for device #" << _wcontext.CardIDNum <<endl;
|
<< " at " << dwRenderWidth << "x" << dwRenderHeight << " for device #" << _wcontext.CardIDNum <<endl;
|
||||||
|
|
||||||
|
// if it failed because of a size constraints (for non-default case), try with default size
|
||||||
|
if (!bUseDefaultSize) {
|
||||||
|
wdxdisplay8_cat.info() << "was not a default: but trying 800x600 size in verbose mode\n";
|
||||||
|
dwRenderWidth=800;
|
||||||
|
dwRenderHeight=600;
|
||||||
|
}
|
||||||
|
|
||||||
// run it again in verbose mode to get more dbg info to log
|
// run it again in verbose mode to get more dbg info to log
|
||||||
dxpipe->search_for_valid_displaymode(_wcontext,dwRenderWidth, dwRenderHeight,
|
dxpipe->search_for_valid_displaymode(_wcontext,dwRenderWidth, dwRenderHeight,
|
||||||
bNeedZBuffer, bWantStencil,
|
bNeedZBuffer, bWantStencil,
|
||||||
&_wcontext.SupportedScreenDepthsMask,
|
&_wcontext.SupportedScreenDepthsMask,
|
||||||
&bCouldntFindValidZBuf,
|
&bCouldntFindValidZBuf,
|
||||||
&pixFmt, dx_force_16bpp_zbuffer, true);
|
&pixFmt, dx_force_16bpp_zbuffer, true);
|
||||||
return false;
|
|
||||||
|
// if still D3DFMT_UNKNOWN return false
|
||||||
|
if (pixFmt == D3DFMT_UNKNOWN)
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -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")
|
<< (bCouldntFindValidZBuf ? "Couldnt find valid zbuffer format to go with FullScreen mode" : "No supported FullScreen modes")
|
||||||
<< " at " << dwRenderWidth << "x" << dwRenderHeight << " for device #" << _wcontext.CardIDNum <<endl;
|
<< " at " << dwRenderWidth << "x" << dwRenderHeight << " for device #" << _wcontext.CardIDNum <<endl;
|
||||||
|
|
||||||
|
// if it failed because of a size constraints (for non-default case), try with default size
|
||||||
|
if (!bUseDefaultSize) {
|
||||||
|
wdxdisplay9_cat.info() << "was not a default: but trying 800x600 size in verbose mode\n";
|
||||||
|
dwRenderWidth=800;
|
||||||
|
dwRenderHeight=600;
|
||||||
|
}
|
||||||
|
|
||||||
// run it again in verbose mode to get more dbg info to log
|
// run it again in verbose mode to get more dbg info to log
|
||||||
dxpipe->search_for_valid_displaymode(_wcontext,dwRenderWidth, dwRenderHeight,
|
dxpipe->search_for_valid_displaymode(_wcontext,dwRenderWidth, dwRenderHeight,
|
||||||
bNeedZBuffer, bWantStencil,
|
bNeedZBuffer, bWantStencil,
|
||||||
&_wcontext.SupportedScreenDepthsMask,
|
&_wcontext.SupportedScreenDepthsMask,
|
||||||
&bCouldntFindValidZBuf,
|
&bCouldntFindValidZBuf,
|
||||||
&pixFmt, dx_force_16bpp_zbuffer, true);
|
&pixFmt, dx_force_16bpp_zbuffer, true);
|
||||||
return false;
|
|
||||||
|
// if still D3DFMT_UNKNOWN return false
|
||||||
|
if (pixFmt == D3DFMT_UNKNOWN)
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user