From b0cc9c9c318e8ca62075a261ae13a61d3044fadb Mon Sep 17 00:00:00 2001 From: grumbel Date: Fri, 20 Nov 2009 19:47:13 +0000 Subject: [PATCH] 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) git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6070 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- src/video/gl/gl_texture.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 2.11.0