Do not call GetAdapterDisplayMode after Display has been initialized.

Some AMD drivers fail with D3DERR_NOTAVAILABLE after the machine has been in sleep mode and never seem to recover for a given IDirect3D9 object. I reproduced with Catalyst and a Radeon 7700.

Instead, record the display mode at the time the it was initialized and thereafter use its format as the argument to CheckDeviceFormat etc. Previously, CheckDeviceFormat was passed an uninitialized value as the format if GetAdapterDisplayMode failed.

Review URL:

git-svn-id: 736b8ea6-26fd-11df-bfd4-992fa37f6226
2 files changed