Add vsync ini option, controls GL_EXT_swap_control, default disabled
This commit is contained in:
parent
fe6322d165
commit
d066962617
3 changed files with 32 additions and 1 deletions
18
render.c
18
render.c
|
@ -34,6 +34,24 @@ DWORD WINAPI render_main(void)
|
|||
hRC = wglCreateContext( ddraw->render.hDC );
|
||||
wglMakeCurrent( ddraw->render.hDC, hRC );
|
||||
|
||||
char *glext = (char *)glGetString(GL_EXTENSIONS);
|
||||
|
||||
if(glext && strstr(glext, "WGL_EXT_swap_control"))
|
||||
{
|
||||
BOOL (APIENTRY *wglSwapIntervalEXT)(int) = (BOOL (APIENTRY *)(int))wglGetProcAddress("wglSwapIntervalEXT");
|
||||
if(wglSwapIntervalEXT)
|
||||
{
|
||||
if(ddraw->vsync)
|
||||
{
|
||||
wglSwapIntervalEXT(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
wglSwapIntervalEXT(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DWORD tick_start;
|
||||
DWORD tick_end;
|
||||
DWORD frame_len;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue