Fixed OpenGL ES 1.1 on Android
authorSam Lantinga
Tue, 31 Jan 2012 21:03:35 -0500
changeset 6274246cde9a6cf3
parent 6273 2fa7e0540f95
child 6275 963497e37d34
Fixed OpenGL ES 1.1 on Android

From Gabriel Jacobo:
What I did notice is that calling
data->glGetIntegerv(GL_FRAMEBUFFER_BINDING_OES, &value); doesn't produce any
result in Android GLES1.1 if the active framebuffer is the default one, ie,
whatever is in value stays unmodified.
src/render/opengles/SDL_render_gles.c
     1.1 --- a/src/render/opengles/SDL_render_gles.c	Tue Jan 31 20:55:17 2012 -0500
     1.2 +++ b/src/render/opengles/SDL_render_gles.c	Tue Jan 31 21:03:35 2012 -0500
     1.3 @@ -349,8 +349,10 @@
     1.4      }
     1.5  #endif
     1.6  
     1.7 +    value = 0;
     1.8      data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
     1.9      renderer->info.max_texture_width = value;
    1.10 +    value = 0;
    1.11      data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
    1.12      renderer->info.max_texture_height = value;
    1.13  
    1.14 @@ -358,6 +360,7 @@
    1.15          data->GL_OES_framebuffer_object_supported = SDL_TRUE;
    1.16          renderer->info.flags |= SDL_RENDERER_TARGETTEXTURE;
    1.17  
    1.18 +        value = 0;
    1.19          data->glGetIntegerv(GL_FRAMEBUFFER_BINDING_OES, &value);
    1.20          data->window_framebuffer = (GLuint)value;
    1.21      }