diff 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
line wrap: on
line diff
--- a/src/video/win32/SDL_d3drender.c	Wed Jul 12 09:25:17 2006 +0000
+++ b/src/video/win32/SDL_d3drender.c	Thu Jul 13 08:13:02 2006 +0000
@@ -287,6 +287,7 @@
         pparams.Windowed = TRUE;
     }
     pparams.FullScreen_RefreshRateInHz = 0;     /* FIXME */
+    pparams.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
 
     result = IDirect3D9_CreateDevice(videodata->d3d, D3DADAPTER_DEFAULT,        /* FIXME */
                                      D3DDEVTYPE_HAL,
@@ -431,6 +432,7 @@
                    Uint32 color)
 {
     SDL_D3D_RenderData *data = (SDL_D3D_RenderData *) renderer->driverdata;
+    D3DRECT d3drect;
     HRESULT result;
 
     if (data->beginScene) {
@@ -438,9 +440,12 @@
         data->beginScene = SDL_FALSE;
     }
 
-    result =
-        IDirect3DDevice9_Clear(data->device, 0, NULL, D3DCLEAR_TARGET,
-                               (D3DCOLOR) color, 1.0f, 0);
+    d3drect.x1 = rect->x;
+    d3drect.x2 = rect->x+rect->w;
+    d3drect.y1 = rect->y;
+    d3drect.y2 = rect->y+rect->h;
+
+    result = IDirect3DDevice9_Clear(data->device, 1, &d3drect, D3DCLEAR_TARGET, (D3DCOLOR) color, 1.0f, 0);
     if (FAILED(result)) {
         D3D_SetError("Clear()", result);
         return -1;