From: Ingo Ruhnke Date: Fri, 20 Nov 2009 19:47:13 +0000 (+0000) Subject: Only use power-of-two texture on OpenGL-ES, as newer OpenGL standards allow non-power... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=0580ae7f293d918b0b0ffe691f6b6bf0a5a8ee94;p=supertux.git Only use power-of-two texture on OpenGL-ES, as newer OpenGL standards allow non-power-of-two textures (fixes some blending artifacts, but not all) SVN-Revision: 6070 --- diff --git a/src/video/gl/gl_texture.cpp b/src/video/gl/gl_texture.cpp index b0ce080f8..ec20565b3 100644 --- a/src/video/gl/gl_texture.cpp +++ b/src/video/gl/gl_texture.cpp @@ -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