GLX: Added glXSwapIntervalMESA.
This commit is contained in:
parent
fb7fd32f24
commit
bb8531d9a2
@ -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
|
||||
@ -158,6 +161,14 @@ namespace bgfx
|
||||
glXSwapIntervalEXT(s_display, s_window, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
glXSwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC)glXGetProcAddress( (const GLubyte*)"glXSwapIntervalMESA");
|
||||
if (NULL != glXSwapIntervalMESA)
|
||||
{
|
||||
BX_TRACE("Using glXSwapIntervalMESA.");
|
||||
glXSwapIntervalMESA(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)glXGetProcAddress( (const GLubyte*)"glXSwapIntervalSGI");
|
||||
if (NULL != glXSwapIntervalSGI)
|
||||
@ -166,6 +177,7 @@ namespace bgfx
|
||||
glXSwapIntervalSGI(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glXMakeCurrent(s_display, s_window, m_context);
|
||||
|
||||
@ -188,6 +200,10 @@ namespace bgfx
|
||||
{
|
||||
glXSwapIntervalEXT(s_display, s_window, interval);
|
||||
}
|
||||
else if (NULL != glXSwapIntervalMESA)
|
||||
{
|
||||
glXSwapIntervalMESA(interval);
|
||||
}
|
||||
else if (NULL != glXSwapIntervalSGI)
|
||||
{
|
||||
glXSwapIntervalSGI(interval);
|
||||
|
Loading…
Reference in New Issue
Block a user