]> git.lizzy.rs Git - shadowclad.git/blob - tga.h
Refactor handling of imported assets a bit
[shadowclad.git] / tga.h
1 #ifndef TGA_H_
2 #define TGA_H_
3
4 #include <GL/gl.h>
5
6 #pragma pack(push, 1)
7 typedef struct {
8         GLubyte idLength;
9         GLbyte colorMapType;
10         GLbyte imageType;
11         GLushort colorMapStart;
12         GLushort colorMapLength;
13         GLubyte colorMapBpp;
14         GLushort originX;
15         GLushort originY;
16         GLushort imageWidth;
17         GLushort imageHeight;
18         GLubyte imageBpp;
19         GLbyte imageDescriptor;
20 } TgaHeader;
21 #pragma pack(pop)
22
23 typedef struct {
24         TgaHeader header;
25         GLenum imageFormat;
26         GLint imageComponents;
27         GLbyte* bytes;
28 } TgaImage;
29
30 TgaImage* readTga(const char* path);
31
32 #endif