fix for non working vsync
This commit is contained in:
parent
9d9ced47f4
commit
d98cf4f6ea
4 changed files with 45 additions and 4 deletions
15
src/opengl.c
15
src/opengl.c
|
@ -64,6 +64,7 @@ PFNGLCHECKFRAMEBUFFERSTATUSPROC glCheckFramebufferStatus = NULL;
|
|||
PFNGLDELETEFRAMEBUFFERSPROC glDeleteFramebuffers = NULL;
|
||||
|
||||
PFNWGLSWAPINTERVALEXT wglSwapIntervalEXT = NULL;
|
||||
PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB = NULL;
|
||||
|
||||
PFNGLTEXBUFFERPROC glTexBuffer = NULL;
|
||||
|
||||
|
@ -128,11 +129,12 @@ void OpenGL_Init()
|
|||
glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)wglGetProcAddress("glDeleteFramebuffers");
|
||||
|
||||
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXT)wglGetProcAddress("wglSwapIntervalEXT");
|
||||
wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)wglGetProcAddress("wglGetExtensionsStringARB");
|
||||
|
||||
glTexBuffer = (PFNGLTEXBUFFERPROC)wglGetProcAddress("glTexBuffer");
|
||||
}
|
||||
|
||||
BOOL OpenGL_ExtExists(char *ext)
|
||||
BOOL OpenGL_ExtExists(char *ext, HDC hdc)
|
||||
{
|
||||
char *glext = (char *)glGetString(GL_EXTENSIONS);
|
||||
if (glext)
|
||||
|
@ -140,6 +142,17 @@ BOOL OpenGL_ExtExists(char *ext)
|
|||
if (strstr(glext, ext))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (wglGetExtensionsStringARB)
|
||||
{
|
||||
char *wglext = (char *)wglGetExtensionsStringARB(hdc);
|
||||
if (wglext)
|
||||
{
|
||||
if (strstr(wglext, ext))
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue