-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathctexture.h
39 lines (29 loc) · 804 Bytes
/
ctexture.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
#ifndef CTEXTURE_H
#define CTEXTURE_H
#include <vector>
#include <string>
using namespace std;
#include "SDL.h"
#include "SDL_opengl.h"
#define NO_SDL_GLEXT
#include "SDL_image.h"
#include "GL/gl.h"
#include "GL/glu.h"
#define PNG 0
#define JPG 1
#define BMP 2
#define TGA 3
class CTexture{
private :
string path; // path to image file
int format; // image format : png, jpg, bmp, etc
private :
GLuint texture;
GLenum texture_format;
GLint nOfColors;
public :
int makeTexture( string Path, int Format ); // loads the image into memory and creates an OpenGL texture : returns 1 on success
int bindTexture( ); // binds the texture for subsequent geometry to be drawn with : returns 1 on success
void unbindTexture( ); // disables textures
};
#endif // CTEXTURE_H