From 0580ae7f293d918b0b0ffe691f6b6bf0a5a8ee94 Mon Sep 17 00:00:00 2001 From: Ingo Ruhnke 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) SVN-Revision: 6070 --- 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