mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 13:41:05 +00:00
- Fixed: IDirect3D9::CreateDevice() can return D3DERR_DEVICELOST if you want exclusive mode and
some other application already has it. While technically this is a failure, the device is still created, so we can continue using it anyway. SVN r2326 (trunk)
This commit is contained in:
parent
1c8397e86d
commit
b2a4ffc718
1 changed files with 9 additions and 7 deletions
|
@ -322,19 +322,23 @@ D3DFB::D3DFB (int width, int height, bool fullscreen)
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (FAILED(hr = D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, Window,
|
if (FAILED(hr = D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, Window,
|
||||||
D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE, &d3dpp, &D3DDevice)))
|
D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE, &d3dpp, &D3DDevice)) &&
|
||||||
|
hr != D3DERR_DEVICELOST)
|
||||||
{
|
{
|
||||||
if (FAILED(D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, Window,
|
if (FAILED(D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, Window,
|
||||||
D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE, &d3dpp, &D3DDevice)))
|
D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE, &d3dpp, &D3DDevice)) &&
|
||||||
|
hr != D3DERR_DEVICELOST)
|
||||||
{
|
{
|
||||||
if (d3dpp.FullScreen_RefreshRateInHz != 0)
|
if (d3dpp.FullScreen_RefreshRateInHz != 0)
|
||||||
{
|
{
|
||||||
d3dpp.FullScreen_RefreshRateInHz = 0;
|
d3dpp.FullScreen_RefreshRateInHz = 0;
|
||||||
if (FAILED(hr = D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, Window,
|
if (FAILED(hr = D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, Window,
|
||||||
D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE, &d3dpp, &D3DDevice)))
|
D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE, &d3dpp, &D3DDevice)) &&
|
||||||
|
hr != D3DERR_DEVICELOST)
|
||||||
{
|
{
|
||||||
if (FAILED(D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, Window,
|
if (FAILED(D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, Window,
|
||||||
D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE, &d3dpp, &D3DDevice)))
|
D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE, &d3dpp, &D3DDevice)) &&
|
||||||
|
hr != D3DERR_DEVICELOST)
|
||||||
{
|
{
|
||||||
D3DDevice = NULL;
|
D3DDevice = NULL;
|
||||||
}
|
}
|
||||||
|
@ -360,9 +364,7 @@ D3DFB::D3DFB (int width, int height, bool fullscreen)
|
||||||
{
|
{
|
||||||
DeviceCaps.LineCaps |= D3DLINECAPS_ANTIALIAS;
|
DeviceCaps.LineCaps |= D3DLINECAPS_ANTIALIAS;
|
||||||
}
|
}
|
||||||
// I don't know about ATI's drivers. The only ATI device
|
// ATI's drivers apparently also lie, so screw this cap.
|
||||||
// I have readily available to test with (a Mobility X300)
|
|
||||||
// really doesn't support them.
|
|
||||||
}
|
}
|
||||||
CreateResources();
|
CreateResources();
|
||||||
SetInitialState();
|
SetInitialState();
|
||||||
|
|
Loading…
Reference in a new issue