-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tgal.h
48 lines (29 loc) · 1.24 KB
/
Tgal.h
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
35
36
37
38
39
40
41
42
#ifndef __TGAL_H__
#define __TGAL_H__
//#pragma comment(lib, "Opengl32.lib") //Link to OpenGL32.lib so we can use OpenGL stuff
#include <windows.h> // Standard windows header
#include <stdio.h> // Standard I/O header
#include <gl\gl.h> // Header for OpenGL32 library
#include "texture.h"
typedef struct
{
GLubyte Header[12]; // TGA File Header
} TGAHeader;
typedef struct
{
GLubyte header[6]; // First 6 Useful Bytes From The Header
GLuint bytesPerPixel; // Holds Number Of Bytes Per Pixel Used In The TGA File
GLuint imageSize; // Used To Store The Image Size When Setting Aside Ram
GLuint temp; // Temporary Variable
GLuint type;
GLuint Height; //Height of Image
GLuint Width; //Width ofImage
GLuint Bpp; // Bits Per Pixel
} TGA;
TGAHeader tgaheader; // TGA header
TGA tga; // TGA image data
GLubyte uTGAcompare[12] = {0,0,2, 0,0,0,0,0,0,0,0,0}; // Uncompressed TGA Header
GLubyte cTGAcompare[12] = {0,0,10,0,0,0,0,0,0,0,0,0}; // Compressed TGA Header
bool LoadUncompressedTGA(Texture *, char *, FILE *); // Load an Uncompressed file
bool LoadCompressedTGA(Texture *, char *, FILE *); // Load a Compressed file
#endif