From 3f09541ab346dcb58bb6002feb1a0e3cd0920c6d Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Wed, 27 Apr 2011 23:31:56 +0000 Subject: [PATCH] - add more texture fallback code in case api calls fail --- .../sources/graphics/gl/texture_gl.cpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/source/shared_lib/sources/graphics/gl/texture_gl.cpp b/source/shared_lib/sources/graphics/gl/texture_gl.cpp index 1f0db1b11..d5711dc63 100644 --- a/source/shared_lib/sources/graphics/gl/texture_gl.cpp +++ b/source/shared_lib/sources/graphics/gl/texture_gl.cpp @@ -856,6 +856,15 @@ void Texture2DGl::init(Filter filter, int maxAnisotropy) { error = GL_NO_ERROR; } } + if(error != GL_NO_ERROR) { + int error4= gluBuild2DMipmaps( + GL_TEXTURE_2D, glInternalFormat, + pixmap.getW(), pixmap.getH(), + glFormat, GL_UNSIGNED_BYTE, pixels); + if(error4 == GL_NO_ERROR) { + error = GL_NO_ERROR; + } + } // @@ -1114,6 +1123,17 @@ void TextureCubeGl::init(Filter filter, int maxAnisotropy) { error = GL_NO_ERROR; } } + if(error != GL_NO_ERROR) { + int error4= gluBuild2DMipmaps( + target, glInternalFormat, + currentPixmap->getW(), currentPixmap->getH(), + glFormat, GL_UNSIGNED_BYTE, pixels); + + + if(error4 == GL_NO_ERROR) { + error = GL_NO_ERROR; + } + } //