-
Notifications
You must be signed in to change notification settings - Fork 0
/
Texture.h
executable file
·49 lines (40 loc) · 1.39 KB
/
Texture.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
43
44
45
46
47
48
49
//#ifndef __TGA_HEADER__
//#define __TGA_HEADER__
//#include "MainHeader.h"
//#include "TextureHeader.h"
//#include <windows.h>
//#include <windowsx.h>
#include <stdlib.h>
#include <stdio.h>
//#include <GL/glew.h>
#include <GL/glut.h>
//#include "gl.h"
#include <math.h>
typedef struct
{
GLubyte * imageData; // Image Data (Up To 32 Bits)
GLuint bpp; // Image Color Depth In Bits Per Pixel
GLuint width; // Image Width
GLuint height; // Image Height
GLuint texID; // Texture ID Used To Select A Texture
GLuint type; // Image Type (GL_RGB, GL_RGBA)
} Texture;
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;
bool LoadTGA(Texture * texture, char * filename);
bool LoadCompressedTGA(Texture * texture, char * filename, FILE * fTGA);
bool LoadUncompressedTGA(Texture * texture, char * filename, FILE * fTGA);
//#endif