mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-25 01:57:47 +01:00
don't use DwmFlush in wine
This commit is contained in:
parent
c77a6ce19e
commit
92c0b2a3ed
@ -48,6 +48,7 @@ typedef struct FPSLIMITER
|
|||||||
D3DKMTCLOSEADAPTERPROC D3DKMTCloseAdapter;
|
D3DKMTCLOSEADAPTERPROC D3DKMTCloseAdapter;
|
||||||
BOOL got_adapter;
|
BOOL got_adapter;
|
||||||
BOOL initialized;
|
BOOL initialized;
|
||||||
|
BOOL is_wine;
|
||||||
} FPSLIMITER;
|
} FPSLIMITER;
|
||||||
|
|
||||||
extern FPSLIMITER g_fpsl;
|
extern FPSLIMITER g_fpsl;
|
||||||
|
@ -75,6 +75,8 @@ void fpsl_init()
|
|||||||
(D3DKMTCLOSEADAPTERPROC)real_GetProcAddress(g_fpsl.gdi32_dll, "D3DKMTCloseAdapter");
|
(D3DKMTCLOSEADAPTERPROC)real_GetProcAddress(g_fpsl.gdi32_dll, "D3DKMTCloseAdapter");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_fpsl.is_wine = real_GetProcAddress(GetModuleHandleA("ntdll.dll"), "wine_get_version") != 0;
|
||||||
|
|
||||||
g_fpsl.initialized = TRUE;
|
g_fpsl.initialized = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,7 +106,12 @@ BOOL fpsl_wait_for_vblank(BOOL open_adapter)
|
|||||||
|
|
||||||
BOOL fpsl_dwm_flush()
|
BOOL fpsl_dwm_flush()
|
||||||
{
|
{
|
||||||
return g_fpsl.initialized && fpsl_dwm_is_enabled() && g_fpsl.DwmFlush && SUCCEEDED(g_fpsl.DwmFlush());
|
return
|
||||||
|
g_fpsl.initialized &&
|
||||||
|
fpsl_dwm_is_enabled() &&
|
||||||
|
g_fpsl.DwmFlush &&
|
||||||
|
!g_fpsl.is_wine &&
|
||||||
|
SUCCEEDED(g_fpsl.DwmFlush());
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL fpsl_dwm_is_enabled()
|
BOOL fpsl_dwm_is_enabled()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user