diff --git a/cogl/winsys/cogl-winsys-sdl.c b/cogl/winsys/cogl-winsys-sdl.c index 9d279840f..95d5ab909 100644 --- a/cogl/winsys/cogl-winsys-sdl.c +++ b/cogl/winsys/cogl-winsys-sdl.c @@ -134,8 +134,9 @@ set_gl_attribs_from_framebuffer_config (CoglFramebufferConfig *config) SDL_GL_SetAttribute (SDL_GL_STENCIL_SIZE, config->need_stencil ? 1 : 0); - SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, - config->swap_chain->length > 1 ? 1 : 0); + if (config->swap_chain->length >= 0) + SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, + config->swap_chain->length > 1 ? 1 : 0); SDL_GL_SetAttribute (SDL_GL_ALPHA_SIZE, config->swap_chain->has_alpha ? 1 : 0); diff --git a/cogl/winsys/cogl-winsys-sdl2.c b/cogl/winsys/cogl-winsys-sdl2.c index f9b94e97e..8ea5919b1 100644 --- a/cogl/winsys/cogl-winsys-sdl2.c +++ b/cogl/winsys/cogl-winsys-sdl2.c @@ -130,8 +130,9 @@ set_gl_attribs_from_framebuffer_config (CoglFramebufferConfig *config) SDL_GL_SetAttribute (SDL_GL_STENCIL_SIZE, config->need_stencil ? 1 : 0); - SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, - config->swap_chain->length > 1 ? 1 : 0); + if (config->swap_chain->length >= 0) + SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, + config->swap_chain->length > 1 ? 1 : 0); SDL_GL_SetAttribute (SDL_GL_ALPHA_SIZE, config->swap_chain->has_alpha ? 1 : 0);