Index: dxgltest/MultiDD.cpp |
— | — | @@ -263,6 +263,25 @@ |
264 | 264 | return ret;
|
265 | 265 | }
|
266 | 266 |
|
| 267 | +HRESULT MultiDirectDrawSurface::AddAttachedSurface(MultiDirectDrawSurface *lpDDSAttachedSurface)
|
| 268 | +{
|
| 269 | + switch(version)
|
| 270 | + {
|
| 271 | + case 1:
|
| 272 | + return dds1->AddAttachedSurface(lpDDSAttachedSurface->dds1);
|
| 273 | + case 2:
|
| 274 | + return dds2->AddAttachedSurface(lpDDSAttachedSurface->dds2);
|
| 275 | + case 3:
|
| 276 | + return dds3->AddAttachedSurface(lpDDSAttachedSurface->dds3);
|
| 277 | + case 4:
|
| 278 | + return dds4->AddAttachedSurface(lpDDSAttachedSurface->dds4);
|
| 279 | + case 7:
|
| 280 | + return dds7->AddAttachedSurface(lpDDSAttachedSurface->dds7);
|
| 281 | + default:
|
| 282 | + return DDERR_GENERIC;
|
| 283 | + }
|
| 284 | +}
|
| 285 | +
|
267 | 286 | HRESULT MultiDirectDrawSurface::Lock(LPRECT lpDestRect, LPDDSURFACEDESC2 lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
|
268 | 287 | {
|
269 | 288 | switch(version)
|
Index: dxgltest/Tests3D.cpp |
— | — | @@ -33,6 +33,7 @@ |
34 | 34 | static MultiDirectDraw *ddinterface;
|
35 | 35 | static MultiDirectDrawSurface *ddsurface;
|
36 | 36 | static MultiDirectDrawSurface *ddsrender;
|
| 37 | +static MultiDirectDrawSurface *zbuffer;
|
37 | 38 | static IDirect3D7 *d3d7;
|
38 | 39 | static IDirect3DDevice7 *d3d7dev;
|
39 | 40 | static LPDIRECTDRAWCLIPPER ddclipper;
|
— | — | @@ -161,6 +162,15 @@ |
162 | 163 |
|
163 | 164 | const TCHAR wndclassname3d[] = _T("D3DTestWndClass");
|
164 | 165 |
|
| 166 | +static HRESULT WINAPI zcallback(DDPIXELFORMAT *ddpf, VOID *context)
|
| 167 | +{
|
| 168 | + if(ddpf->dwFlags == DDPF_ZBUFFER)
|
| 169 | + {
|
| 170 | + memcpy(context,ddpf,sizeof(DDPIXELFORMAT));
|
| 171 | + return D3DENUMRET_CANCEL;
|
| 172 | + }
|
| 173 | + return D3DENUMRET_OK;
|
| 174 | +}
|
165 | 175 |
|
166 | 176 | void RunTest3D(int testnum, int width, int height, int bpp, int refresh, int backbuffers, int apiver,
|
167 | 177 | int filter, int msaa, double fps, bool fullscreen, bool resizable)
|
— | — | @@ -167,6 +177,7 @@ |
168 | 178 | {
|
169 | 179 | DDSCAPS2 caps;
|
170 | 180 | DDSURFACEDESC2 ddsd;
|
| 181 | + DDPIXELFORMAT ddpfz;
|
171 | 182 | BOOL done = false;
|
172 | 183 | ::testnum = testnum;
|
173 | 184 | randnum = (unsigned int)time(NULL);
|
— | — | @@ -271,6 +282,12 @@ |
272 | 283 | }
|
273 | 284 | }
|
274 | 285 | error = ddinterface->QueryInterface(IID_IDirect3D7,(VOID**)&d3d7);
|
| 286 | + error = d3d7->EnumZBufferFormats(IID_IDirect3DHALDevice,zcallback,&ddpfz);
|
| 287 | + ddsd.dwFlags = DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT|DDSD_PIXELFORMAT;
|
| 288 | + ddsd.ddsCaps.dwCaps = DDSCAPS_ZBUFFER|DDSCAPS_VIDEOMEMORY;
|
| 289 | + memcpy(&ddsd.ddpfPixelFormat,&ddpfz,sizeof(DDPIXELFORMAT));
|
| 290 | + error = ddinterface->CreateSurface(&ddsd,&zbuffer,NULL);
|
| 291 | + error = ddsrender->AddAttachedSurface(zbuffer);
|
275 | 292 | error = d3d7->CreateDevice(IID_IDirect3DHALDevice,(LPDIRECTDRAWSURFACE7)ddsrender->GetSurface(),&d3d7dev);
|
276 | 293 | if(error != D3D_OK)
|
277 | 294 | error = d3d7->CreateDevice(IID_IDirect3DRGBDevice,(LPDIRECTDRAWSURFACE7)ddsrender->GetSurface(),&d3d7dev);
|
— | — | @@ -277,7 +294,7 @@ |
278 | 295 | ddsrender->GetSurfaceDesc(&ddsd);
|
279 | 296 | D3DVIEWPORT7 vp = {0,0,ddsd.dwWidth,ddsd.dwHeight,0.0f,1.0f};
|
280 | 297 | error = d3d7dev->SetViewport(&vp);
|
281 | | -
|
| 298 | + error = d3d7dev->SetRenderState(D3DRENDERSTATE_ZENABLE,TRUE);
|
282 | 299 | InitTest3D(testnum);
|
283 | 300 | if(!fullscreen) SendMessage(hWnd,WM_PAINT,0,0);
|
284 | 301 | if(testtypes[testnum] == 1)
|
— | — | @@ -414,11 +431,7 @@ |
415 | 432 | ZeroMemory(&ddsd,sizeof(DDSURFACEDESC2));
|
416 | 433 | if(d3dver >= 3) ddsd.dwSize = sizeof(DDSURFACEDESC2);
|
417 | 434 | else ddsd.dwSize = sizeof(DDSURFACEDESC);
|
418 | | - DDBLTFX bltfx;
|
419 | | - ZeroMemory(&bltfx,sizeof(DDBLTFX));
|
420 | | - bltfx.dwSize = sizeof(DDBLTFX);
|
421 | | - bltfx.dwFillColor = 0;
|
422 | | - ddsrender->Blt(NULL,NULL,NULL,DDBLT_COLORFILL,&bltfx);
|
| 435 | + d3d7dev->Clear(0,NULL,D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,0,1.0,0);
|
423 | 436 | float time = (float)clock() / (float)CLOCKS_PER_SEC;
|
424 | 437 | switch(test)
|
425 | 438 | {
|
Index: . |
Property changes on: . |
___________________________________________________________________ |
Modified: svn:ignore |
## -7,3 +7,4 ## |
426 | 439 | Release |
427 | 440 | Release no DXGL |
428 | 441 | *.opensdf |
| 442 | +enc_temp_folder |