mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 09:01:46 +00:00
Added support for GLX_EXT_swap_control.
This commit is contained in:
parent
10a2b3fa79
commit
1ee78ecef5
@ -295,6 +295,7 @@ version of GLFW.</p>
|
||||
<li>Removed <code>GLFWCALL</code> and <code>GLFWAPIENTRY</code> macros for stdcall calling convention</li>
|
||||
<li>Bugfix: The default OpenGL version in the <code>version</code> test was set to 1.1</li>
|
||||
<li>Bugfix: The OpenGL profile and forward-compatibility window parameters were not saved after context creation</li>
|
||||
<li>[X11] Added support for the <code>GLX_EXT_swap_control</code> extension as an alternative to <code>GLX_SGI_swap_control</code></li>
|
||||
<li>[X11] Bugfix: Calling <code>glXCreateContextAttribsARB</code> with an unavailable OpenGL version caused the application to terminate with a <code>BadMatch</code> Xlib error</li>
|
||||
<li>[Win32] Removed explicit support for versions of Windows older than Windows XP</li>
|
||||
<li>[Win32] Bugfix: Window activation and iconification did not work as expected</li>
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user