summaryrefslogtreecommitdiffstats
path: root/sdl/gltools.h
blob: 61001d2fb3b8edc73c7dd78882aea8dc97c6ebad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef _GLTOOLS_H_
#define _GLTOOLS_H_

/* this is the targa header, pragmas are needed to do the voodoo magic */
/* http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/ */
#pragma pack(1)
typedef struct
{
    GLbyte identsize;   /* Size of id field that follows header (0) */
    GLbyte imageType;   /* 0 = none, 1 = indexed, 2 = rgb, 3 = grey, +8 = rle */
    GLbyte colorMapType;           /* 0 = none, 1 = paletted */
    unsigned short colorMapStart;  /* first colour map entry */
    unsigned short colorMapLength; /* number of colors */
    unsigned char colorMapBits;    /* bits per palette entry */
    unsigned short xstart;         /* image x origin */
    unsigned short ystart;         /* image y origin */
    unsigned short width;          /* width in pixels */
    unsigned short height;         /* height in pixels */
    GLbyte bits;                   /* bits per pixel (8 16, 24, 32) */
    GLbyte descriptor;             /* image descriptor */
} TGAHEADER;
#pragma pack(1)

/* function prototypes */
GLint gltWriteTGA(const char *);
GLbyte *gltLoadTGA(const char *, GLint *, GLint *, GLint *, GLenum *);
void gltDrawTriangle(void);
void gltDrawGround(void);
void gltDrawUnitAxes(void);
void gltDrawTorus(GLfloat, GLfloat, GLint, GLint);
void gltDrawJet(void);

#endif