wined3d: D3DRS_ZVISIBLE is not supposed to return an error.

This commit is contained in:
Stefan Dösinger 2006-12-14 20:48:09 +01:00 committed by Alexandre Julliard
parent 2fe8a41cb8
commit 46028b0832
3 changed files with 52 additions and 7 deletions

View File

@ -648,6 +648,44 @@ cleanup:
if(pDevice) IDirect3D8_Release(pDevice);
}
static void test_states(void)
{
HRESULT hr;
HWND hwnd = NULL;
IDirect3D8 *pD3d = NULL;
IDirect3DDevice8 *pDevice = NULL;
D3DPRESENT_PARAMETERS d3dpp;
D3DDISPLAYMODE d3ddm;
pD3d = pDirect3DCreate8( D3D_SDK_VERSION );
ok(pD3d != NULL, "Failed to create IDirect3D8 object\n");
hwnd = CreateWindow( "static", "d3d8_test", WS_OVERLAPPEDWINDOW, 100, 100, 160, 160, NULL, NULL, NULL, NULL );
ok(hwnd != NULL, "Failed to create window\n");
if (!pD3d || !hwnd) goto cleanup;
IDirect3D8_GetAdapterDisplayMode( pD3d, D3DADAPTER_DEFAULT, &d3ddm );
ZeroMemory( &d3dpp, sizeof(d3dpp) );
d3dpp.Windowed = TRUE;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferWidth = 640;
d3dpp.BackBufferHeight = 480;
d3dpp.BackBufferFormat = d3ddm.Format;
hr = IDirect3D8_CreateDevice( pD3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL /* no NULLREF here */, hwnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &pDevice );
ok(SUCCEEDED(hr), "Failed to create IDirect3D8Device (%s)\n", DXGetErrorString8(hr));
if (FAILED(hr)) goto cleanup;
hr = IDirect3DDevice8_SetRenderState(pDevice, D3DRS_ZVISIBLE, TRUE);
ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState(D3DRS_ZVISIBLE, TRUE) returned %s\n", DXGetErrorString8(hr));
hr = IDirect3DDevice8_SetRenderState(pDevice, D3DRS_ZVISIBLE, FALSE);
ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState(D3DRS_ZVISIBLE, FALSE) returned %s\n", DXGetErrorString8(hr));
cleanup:
if(pD3d) IDirect3D8_Release(pD3d);
if(pDevice) IDirect3D8_Release(pDevice);
}
START_TEST(device)
{
HMODULE d3d8_handle = LoadLibraryA( "d3d8.dll" );
@ -659,5 +697,6 @@ START_TEST(device)
test_refcount();
test_mipmap_levels();
test_cursor();
test_states();
}
}

View File

@ -475,6 +475,17 @@ out:
IDirect3DVertexBuffer7_Release(lpVBufDest2);
}
static void StateTest( void )
{
HRESULT rc;
/* The msdn says its undocumented, does it return an error too? */
rc = IDirect3DDevice7_SetRenderState(lpD3DDevice, D3DRENDERSTATE_ZVISIBLE, TRUE);
ok(rc == D3D_OK, "IDirect3DDevice7_SetRenderState(D3DRENDERSTATE_ZVISIBLE, TRUE) returned %08x\n", rc);
rc = IDirect3DDevice7_SetRenderState(lpD3DDevice, D3DRENDERSTATE_ZVISIBLE, FALSE);
ok(rc == D3D_OK, "IDirect3DDevice7_SetRenderState(D3DRENDERSTATE_ZVISIBLE, FALSE) returned %08x\n", rc);
}
START_TEST(d3d)
{
init_function_pointers();
@ -489,5 +500,6 @@ START_TEST(d3d)
}
LightTest();
ProcessVerticesTest();
StateTest();
ReleaseDirect3D();
}

View File

@ -3442,16 +3442,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
case WINED3DRS_SRCBLENDALPHA :
case WINED3DRS_DESTBLENDALPHA :
case WINED3DRS_BLENDOPALPHA :
case WINED3DRS_ZVISIBLE :
StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock);
break;
/** not supported */
case WINED3DRS_ZVISIBLE :
{
LEAVE_GL();
return WINED3DERR_INVALIDCALL;
}
default:
FIXME("(%p)->(%s,%d) unknown state\n", This, debug_d3drenderstate(State), Value);
}