View Full Version : Texture files
08-18-2003, 10:55 AM
Hi, I was wondering what the easiest file format to load for textures is? I Do not want source code but to attempt this from first principles, and was wondering if any one could offer advice.
I have already had a look at a few file formats at wotsit.org, but tiff and jpg seem to difficult for me to load. Any suggestions for an easier format?
TGA is a very good format and it's very easy to read too. If you're a beginner in programming, I suggest you go for uncompressed TGAs and forget about compression for now. Compressed TGAs are not that difficult, but requires some programming experience to implement.
Rob The Bloke
08-18-2003, 12:47 PM
Be careful of LSB / MSB ordering when reading binary data. If you're working on Intel PC's this shouldn't be a problem, though if on MAC you may have to switch bytes....
The tga file format is definately the easiest, as bob said, uncompressed is the way to go for ease of implimentation.
check out www.wotsit.org (http://www.wotsit.org) for the file format spec
A common error is to construct a TGA header structure that does not align to 18 bytes. Be careful if trying to read the header into a structure and ensure that the structure's size is actually 18 bytes.
If sizeof() returns anything greater than 18, then you will need to add the line
to force 1 byte alignment of data.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.