Only use power-of-two texture on OpenGL-ES, as newer OpenGL standards allow non-power...
authorIngo Ruhnke <grumbel@gmx.de>
Fri, 20 Nov 2009 19:47:13 +0000 (19:47 +0000)
committerIngo Ruhnke <grumbel@gmx.de>
Fri, 20 Nov 2009 19:47:13 +0000 (19:47 +0000)
SVN-Revision: 6070

src/video/gl/gl_texture.cpp

index b0ce080..ec20565 100644 (file)
@@ -41,8 +41,10 @@ GLTexture::GLTexture(unsigned int width, unsigned int height) :
   image_width(),
   image_height()
 {
+#ifdef GL_VERSION_ES_CM_1_0
   assert(is_power_of_2(width));
   assert(is_power_of_2(height));
+#endif
   texture_width  = width;
   texture_height = height;
   image_width  = width;
@@ -71,9 +73,15 @@ GLTexture::GLTexture(SDL_Surface* image) :
   image_width(),
   image_height()
 {
+#ifdef GL_VERSION_ES_CM_1_0
   texture_width = next_power_of_two(image->w);
   texture_height = next_power_of_two(image->h);
-  image_width = image->w;
+#else
+  texture_width  = image->w;
+  texture_height = image->h;
+#endif
+
+  image_width  = image->w;
   image_height = image->h;
 
 #if SDL_BYTEORDER == SDL_BIG_ENDIAN