mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-04-10 19:15:13 +00:00
Small improvements to the VSync setup and logging.
This commit is contained in:
parent
e2b3ca55be
commit
001a46341e
|
|
@ -377,21 +377,20 @@ namespace Renderer
|
||||||
|
|
||||||
void setSwapInterval()
|
void setSwapInterval()
|
||||||
{
|
{
|
||||||
// vsync.
|
|
||||||
if (Settings::getInstance()->getBool("VSync")) {
|
if (Settings::getInstance()->getBool("VSync")) {
|
||||||
// SDL_GL_SetSwapInterval(0) for immediate updates (no vsync, default),
|
// Adaptive VSync seems to be nonfunctional or having issues on some hardware
|
||||||
// 1 for updates synchronized with the vertical retrace,
|
// and drivers, so only attempt to apply regular VSync.
|
||||||
// or -1 for late swap tearing.
|
if (SDL_GL_SetSwapInterval(1) == 0) {
|
||||||
// SDL_GL_SetSwapInterval returns 0 on success, -1 on error.
|
LOG(LogInfo) << "Enabling VSync...";
|
||||||
// if vsync is requested, try normal vsync; if that doesn't work, try late swap tearing
|
}
|
||||||
// if that doesn't work, report an error.
|
else {
|
||||||
if (SDL_GL_SetSwapInterval(1) != 0 && SDL_GL_SetSwapInterval(-1) != 0) {
|
LOG(LogWarning) << "Could not enable VSync: " << SDL_GetError();
|
||||||
LOG(LogWarning) << "Tried to enable vsync, but it failed. (" <<
|
|
||||||
SDL_GetError() << ")";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
SDL_GL_SetSwapInterval(0);
|
SDL_GL_SetSwapInterval(0);
|
||||||
|
LOG(LogInfo) << "Disabling VSync...";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void swapBuffers()
|
void swapBuffers()
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ namespace Renderer
|
||||||
LOG(LogInfo) << "GL renderer: " << renderer;
|
LOG(LogInfo) << "GL renderer: " << renderer;
|
||||||
LOG(LogInfo) << "GL version: " << version;
|
LOG(LogInfo) << "GL version: " << version;
|
||||||
LOG(LogInfo) << "EmulationStation renderer: OpenGL ES 1.0";
|
LOG(LogInfo) << "EmulationStation renderer: OpenGL ES 1.0";
|
||||||
LOG(LogInfo) << "Checking available OpenGL extensions...";
|
LOG(LogInfo) << "Checking available OpenGL ES extensions...";
|
||||||
std::string glExts = glGetString(GL_EXTENSIONS) ?
|
std::string glExts = glGetString(GL_EXTENSIONS) ?
|
||||||
reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)) : "";
|
reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)) : "";
|
||||||
LOG(LogInfo) << "GL_OES_texture_npot: " <<
|
LOG(LogInfo) << "GL_OES_texture_npot: " <<
|
||||||
|
|
@ -240,21 +240,19 @@ namespace Renderer
|
||||||
|
|
||||||
void setSwapInterval()
|
void setSwapInterval()
|
||||||
{
|
{
|
||||||
// vsync.
|
|
||||||
if (Settings::getInstance()->getBool("VSync")) {
|
if (Settings::getInstance()->getBool("VSync")) {
|
||||||
// SDL_GL_SetSwapInterval(0) for immediate updates (no vsync, default),
|
// Adaptive VSync seems to be nonfunctional or having issues on some hardware
|
||||||
// 1 for updates synchronized with the vertical retrace,
|
// and drivers, so only attempt to apply regular VSync.
|
||||||
// or -1 for late swap tearing.
|
if (SDL_GL_SetSwapInterval(1) == 0) {
|
||||||
// SDL_GL_SetSwapInterval returns 0 on success, -1 on error.
|
LOG(LogInfo) << "Enabling VSync...";
|
||||||
// if vsync is requested, try normal vsync; if that doesn't work, try late swap tearing
|
}
|
||||||
// if that doesn't work, report an error.
|
else {
|
||||||
if (SDL_GL_SetSwapInterval(1) != 0 && SDL_GL_SetSwapInterval(-1) != 0) {
|
LOG(LogWarning) << "Could not enable VSync: " << SDL_GetError();
|
||||||
LOG(LogWarning) << "Tried to enable vsync, but it failed. (" <<
|
|
||||||
SDL_GetError() << ")";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SDL_GL_SetSwapInterval(0);
|
SDL_GL_SetSwapInterval(0);
|
||||||
|
LOG(LogInfo) << "Disabling VSync...";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue