Fixed bug 1591 - Renderer maximum texture size is incorrect when GL_ARB_texture_rectangle is active
authorSam Lantinga <slouken@libsdl.org>
Sun, 23 Sep 2012 01:50:35 -0700
changeset 6449 fa00544b1374
parent 6448 64a6297a8b93
child 6450 cf62de5b978f
Fixed bug 1591 - Renderer maximum texture size is incorrect when GL_ARB_texture_rectangle is active
src/render/opengl/SDL_render_gl.c
--- a/src/render/opengl/SDL_render_gl.c	Sun Sep 23 01:37:44 2012 -0700
+++ b/src/render/opengl/SDL_render_gl.c	Sun Sep 23 01:50:35 2012 -0700
@@ -361,14 +361,16 @@
         renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
     }
 
-    data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
-    renderer->info.max_texture_width = value;
-    data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
-    renderer->info.max_texture_height = value;
-
     if (SDL_GL_ExtensionSupported("GL_ARB_texture_rectangle")
         || SDL_GL_ExtensionSupported("GL_EXT_texture_rectangle")) {
         data->GL_ARB_texture_rectangle_supported = SDL_TRUE;
+        data->glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB, &value);
+        renderer->info.max_texture_width = value;
+        renderer->info.max_texture_height = value;
+    } else {
+        data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
+        renderer->info.max_texture_width = value;
+        renderer->info.max_texture_height = value;
     }
 
     /* Check for multitexture support */