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