Jump to content
  • Advertisement
Sign in to follow this  

Lesson 24 Help

This topic is 3802 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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!