Skip to content

Commit

Permalink
iOS SDL_GL_CreateContext: Clamp the multisample sample count when the…
Browse files Browse the repository at this point in the history
… requested value is too high, rather than failing to create the context.

This matches the SDL_GL_CreateContext behavior in OS X.
  • Loading branch information
slime73 committed Sep 15, 2015
1 parent a506f1c commit ecfdb10
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/video/uikit/SDL_uikitopenglview.m
Expand Up @@ -88,12 +88,8 @@ - (instancetype)initWithFrame:(CGRect)frame
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) {
Expand Down

0 comments on commit ecfdb10

Please sign in to comment.