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

force glFinish with vsync

This commit is contained in:
FunkyFr3sh 2018-07-16 15:35:45 +02:00
parent c5975902ee
commit 99406d1d64
2 changed files with 7 additions and 1 deletions

View File

@ -2,7 +2,7 @@
#define vxstr(a,b,c,d) str(a##.##b##.##c##.##d)
#define str(s) #s
#define VERSION 1,1,8,0
#define VERSION 1,1,8,1
1 VERSIONINFO
FILEVERSION VERSION

View File

@ -57,6 +57,7 @@ DWORD WINAPI render_main(void)
OpenGL_Init();
int maxfps = ddraw->render.maxfps;
BOOL vsyncEnabled = FALSE;
if (OpenGL_ExtExists("WGL_EXT_swap_control_tear", ddraw->render.hDC))
{
@ -66,6 +67,7 @@ DWORD WINAPI render_main(void)
{
wglSwapIntervalEXT(-1);
maxfps = 1000;
vsyncEnabled = TRUE;
}
else
wglSwapIntervalEXT(0);
@ -79,6 +81,7 @@ DWORD WINAPI render_main(void)
{
wglSwapIntervalEXT(1);
maxfps = 1000;
vsyncEnabled = TRUE;
}
else
wglSwapIntervalEXT(0);
@ -659,6 +662,9 @@ DWORD WINAPI render_main(void)
SwapBuffers(ddraw->render.hDC);
if (vsyncEnabled)
glFinish();
#if _DEBUG
if (frame_count == 1) frameTime = CounterStop();
#endif