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:
parent
ee83a95c52
commit
04fc3c808b
@ -212,7 +212,7 @@ HRESULT RealPrimarySurface::create(CompatRef<DirectDraw> dd)
|
|||||||
desc.dwSize = sizeof(desc);
|
desc.dwSize = sizeof(desc);
|
||||||
desc.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
|
desc.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
|
||||||
desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP;
|
desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP;
|
||||||
desc.dwBackBufferCount = 1;
|
desc.dwBackBufferCount = 2;
|
||||||
|
|
||||||
CompatPtr<typename Types<DirectDraw>::TCreatedSurface> surface;
|
CompatPtr<typename Types<DirectDraw>::TCreatedSurface> surface;
|
||||||
HRESULT result = dd->CreateSurface(&dd, &desc, &surface.getRef(), nullptr);
|
HRESULT result = dd->CreateSurface(&dd, &desc, &surface.getRef(), nullptr);
|
||||||
@ -266,12 +266,8 @@ HRESULT RealPrimarySurface::flip(DWORD flags)
|
|||||||
|
|
||||||
invalidate(nullptr);
|
invalidate(nullptr);
|
||||||
compatBlt(*g_backBuffer);
|
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))
|
if (SUCCEEDED(result))
|
||||||
{
|
{
|
||||||
g_qpcNextUpdate = getNextUpdateQpc(
|
g_qpcNextUpdate = getNextUpdateQpc(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user