mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 00:41:26 +12:00
gl: Implement swap control on linux
This commit is contained in:
parent
d37aa466ff
commit
c05d164eee
2 changed files with 19 additions and 1 deletions
|
@ -34,6 +34,9 @@ void gl::init()
|
||||||
#ifdef __unix__
|
#ifdef __unix__
|
||||||
glewExperimental = true;
|
glewExperimental = true;
|
||||||
glewInit();
|
glewInit();
|
||||||
|
#ifndef __APPLE__
|
||||||
|
glxewInit();
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,5 +44,19 @@ void gl::set_swapinterval(int interval)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
wglSwapIntervalEXT(interval);
|
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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ typedef BOOL (WINAPI* PFNWGLSWAPINTERVALEXTPROC) (int interval);
|
||||||
#include <OpenGL/glu.h>
|
#include <OpenGL/glu.h>
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
#include <GL/glxew.h>
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#include <GL/glx.h>
|
#include <GL/glx.h>
|
||||||
#include <GL/glxext.h>
|
#include <GL/glxext.h>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue