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 namespace bgfx
{ {
typedef int (*PFNGLXSWAPINTERVALMESAPROC)(uint32_t _interval);
PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB; PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB;
PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT; PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT;
PFNGLXSWAPINTERVALMESAPROC glXSwapIntervalMESA;
PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI; PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI;
# define GL_IMPORT(_optional, _proto, _func) _proto _func # define GL_IMPORT(_optional, _proto, _func) _proto _func
@ -159,11 +162,20 @@ namespace bgfx
} }
else else
{ {
glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)glXGetProcAddress( (const GLubyte*)"glXSwapIntervalSGI"); glXSwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC)glXGetProcAddress( (const GLubyte*)"glXSwapIntervalMESA");
if (NULL != glXSwapIntervalSGI) if (NULL != glXSwapIntervalMESA)
{ {
BX_TRACE("Using glXSwapIntervalSGI."); BX_TRACE("Using glXSwapIntervalMESA.");
glXSwapIntervalSGI(0); 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); glXSwapIntervalEXT(s_display, s_window, interval);
} }
else if (NULL != glXSwapIntervalMESA)
{
glXSwapIntervalMESA(interval);
}
else if (NULL != glXSwapIntervalSGI) else if (NULL != glXSwapIntervalSGI)
{ {
glXSwapIntervalSGI(interval); glXSwapIntervalSGI(interval);