- try to see if this fixes an opengl bug, by retrying texture loading using older opengl API if newer fails

This commit is contained in:
Mark Vejvoda 2011-04-05 21:16:53 +00:00
parent c196e1ccfc
commit 5ce6c17f7d
1 changed files with 18 additions and 19 deletions

View File

@ -852,19 +852,17 @@ void Texture2DGl::init(Filter filter, int maxAnisotropy) {
if(error2 == GL_NO_ERROR) { if(error2 == GL_NO_ERROR) {
error = GL_NO_ERROR; error = GL_NO_ERROR;
} }
else { }
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, glFilter); if(error != GL_NO_ERROR) {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); int error3= gluBuild2DMipmaps(
GL_TEXTURE_2D, glCompressionFormat,
int error3= gluBuild2DMipmaps( pixmap.getW(), pixmap.getH(),
GL_TEXTURE_2D, glCompressionFormat, glFormat, GL_UNSIGNED_BYTE, pixels);
pixmap.getW(), pixmap.getH(), if(error3 == GL_NO_ERROR) {
glFormat, GL_UNSIGNED_BYTE, pixels); error = GL_NO_ERROR;
if(error3 == GL_NO_ERROR) {
error = GL_NO_ERROR;
}
} }
} }
// //
if(error != GL_NO_ERROR) { if(error != GL_NO_ERROR) {
@ -1109,18 +1107,19 @@ void TextureCubeGl::init(Filter filter, int maxAnisotropy) {
if(error2 == GL_NO_ERROR) { if(error2 == GL_NO_ERROR) {
error = GL_NO_ERROR; error = GL_NO_ERROR;
} }
else { }
int error3= gluBuild2DMipmaps( if(error != GL_NO_ERROR) {
target, glCompressionFormat, int error3= gluBuild2DMipmaps(
currentPixmap->getW(), currentPixmap->getH(), target, glCompressionFormat,
glFormat, GL_UNSIGNED_BYTE, pixels); currentPixmap->getW(), currentPixmap->getH(),
glFormat, GL_UNSIGNED_BYTE, pixels);
if(error3 == GL_NO_ERROR) { if(error3 == GL_NO_ERROR) {
error = GL_NO_ERROR; error = GL_NO_ERROR;
}
} }
} }
// //
if(error != GL_NO_ERROR) { if(error != GL_NO_ERROR) {