mirror of
https://github.com/glest/glest-source.git
synced 2025-08-20 07:01:21 +02:00
- 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:
@@ -852,10 +852,8 @@ void Texture2DGl::init(Filter filter, int maxAnisotropy) {
|
||||
glFormat, GL_UNSIGNED_BYTE, pixels);
|
||||
*/
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, glCompressionFormat,
|
||||
pixmap.getW(), pixmap.getH(), 0,
|
||||
glFormat, GL_UNSIGNED_BYTE, pixels);
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, glCompressionFormat,
|
||||
pixmap.getW(), pixmap.getH(), 0,
|
||||
glFormat, GL_UNSIGNED_BYTE, pixels);
|
||||
|
||||
GLint error= glGetError();
|
||||
@@ -864,7 +862,7 @@ void Texture2DGl::init(Filter filter, int maxAnisotropy) {
|
||||
if(error != GL_NO_ERROR && glCompressionFormat != glInternalFormat) {
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, glInternalFormat,
|
||||
pixmap.getW(), pixmap.getH(), 0,
|
||||
GLint error2= glGetError();
|
||||
glFormat, GL_UNSIGNED_BYTE, pixels);
|
||||
|
||||
GLint error2= glGetError();
|
||||
|
||||
@@ -1109,7 +1107,8 @@ void TextureCubeGl::init(Filter filter, int maxAnisotropy) {
|
||||
*/
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
|
||||
|
||||
glTexImage2D(target, 0, glCompressionFormat,
|
||||
glTexImage2D(target, 0, glCompressionFormat,
|
||||
currentPixmap->getW(), currentPixmap->getH(), 0,
|
||||
glFormat, GL_UNSIGNED_BYTE, pixels);
|
||||
|
||||
int error = glGetError();
|
||||
@@ -1120,7 +1119,7 @@ void TextureCubeGl::init(Filter filter, int maxAnisotropy) {
|
||||
currentPixmap->getW(), currentPixmap->getH(), 0,
|
||||
glFormat, GL_UNSIGNED_BYTE, pixels);
|
||||
|
||||
|
||||
GLint error2= glGetError();
|
||||
|
||||
if(error2 == GL_NO_ERROR) {
|
||||
error = GL_NO_ERROR;
|
||||
|
Reference in New Issue
Block a user