Fixed OpenGL ES 1.1 on Android
authorSam Lantinga <slouken@libsdl.org>
Tue, 31 Jan 2012 21:03:35 -0500
changeset 6274 246cde9a6cf3
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
--- a/src/render/opengles/SDL_render_gles.c	Tue Jan 31 20:55:17 2012 -0500
+++ b/src/render/opengles/SDL_render_gles.c	Tue Jan 31 21:03:35 2012 -0500
@@ -349,8 +349,10 @@
     }
 #endif
 
+    value = 0;
     data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
     renderer->info.max_texture_width = value;
+    value = 0;
     data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
     renderer->info.max_texture_height = value;
 
@@ -358,6 +360,7 @@
         data->GL_OES_framebuffer_object_supported = SDL_TRUE;
         renderer->info.flags |= SDL_RENDERER_TARGETTEXTURE;
 
+        value = 0;
         data->glGetIntegerv(GL_FRAMEBUFFER_BINDING_OES, &value);
         data->window_framebuffer = (GLuint)value;
     }