From ecfdb10cfa4710603b2de9359bf31a2c74c76219 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Tue, 15 Sep 2015 00:25:07 -0300 Subject: [PATCH] iOS SDL_GL_CreateContext: Clamp the multisample sample count when the requested value is too high, rather than failing to create the context. This matches the SDL_GL_CreateContext behavior in OS X. --- src/video/uikit/SDL_uikitopenglview.m | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/video/uikit/SDL_uikitopenglview.m b/src/video/uikit/SDL_uikitopenglview.m index 5b8e9cc38..acfdb28f8 100644 --- a/src/video/uikit/SDL_uikitopenglview.m +++ b/src/video/uikit/SDL_uikitopenglview.m @@ -88,12 +88,8 @@ GLint maxsamples = 0; glGetIntegerv(GL_MAX_SAMPLES, &maxsamples); - /* Verify that the sample count is supported before creating any - * multisample Renderbuffers, to avoid generating GL errors. */ - if (samples > maxsamples) { - SDL_SetError("Failed creating OpenGL ES framebuffer: Unsupported MSAA sample count"); - return nil; - } + /* Clamp the samples to the max supported count. */ + samples = MIN(samples, maxsamples); } if (sRGB) {