ecere/gfx/drivers/OpenGL: Fixed support for textures with width/height ratio > 2
authorJerome St-Louis <jerome@ecere.com>
Tue, 8 Apr 2014 19:05:33 +0000 (15:05 -0400)
committerJerome St-Louis <jerome@ecere.com>
Tue, 8 Apr 2014 19:05:33 +0000 (15:05 -0400)
ecere/src/gfx/drivers/OpenGLDisplayDriver.ec

index 6715480..0f983e7 100644 (file)
@@ -2321,6 +2321,9 @@ class OpenGLDisplayDriver : DisplayDriver
          w = Min(w, oglSystem.maxTextureSize);
          h = Min(h, oglSystem.maxTextureSize);
 
+         if(w * 2 < h) w = h / 2;
+         else if(h * 2 < w) h = w / 2;
+
          // Switch ARGB to RGBA
          //if(bitmap.format != pixelFormatRGBA)
          {