Fix config depth bits and centralize device type control

TRAC #12120 Signed-off-by: Shannon Woods Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@230 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent b3f7fb68
......@@ -132,7 +132,7 @@ void Config::set(D3DDISPLAYMODE displayMode, EGLint minInterval, EGLint maxInter
mStencilSize = 0;
break;
case D3DFMT_D15S1:
mDepthSize = 16;
mDepthSize = 15;
mStencilSize = 1;
break;
case D3DFMT_D24S8:
......
......@@ -238,11 +238,9 @@ egl::Surface *Display::createWindowSurface(HWND window, EGLConfig config)
if (!mDevice)
{
UINT adapter = D3DADAPTER_DEFAULT;
D3DDEVTYPE deviceType = D3DDEVTYPE_HAL;
DWORD behaviorFlags = D3DCREATE_FPU_PRESERVE | D3DCREATE_NOWINDOWCHANGES;
HRESULT result = mD3d9->CreateDevice(adapter, deviceType, window, behaviorFlags | D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE, &presentParameters, &mDevice);
HRESULT result = mD3d9->CreateDevice(mAdapter, mDeviceType, window, behaviorFlags | D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE, &presentParameters, &mDevice);
if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
{
......@@ -251,7 +249,7 @@ egl::Surface *Display::createWindowSurface(HWND window, EGLConfig config)
if (FAILED(result))
{
result = mD3d9->CreateDevice(adapter, deviceType, window, behaviorFlags | D3DCREATE_SOFTWARE_VERTEXPROCESSING, &presentParameters, &mDevice);
result = mD3d9->CreateDevice(mAdapter, mDeviceType, window, behaviorFlags | D3DCREATE_SOFTWARE_VERTEXPROCESSING, &presentParameters, &mDevice);
if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment