mirror of
https://github.com/glest/glest-source.git
synced 2025-08-19 22:51:24 +02:00
- add more texture fallback code in case api calls fail
This commit is contained in:
@@ -856,6 +856,15 @@ void Texture2DGl::init(Filter filter, int maxAnisotropy) {
|
|||||||
if(error != GL_NO_ERROR && glCompressionFormat != glInternalFormat) {
|
if(error != GL_NO_ERROR && glCompressionFormat != glInternalFormat) {
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, glInternalFormat,
|
glTexImage2D(GL_TEXTURE_2D, 0, glInternalFormat,
|
||||||
pixmap.getW(), pixmap.getH(), 0,
|
pixmap.getW(), pixmap.getH(), 0,
|
||||||
|
glFormat, GL_UNSIGNED_BYTE, pixels);
|
||||||
|
|
||||||
|
GLint error2= glGetError();
|
||||||
|
|
||||||
|
if(error2 == GL_NO_ERROR) {
|
||||||
|
error = GL_NO_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(error != GL_NO_ERROR) {
|
||||||
int error3= gluBuild2DMipmaps(
|
int error3= gluBuild2DMipmaps(
|
||||||
GL_TEXTURE_2D, glCompressionFormat,
|
GL_TEXTURE_2D, glCompressionFormat,
|
||||||
pixmap.getW(), pixmap.getH(),
|
pixmap.getW(), pixmap.getH(),
|
||||||
@@ -1114,6 +1123,17 @@ void TextureCubeGl::init(Filter filter, int maxAnisotropy) {
|
|||||||
currentPixmap->getW(), currentPixmap->getH(), 0,
|
currentPixmap->getW(), currentPixmap->getH(), 0,
|
||||||
glFormat, GL_UNSIGNED_BYTE, pixels);
|
glFormat, GL_UNSIGNED_BYTE, pixels);
|
||||||
|
|
||||||
|
GLint error2= glGetError();
|
||||||
|
|
||||||
|
if(error2 == GL_NO_ERROR) {
|
||||||
|
error = GL_NO_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(error != GL_NO_ERROR) {
|
||||||
|
int error3= gluBuild2DMipmaps(
|
||||||
|
target, glCompressionFormat,
|
||||||
|
currentPixmap->getW(), currentPixmap->getH(),
|
||||||
|
glFormat, GL_UNSIGNED_BYTE, pixels);
|
||||||
|
|
||||||
|
|
||||||
if(error3 == GL_NO_ERROR) {
|
if(error3 == GL_NO_ERROR) {
|
||||||
|
Reference in New Issue
Block a user