GLX: Added glXSwapIntervalMESA.

This commit is contained in:
bkaradzic 2013-04-27 22:39:15 -07:00
parent fb7fd32f24
commit bb8531d9a2

View File

@ -12,8 +12,11 @@
namespace bgfx
{
typedef int (*PFNGLXSWAPINTERVALMESAPROC)(uint32_t _interval);
PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB;
PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT;
PFNGLXSWAPINTERVALMESAPROC glXSwapIntervalMESA;
PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI;
# define GL_IMPORT(_optional, _proto, _func) _proto _func
@ -159,11 +162,20 @@ namespace bgfx
}
else
{
glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)glXGetProcAddress( (const GLubyte*)"glXSwapIntervalSGI");
if (NULL != glXSwapIntervalSGI)
glXSwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC)glXGetProcAddress( (const GLubyte*)"glXSwapIntervalMESA");
if (NULL != glXSwapIntervalMESA)
{
BX_TRACE("Using glXSwapIntervalSGI.");
glXSwapIntervalSGI(0);
BX_TRACE("Using glXSwapIntervalMESA.");
glXSwapIntervalMESA(0);
}
else
{
glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)glXGetProcAddress( (const GLubyte*)"glXSwapIntervalSGI");
if (NULL != glXSwapIntervalSGI)
{
BX_TRACE("Using glXSwapIntervalSGI.");
glXSwapIntervalSGI(0);
}
}
}
@ -188,6 +200,10 @@ namespace bgfx
{
glXSwapIntervalEXT(s_display, s_window, interval);
}
else if (NULL != glXSwapIntervalMESA)
{
glXSwapIntervalMESA(interval);
}
else if (NULL != glXSwapIntervalSGI)
{
glXSwapIntervalSGI(interval);