1
0
mirror of https://github.com/narzoul/DDrawCompat synced 2024-12-30 08:55:36 +01:00

Added triple buffering in full screen mode

Fixes stuttering in Midtown Madness 2 Trial (and probably other games)
when V-sync is enabled.
This commit is contained in:
narzoul 2016-05-26 00:56:24 +02:00
parent ee83a95c52
commit 04fc3c808b

View File

@ -212,7 +212,7 @@ HRESULT RealPrimarySurface::create(CompatRef<DirectDraw> dd)
desc.dwSize = sizeof(desc);
desc.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP;
desc.dwBackBufferCount = 1;
desc.dwBackBufferCount = 2;
CompatPtr<typename Types<DirectDraw>::TCreatedSurface> surface;
HRESULT result = dd->CreateSurface(&dd, &desc, &surface.getRef(), nullptr);
@ -266,12 +266,8 @@ HRESULT RealPrimarySurface::flip(DWORD flags)
invalidate(nullptr);
compatBlt(*g_backBuffer);
if (flags & DDFLIP_DONOTWAIT)
{
flags ^= DDFLIP_DONOTWAIT;
}
HRESULT result = g_frontBuffer->Flip(g_frontBuffer, nullptr, flags | DDFLIP_WAIT);
HRESULT result = g_frontBuffer->Flip(g_frontBuffer, nullptr, flags);
if (SUCCEEDED(result))
{
g_qpcNextUpdate = getNextUpdateQpc(