mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
GLX: Added glXSwapIntervalMESA.
This commit is contained in:
parent
fb7fd32f24
commit
bb8531d9a2
1 changed files with 20 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue