mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-16 23:17:29 +00:00
gl: Implement swap control on linux
This commit is contained in:
parent
d37aa466ff
commit
c05d164eee
@ -34,6 +34,9 @@ void gl::init()
|
||||
#ifdef __unix__
|
||||
glewExperimental = true;
|
||||
glewInit();
|
||||
#ifndef __APPLE__
|
||||
glxewInit();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -41,5 +44,19 @@ void gl::set_swapinterval(int interval)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
wglSwapIntervalEXT(interval);
|
||||
#elif !defined(__APPLE__)
|
||||
if (glXSwapIntervalEXT)
|
||||
{
|
||||
if (auto window = glXGetCurrentDrawable())
|
||||
{
|
||||
glXSwapIntervalEXT(glXGetCurrentDisplay(), window, interval);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//No existing drawable or missing swap extension, EGL?
|
||||
LOG_ERROR(RSX, "Failed to set swap interval");
|
||||
#else
|
||||
LOG_UNIMPLEMENTED(RSX, "Swap control not implemented for this platform. Vsync options not available.");
|
||||
#endif
|
||||
}
|
@ -22,6 +22,7 @@ typedef BOOL (WINAPI* PFNWGLSWAPINTERVALEXTPROC) (int interval);
|
||||
#include <OpenGL/glu.h>
|
||||
|
||||
#else
|
||||
#include <GL/glxew.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glx.h>
|
||||
#include <GL/glxext.h>
|
||||
|
Loading…
Reference in New Issue
Block a user