comparison src/video/win32/SDL_d3drender.c @ 1901:f1828a500391

Removed libc dependency on Windows again, to fix building with Visual C++ 2005 Express Edition. Fixed performance problem with testsprite2 on the D3D driver.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 13 Jul 2006 08:13:02 +0000
parents 5c6bdbf3aadf
children f132024010be
comparison
equal deleted inserted replaced
1900:5c6bdbf3aadf 1901:f1828a500391
285 pparams.Windowed = FALSE; 285 pparams.Windowed = FALSE;
286 } else { 286 } else {
287 pparams.Windowed = TRUE; 287 pparams.Windowed = TRUE;
288 } 288 }
289 pparams.FullScreen_RefreshRateInHz = 0; /* FIXME */ 289 pparams.FullScreen_RefreshRateInHz = 0; /* FIXME */
290 pparams.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
290 291
291 result = IDirect3D9_CreateDevice(videodata->d3d, D3DADAPTER_DEFAULT, /* FIXME */ 292 result = IDirect3D9_CreateDevice(videodata->d3d, D3DADAPTER_DEFAULT, /* FIXME */
292 D3DDEVTYPE_HAL, 293 D3DDEVTYPE_HAL,
293 windowdata->hwnd, 294 windowdata->hwnd,
294 D3DCREATE_SOFTWARE_VERTEXPROCESSING, 295 D3DCREATE_SOFTWARE_VERTEXPROCESSING,
429 static int 430 static int
430 SDL_D3D_RenderFill(SDL_Renderer * renderer, const SDL_Rect * rect, 431 SDL_D3D_RenderFill(SDL_Renderer * renderer, const SDL_Rect * rect,
431 Uint32 color) 432 Uint32 color)
432 { 433 {
433 SDL_D3D_RenderData *data = (SDL_D3D_RenderData *) renderer->driverdata; 434 SDL_D3D_RenderData *data = (SDL_D3D_RenderData *) renderer->driverdata;
435 D3DRECT d3drect;
434 HRESULT result; 436 HRESULT result;
435 437
436 if (data->beginScene) { 438 if (data->beginScene) {
437 IDirect3DDevice9_BeginScene(data->device); 439 IDirect3DDevice9_BeginScene(data->device);
438 data->beginScene = SDL_FALSE; 440 data->beginScene = SDL_FALSE;
439 } 441 }
440 442
441 result = 443 d3drect.x1 = rect->x;
442 IDirect3DDevice9_Clear(data->device, 0, NULL, D3DCLEAR_TARGET, 444 d3drect.x2 = rect->x+rect->w;
443 (D3DCOLOR) color, 1.0f, 0); 445 d3drect.y1 = rect->y;
446 d3drect.y2 = rect->y+rect->h;
447
448 result = IDirect3DDevice9_Clear(data->device, 1, &d3drect, D3DCLEAR_TARGET, (D3DCOLOR) color, 1.0f, 0);
444 if (FAILED(result)) { 449 if (FAILED(result)) {
445 D3D_SetError("Clear()", result); 450 D3D_SetError("Clear()", result);
446 return -1; 451 return -1;
447 } 452 }
448 return 0; 453 return 0;