mirror of
https://github.com/glfw/glfw.git
synced 2026-01-11 23:33:16 +01:00
Added support for GLX_EXT_swap_control.
This commit is contained in:
@@ -100,6 +100,7 @@ typedef struct _GLFWcontextGLX
|
||||
|
||||
// GLX extensions
|
||||
PFNGLXSWAPINTERVALSGIPROC SwapIntervalSGI;
|
||||
PFNGLXSWAPINTERVALEXTPROC SwapIntervalEXT;
|
||||
PFNGLXGETFBCONFIGATTRIBSGIXPROC GetFBConfigAttribSGIX;
|
||||
PFNGLXCHOOSEFBCONFIGSGIXPROC ChooseFBConfigSGIX;
|
||||
PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC CreateContextWithConfigSGIX;
|
||||
@@ -107,6 +108,7 @@ typedef struct _GLFWcontextGLX
|
||||
PFNGLXCREATECONTEXTATTRIBSARBPROC CreateContextAttribsARB;
|
||||
GLboolean has_GLX_SGIX_fbconfig;
|
||||
GLboolean has_GLX_SGI_swap_control;
|
||||
GLboolean has_GLX_EXT_swap_control;
|
||||
GLboolean has_GLX_ARB_multisample;
|
||||
GLboolean has_GLX_ARB_create_context;
|
||||
GLboolean has_GLX_ARB_create_context_profile;
|
||||
|
||||
@@ -667,13 +667,25 @@ static int createContext(_GLFWwindow* window,
|
||||
|
||||
static void initGLXExtensions(_GLFWwindow* window)
|
||||
{
|
||||
if (_glfwPlatformExtensionSupported("GLX_SGI_swap_control"))
|
||||
if (_glfwPlatformExtensionSupported("GLX_EXT_swap_control"))
|
||||
{
|
||||
window->GLX.SwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)
|
||||
_glfwPlatformGetProcAddress("glXSwapIntervalSGI");
|
||||
window->GLX.SwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)
|
||||
_glfwPlatformGetProcAddress("glXSwapIntervalEXT");
|
||||
|
||||
if (window->GLX.SwapIntervalSGI)
|
||||
window->GLX.has_GLX_SGI_swap_control = GL_TRUE;
|
||||
if (window->GLX.SwapIntervalEXT)
|
||||
window->GLX.has_GLX_EXT_swap_control = GL_TRUE;
|
||||
}
|
||||
|
||||
if (!window->GLX.has_GLX_EXT_swap_control)
|
||||
{
|
||||
if (_glfwPlatformExtensionSupported("GLX_SGI_swap_control"))
|
||||
{
|
||||
window->GLX.SwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)
|
||||
_glfwPlatformGetProcAddress("glXSwapIntervalSGI");
|
||||
|
||||
if (window->GLX.SwapIntervalSGI)
|
||||
window->GLX.has_GLX_SGI_swap_control = GL_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (_glfwPlatformExtensionSupported("GLX_SGIX_fbconfig"))
|
||||
@@ -1684,7 +1696,13 @@ void _glfwPlatformSwapInterval(int interval)
|
||||
{
|
||||
_GLFWwindow* window = _glfwLibrary.currentWindow;
|
||||
|
||||
if (window->GLX.has_GLX_SGI_swap_control)
|
||||
if (window->GLX.has_GLX_EXT_swap_control)
|
||||
{
|
||||
window->GLX.SwapIntervalEXT(_glfwLibrary.X11.display,
|
||||
window->X11.handle,
|
||||
interval);
|
||||
}
|
||||
else if (window->GLX.has_GLX_SGI_swap_control)
|
||||
window->GLX.SwapIntervalSGI(interval);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user