1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 14:14:47 +01:00

only clear if needed

This commit is contained in:
FunkyFr3sh 2023-02-24 17:08:09 +01:00
parent 1cfce3f321
commit a62ebdc203
2 changed files with 8 additions and 2 deletions

View File

@ -534,7 +534,10 @@ DWORD WINAPI d3d9_render_main(void)
LeaveCriticalSection(&g_ddraw->cs);
IDirect3DDevice9_Clear(g_d3d9.device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0);
if (g_ddraw->render.viewport.x != 0 || g_ddraw->render.viewport.y != 0)
{
IDirect3DDevice9_Clear(g_d3d9.device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0);
}
IDirect3DDevice9_BeginScene(g_d3d9.device);
IDirect3DDevice9_DrawPrimitive(g_d3d9.device, D3DPT_TRIANGLESTRIP, 0, 2);

View File

@ -755,7 +755,10 @@ static void ogl_render()
LeaveCriticalSection(&g_ddraw->cs);
glClear(GL_COLOR_BUFFER_BIT);
if (g_ddraw->render.viewport.x != 0 || g_ddraw->render.viewport.y != 0)
{
glClear(GL_COLOR_BUFFER_BIT);
}
if (scale_changed)
{