Swap control only works with OpenGL

This commit is contained in:
Dan Elkouby 2018-12-15 11:22:38 +02:00
parent e2182bb00b
commit 6195422c66
1 changed files with 4 additions and 3 deletions

View File

@ -4566,8 +4566,8 @@ static bool
vsync_opengl_swc_init(session_t *ps) { vsync_opengl_swc_init(session_t *ps) {
#ifdef CONFIG_OPENGL #ifdef CONFIG_OPENGL
if (!bkend_use_glx(ps)) { if (!bkend_use_glx(ps)) {
printf_errf("(): I'm afraid OpenGL swap control wouldn't help if you are " printf_errf("(): OpenGL swap control requires the GLX backend.");
"not using GLX backend. You could try, nonetheless."); return false;
} }
if (!vsync_opengl_swc_swap_interval(ps, 1)) { if (!vsync_opengl_swc_swap_interval(ps, 1)) {
@ -4631,6 +4631,7 @@ vsync_opengl_swc_deinit(session_t *ps) {
bool bool
vsync_init(session_t *ps) { vsync_init(session_t *ps) {
// Mesa turns on swap control by default, undo that // Mesa turns on swap control by default, undo that
if (bkend_use_glx(ps))
vsync_opengl_swc_swap_interval(ps, 0); vsync_opengl_swc_swap_interval(ps, 0);
if (ps->o.vsync && VSYNC_FUNCS_INIT[ps->o.vsync] if (ps->o.vsync && VSYNC_FUNCS_INIT[ps->o.vsync]