why TGA?

Moderator
Posts: 102
Joined: 2003.07
Post: #1
why is it better to use TGAs as opposed to other file formats (e.g. jpg, png, bmp, etc...) as of right now Blaster Master uses jpgs and I noticed that the image quality is... well... not what I want. so if somebody could tell me of a file format that would improve image quality and point me to an example loader function I would much appreciate it Smile

-CarbonX
Quote this message in a reply
Member
Posts: 156
Joined: 2002.11
Post: #2
There was quite a long discusson on an older thread about using TGA vs PNG. Basically, everyone I know is moving to PNG. It's a lossless format that eats up significantly less disk space than TGAs, and it also comes with alpha channel data, so you can use transparencies in your textures.

If you need an example of how to load PNG, JPG, or even TGA images from disk with CoreGraphics, and generate textures from them, check out the source code (400 kb) from: http://webpages.charter.net/utopiaplanet...Struct.dmg

Just replace malloc by calloc there. I haven't got the chance to upload the updated version.
Quote this message in a reply
Member
Posts: 304
Joined: 2002.04
Post: #3
Because many of the NeHe tutorials use TGA and a lot of us learned OGL from NeHe. Because the TGA file format is very simple so it takes only a small amount of c code to read it without having to depend on any system-specific or external libraries - and so your code will be very easy to port to Linux and Win.
Quote this message in a reply
Moderator
Posts: 102
Joined: 2003.07
Post: #4
Thanks guys that helps alot Smile

-CarbonX
Quote this message in a reply
Post Reply