Re: [PATCH] d3d9/tests: Add test for IDirect3DDevice9_Reset with BackBufferWidth/Height = 0.
On 6 November 2012 05:01, Sam Edwards <cfsworks(a)gmail.com> wrote:
Perhaps a similar test is necessary in other Direct3D versions, but I haven't yet looked into it.
Yeah, we'll want a similar test for d3d8.
+ /* For resizing the window, we need to know the nonclient area size */ + ok(GetWindowRect(hwnd, &winsize), "GetWindowRect failed\n"); + nonclient_width = winsize.right-winsize.left; + nonclient_height = winsize.bottom-winsize.top; + ok(GetClientRect(hwnd, &winsize), "GetClientRect failed\n"); + nonclient_width -= winsize.right; + nonclient_height -= winsize.bottom; ... + ok(MoveWindow(hwnd, 0, 0, 200+nonclient_width, 150+nonclient_height, FALSE), + "MoveWindow failed\n"); You're probably looking for AdjustWindowRect() and SetWindowPos().
+ hr = IDirect3DDevice9_GetViewport(device1, &vp); + ok(hr == D3D_OK, "IDirect3DDevice9_GetViewport failed with %08x\n", hr); + if(SUCCEEDED(hr)) + { + ok(vp.X == 0, "D3DVIEWPORT->X = %d\n", vp.X); + ok(vp.Y == 0, "D3DVIEWPORT->Y = %d\n", vp.Y); + todo_wine ok(vp.Width == 200, "D3DVIEWPORT->Width = %d\n", vp.Width); + todo_wine ok(vp.Height == 150, "D3DVIEWPORT->Height = %d\n", vp.Height); + ok(vp.MinZ == 0, "D3DVIEWPORT->MinZ = %f\n", vp.MinZ); + ok(vp.MaxZ == 1, "D3DVIEWPORT->MaxZ = %f\n", vp.MaxZ); + } Testing the viewport dimensions is useful, but it probably wouldn't hurt to check the swapchain's presentation parameters and the backbuffer's surface desc as well.
participants (1)
-
Henri Verbeet