mirror of
https://github.com/glest/glest-source.git
synced 2025-08-20 23:21:19 +02:00
- updated texture gl errors to include glu error text
This commit is contained in:
@@ -717,8 +717,9 @@ void Texture1DGl::init(Filter filter, int maxAnisotropy) {
|
|||||||
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
|
|
||||||
int error= gluBuild1DMipmaps(
|
int error= gluBuild1DMipmaps(
|
||||||
|
GL_TEXTURE_1D, glCompressionFormat, pixmap.getW(),
|
||||||
glFormat, GL_UNSIGNED_BYTE, pixels);
|
glFormat, GL_UNSIGNED_BYTE, pixels);
|
||||||
glFormat, GL_UNSIGNED_BYTE, pixels);
|
|
||||||
// Now try without compression if we tried compression
|
// Now try without compression if we tried compression
|
||||||
if(error != 0 && glCompressionFormat != glInternalFormat) {
|
if(error != 0 && glCompressionFormat != glInternalFormat) {
|
||||||
int error2= gluBuild1DMipmaps(
|
int error2= gluBuild1DMipmaps(
|
||||||
@@ -749,8 +750,9 @@ void Texture1DGl::init(Filter filter, int maxAnisotropy) {
|
|||||||
0, glFormat, GL_UNSIGNED_BYTE, pixels);
|
0, glFormat, GL_UNSIGNED_BYTE, pixels);
|
||||||
|
|
||||||
GLint error= glGetError();
|
GLint error= glGetError();
|
||||||
|
|
||||||
// Now try without compression if we tried compression
|
// Now try without compression if we tried compression
|
||||||
// Now try without compression if we tried compression
|
if(error != GL_NO_ERROR && glCompressionFormat != glInternalFormat) {
|
||||||
glTexImage1D(
|
glTexImage1D(
|
||||||
GL_TEXTURE_1D, 0, glInternalFormat, pixmap.getW(),
|
GL_TEXTURE_1D, 0, glInternalFormat, pixmap.getW(),
|
||||||
0, glFormat, GL_UNSIGNED_BYTE, pixels);
|
0, glFormat, GL_UNSIGNED_BYTE, pixels);
|
||||||
@@ -870,11 +872,11 @@ void Texture2DGl::init(Filter filter, int maxAnisotropy) {
|
|||||||
pixmap.getW(), pixmap.getH(),
|
pixmap.getW(), pixmap.getH(),
|
||||||
glFormat, GL_UNSIGNED_BYTE, pixels);
|
glFormat, GL_UNSIGNED_BYTE, pixels);
|
||||||
if(error3 == GL_NO_ERROR) {
|
if(error3 == GL_NO_ERROR) {
|
||||||
|
error = GL_NO_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(error != GL_NO_ERROR) {
|
if(error != GL_NO_ERROR) {
|
||||||
int error4= gluBuild2DMipmaps(
|
int error4= gluBuild2DMipmaps(
|
||||||
int error4= gluBuild2DMipmaps(
|
|
||||||
GL_TEXTURE_2D, glInternalFormat,
|
GL_TEXTURE_2D, glInternalFormat,
|
||||||
pixmap.getW(), pixmap.getH(),
|
pixmap.getW(), pixmap.getH(),
|
||||||
glFormat, GL_UNSIGNED_BYTE, pixels);
|
glFormat, GL_UNSIGNED_BYTE, pixels);
|
||||||
@@ -915,8 +917,9 @@ void Texture2DGl::init(Filter filter, int maxAnisotropy) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, glInternalFormat, pot(pixmap.getW()),
|
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);
|
glFormat, GL_UNSIGNED_BYTE, pixels);
|
||||||
|
|
||||||
GLint error3= glGetError();
|
GLint error3= glGetError();
|
||||||
@@ -1007,8 +1010,9 @@ void Texture3DGl::init(Filter filter, int maxAnisotropy) {
|
|||||||
|
|
||||||
GLint error= glGetError();
|
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) {
|
||||||
if(error != GL_NO_ERROR && glCompressionFormat != glInternalFormat) {
|
glTexImage3D(
|
||||||
GL_TEXTURE_3D, 0, glInternalFormat,
|
GL_TEXTURE_3D, 0, glInternalFormat,
|
||||||
pixmap.getW(), pixmap.getH(), pixmap.getD(),
|
pixmap.getW(), pixmap.getH(), pixmap.getD(),
|
||||||
0, glFormat, GL_UNSIGNED_BYTE, pixels);
|
0, glFormat, GL_UNSIGNED_BYTE, pixels);
|
||||||
@@ -1139,11 +1143,11 @@ void TextureCubeGl::init(Filter filter, int maxAnisotropy) {
|
|||||||
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) {
|
||||||
if(error != GL_NO_ERROR) {
|
int error4= gluBuild2DMipmaps(
|
||||||
target, glInternalFormat,
|
target, glInternalFormat,
|
||||||
currentPixmap->getW(), currentPixmap->getH(),
|
currentPixmap->getW(), currentPixmap->getH(),
|
||||||
currentPixmap->getW(), currentPixmap->getH(),
|
|
||||||
glFormat, GL_UNSIGNED_BYTE, pixels);
|
glFormat, GL_UNSIGNED_BYTE, pixels);
|
||||||
|
|
||||||
|
|
||||||
@@ -1183,8 +1187,9 @@ void TextureCubeGl::init(Filter filter, int maxAnisotropy) {
|
|||||||
error = GL_NO_ERROR;
|
error = GL_NO_ERROR;
|
||||||
}
|
}
|
||||||
else {
|
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);
|
||||||
pot(currentPixmap->getH()), 0, glFormat, GL_UNSIGNED_BYTE, NULL);
|
|
||||||
glTexSubImage2D(target, 0, 0, 0, currentPixmap->getW(), currentPixmap->getH(),
|
glTexSubImage2D(target, 0, 0, 0, currentPixmap->getW(), currentPixmap->getH(),
|
||||||
glFormat, GL_UNSIGNED_BYTE, pixels);
|
glFormat, GL_UNSIGNED_BYTE, pixels);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user