1 | #ifndef __TGA_h_ |
---|
2 | #define __TGA_h_ |
---|
3 | |
---|
4 | #include "GL/glut.h" |
---|
5 | |
---|
6 | // Define targa header. |
---|
7 | #pragma pack(1) |
---|
8 | typedef struct |
---|
9 | { |
---|
10 | GLbyte identsize; // Size of ID field that follows header (0) |
---|
11 | GLbyte colorMapType; // 0 = None, 1 = paletted |
---|
12 | GLbyte imageType; // 0 = none, 1 = indexed, 2 = rgb, 3 = grey, +8=rle |
---|
13 | unsigned short colorMapStart; // First colour map entry |
---|
14 | unsigned short colorMapLength; // Number of colors |
---|
15 | unsigned char colorMapBits; // bits per palette entry |
---|
16 | unsigned short xstart; // image x origin |
---|
17 | unsigned short ystart; // image y origin |
---|
18 | unsigned short width; // width in pixels |
---|
19 | unsigned short height; // height in pixels |
---|
20 | GLbyte bits; // bits per pixel (8 16, 24, 32) |
---|
21 | GLbyte descriptor; // image descriptor |
---|
22 | } TGAHEADER; |
---|
23 | #pragma pack(8) |
---|
24 | |
---|
25 | ///////////////////////////////////////////////////////////////////////////////////// |
---|
26 | // Functions, need to be linked to your program. Source file for function is given |
---|
27 | // LoadTGA.c |
---|
28 | extern GLbyte *gltLoadTGA(const char *szFileName, GLint *iWidth, |
---|
29 | GLint *iHeight, GLint *iComponents, GLenum *eFormat); |
---|
30 | ///////////////////////////////////////////////////////////////////////////////////// |
---|
31 | // Functions, need to be linked to your program. Source file for function is given |
---|
32 | // WriteTGA.c |
---|
33 | extern GLint gltWriteTGA(const char *szFileName); |
---|
34 | |
---|
35 | #endif |
---|