Bugfix for win32 loading jpg texture's

This commit is contained in:
Mark Vejvoda
2010-04-09 06:51:13 +00:00
parent d61e7cd4c3
commit 06b21ca4ee
6 changed files with 70 additions and 13 deletions

View File

@@ -137,7 +137,10 @@ void Texture1DGl::init(Filter filter, int maxAnisotropy){
glFormat, GL_UNSIGNED_BYTE, pixels);
if(error!=0){
throw runtime_error("Error building texture 1D mipmaps");
//throw runtime_error("Error building texture 1D mipmaps");
char szBuf[1024]="";
sprintf(szBuf,"Error building texture 1D mipmaps, returned: %d [%s] w = %d",error,pixmap.getPath().c_str(),pixmap.getW());
throw runtime_error(szBuf);
}
}
else{
@@ -151,7 +154,10 @@ void Texture1DGl::init(Filter filter, int maxAnisotropy){
GLint error= glGetError();
if(error!=GL_NO_ERROR){
throw runtime_error("Error creating texture 1D");
//throw runtime_error("Error creating texture 1D");
char szBuf[1024]="";
sprintf(szBuf,"Error creating texture 1D, returned: %d [%s] w = %d",error,pixmap.getPath().c_str(),pixmap.getW());
throw runtime_error(szBuf);
}
}
inited= true;
@@ -211,7 +217,10 @@ void Texture2DGl::init(Filter filter, int maxAnisotropy){
glFormat, GL_UNSIGNED_BYTE, pixels);
if(error!=0){
throw runtime_error("Error building texture 2D mipmaps");
//throw runtime_error("Error building texture 2D mipmaps");
char szBuf[1024]="";
sprintf(szBuf,"Error building texture 2D mipmaps, returned: %d [%s] w = %d, h = %d",error,pixmap.getPath().c_str(),pixmap.getW(),pixmap.getH());
throw runtime_error(szBuf);
}
}
else{
@@ -226,7 +235,9 @@ void Texture2DGl::init(Filter filter, int maxAnisotropy){
GLint error= glGetError();
if(error!=GL_NO_ERROR){
throw runtime_error("Error creating texture 2D");
char szBuf[1024]="";
sprintf(szBuf,"Error creating texture 2D, returned: %d [%s] w = %d, h = %d, glInternalFormat = %d, glFormat = %d",error,pixmap.getPath().c_str(),pixmap.getW(),pixmap.getH(),glInternalFormat,glFormat);
throw runtime_error(szBuf);
}
}
inited= true;
@@ -280,7 +291,10 @@ void Texture3DGl::init(Filter filter, int maxAnisotropy){
GLint error= glGetError();
if(error!=GL_NO_ERROR){
throw runtime_error("Error creating texture 3D");
//throw runtime_error("Error creating texture 3D");
char szBuf[1024]="";
sprintf(szBuf,"Error creating texture 3D, returned: %d [%s] w = %d, h = %d, d = %d",error,pixmap.getPath().c_str(),pixmap.getW(),pixmap.getH(),pixmap.getD());
throw runtime_error(szBuf);
}
inited= true;
}
@@ -343,7 +357,10 @@ void TextureCubeGl::init(Filter filter, int maxAnisotropy){
glFormat, GL_UNSIGNED_BYTE, pixels);
if(error!=0){
throw runtime_error("Error building texture cube mipmaps");
//throw runtime_error("Error building texture cube mipmaps");
char szBuf[1024]="";
sprintf(szBuf,"Error building texture cube mipmaps, returned: %d [%s] w = %d, h = %d",error,currentPixmap->getPath().c_str(),currentPixmap->getW(),currentPixmap->getH());
throw runtime_error(szBuf);
}
}
else{
@@ -353,8 +370,12 @@ void TextureCubeGl::init(Filter filter, int maxAnisotropy){
0, glFormat, GL_UNSIGNED_BYTE, pixels);
}
if(glGetError()!=GL_NO_ERROR){
throw runtime_error("Error creating texture cube");
int error = glGetError();
if(error!=GL_NO_ERROR){
//throw runtime_error("Error creating texture cube");
char szBuf[1024]="";
sprintf(szBuf,"Error creating texture cube, returned: %d [%s] w = %d, h = %d",error,currentPixmap->getPath().c_str(),currentPixmap->getW(),currentPixmap->getH());
throw runtime_error(szBuf);
}
}
inited= true;