- updated texture gl errors to include glu error text

This commit is contained in:
Mark Vejvoda
2011-04-28 00:51:39 +00:00
parent c747a7c037
commit 95dcd042a3

View File

@@ -717,8 +717,9 @@ void Texture1DGl::init(Filter filter, int maxAnisotropy) {
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
int error= gluBuild1DMipmaps(
GL_TEXTURE_1D, glCompressionFormat, pixmap.getW(),
glFormat, GL_UNSIGNED_BYTE, pixels);
glFormat, GL_UNSIGNED_BYTE, pixels);
// Now try without compression if we tried compression
if(error != 0 && glCompressionFormat != glInternalFormat) {
int error2= gluBuild1DMipmaps(
@@ -749,8 +750,9 @@ void Texture1DGl::init(Filter filter, int maxAnisotropy) {
0, glFormat, GL_UNSIGNED_BYTE, pixels);
GLint error= glGetError();
// Now try without compression if we tried compression
// Now try without compression if we tried compression
if(error != GL_NO_ERROR && glCompressionFormat != glInternalFormat) {
glTexImage1D(
GL_TEXTURE_1D, 0, glInternalFormat, pixmap.getW(),
0, glFormat, GL_UNSIGNED_BYTE, pixels);
@@ -870,11 +872,11 @@ void Texture2DGl::init(Filter filter, int maxAnisotropy) {
pixmap.getW(), pixmap.getH(),
glFormat, GL_UNSIGNED_BYTE, pixels);
if(error3 == GL_NO_ERROR) {
error = GL_NO_ERROR;
}
}
}
if(error != GL_NO_ERROR) {
int error4= gluBuild2DMipmaps(
int error4= gluBuild2DMipmaps(
GL_TEXTURE_2D, glInternalFormat,
pixmap.getW(), pixmap.getH(),
glFormat, GL_UNSIGNED_BYTE, pixels);
@@ -915,8 +917,9 @@ void Texture2DGl::init(Filter filter, int maxAnisotropy) {
}
else {
glTexImage2D(GL_TEXTURE_2D, 0, glInternalFormat, pot(pixmap.getW()),
pot(pixmap.getH()), 0, glFormat, GL_UNSIGNED_BYTE, NULL);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, pixmap.getW(), pixmap.getH(),
glFormat, GL_UNSIGNED_BYTE, pixels);
GLint error3= glGetError();
@@ -1007,8 +1010,9 @@ void Texture3DGl::init(Filter filter, int maxAnisotropy) {
GLint error= glGetError();
// Now try without compression if we tried compression
if(error != GL_NO_ERROR && glCompressionFormat != glInternalFormat) {
if(error != GL_NO_ERROR && glCompressionFormat != glInternalFormat) {
glTexImage3D(
GL_TEXTURE_3D, 0, glInternalFormat,
pixmap.getW(), pixmap.getH(), pixmap.getD(),
0, glFormat, GL_UNSIGNED_BYTE, pixels);
@@ -1139,11 +1143,11 @@ void TextureCubeGl::init(Filter filter, int maxAnisotropy) {
if(error3 == GL_NO_ERROR) {
error = GL_NO_ERROR;
}
}
if(error != GL_NO_ERROR) {
if(error != GL_NO_ERROR) {
int error4= gluBuild2DMipmaps(
target, glInternalFormat,
currentPixmap->getW(), currentPixmap->getH(),
currentPixmap->getW(), currentPixmap->getH(),
glFormat, GL_UNSIGNED_BYTE, pixels);
@@ -1183,8 +1187,9 @@ void TextureCubeGl::init(Filter filter, int maxAnisotropy) {
error = GL_NO_ERROR;
}
else {
glTexImage2D(target, 0, glInternalFormat, pot(currentPixmap->getW()),
pot(currentPixmap->getH()), 0, glFormat, GL_UNSIGNED_BYTE, NULL);
pot(currentPixmap->getH()), 0, glFormat, GL_UNSIGNED_BYTE, NULL);
glTexSubImage2D(target, 0, 0, 0, currentPixmap->getW(), currentPixmap->getH(),
glFormat, GL_UNSIGNED_BYTE, pixels);