Lesson 24 Help
Lesson: 24 is about loading .tga's to use as textures. I haven't done any significant changes to the code. The only thing I did was add:
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, texture[0].width, texture[0].height, type, GL_UNSIGNED_BYTE, texture[0].imageData);
instead of:
glTexImage2D(GL_TEXTURE_2D, 0, type, texture[0].width, texture[0].height, 0, type, GL_UNSIGNED_BYTE, texture[0].imageData);
And since I don't have any .tga's, I've converted a couple .jpg's that I have to 32 bit .tga's, but when the code compares TGAheader with TGAcompare they end up being different.
I've done some testing, and header[4] does equal 32, but later on when it calls malloc(imageSize) and does the fread(texture->imageData, 1, imageSize, file), the fread does not equal imageSize.
For the .tga I tried it with, imageSize = 393216 bytes which = 384 kb, right? Well the file size of the .tga according to my computer is 380 kb. Any idea as to what's going wrong?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement