- add more texture fallback code in case api calls fail

This commit is contained in:
Mark Vejvoda 2011-04-27 23:31:56 +00:00
parent 508be10d15
commit 3f09541ab3
1 changed files with 20 additions and 0 deletions

View File

@ -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;
}
}
//