diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 3a56298..4e7a305 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -2051,6 +2051,103 @@ static void test_set_material(void) if(d3d9) IDirect3D9_Release(d3d9); } +static void test_scissor_size(void) +{ + IDirect3D9 *d3d9_ptr = 0; + int i; + static const struct { + int winx; int winy; int backx; int backy; int backswap1x; int backswap1y; BOOL window; + } scts[] = { /* scissor tests */ + {800, 600, 640, 480, 1024, 768, TRUE}, + {800, 600, 640, 480, 1024, 768, FALSE}, + {640, 480, 800, 600, 1024, 768, TRUE}, + {640, 480, 800, 600, 1024, 768, FALSE}, + + {1024, 768, 640, 480, 800, 600, TRUE}, + {1024, 768, 640, 480, 800, 600, FALSE}, + {640, 480, 1024, 768, 800, 600, TRUE}, + {640, 480, 1024, 768, 800, 600, FALSE}, + + {1024, 768, 800, 600, 640, 480, TRUE}, + {1024, 768, 800, 600, 640, 480, FALSE}, + {800, 600, 1024, 768, 640, 480, TRUE}, + {800, 600, 1024, 768, 640, 480, FALSE}, + }; + + d3d9_ptr = pDirect3DCreate9(D3D_SDK_VERSION); + ok(d3d9_ptr != NULL, "Failed to create IDirect3D9 object\n"); + if (!d3d9_ptr){ + skip("Failed to create IDirect3D9 object\n"); + return; + } + + for(i=0; itextures[i] = NULL; } + /* Set the default scissor rect values */ + desc.Width = &width; + desc.Height = &height; + + IWineD3DDevice_GetSwapChain(device, 0, &swapchain); + IWineD3DSwapChain_GetBackBuffer(swapchain, 0, WINED3DBACKBUFFER_TYPE_MONO, &backbuffer); + IWineD3DSurface_GetDesc(backbuffer, &desc); + IWineD3DSurface_Release(backbuffer); + IWineD3DSwapChain_Release(swapchain); + + scissorrect.left = 0; + scissorrect.right = width; + scissorrect.top = 0; + scissorrect.bottom = height; + IWineD3DDevice_SetScissorRect(device, &scissorrect); + TRACE("-----------------------> Device defaults now set up...\n"); return WINED3D_OK; }