Sign in to follow this  

Lesson 24 Help

This topic is 3459 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites

This topic is 3459 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this