-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathilcontainer.h
68 lines (56 loc) · 1.35 KB
/
ilcontainer.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* Perry Kivolowitz */
#pragma once
#undef _UNICODE
#include <GL/glew.h>
#include <GL/freeglut.h>
#include <IL/il.h>
#include <IL/ilu.h>
#include <IL/ilut.h>
#define BAD_IL_VALUE IL_INVALID_VALUE
#ifndef BAD_GL_VALUE
#define BAD_GL_VALUE GLuint(-1)
#endif // !BAD_GL_VALUE
/* This class assumes that the object will be dynamically created.
This assumption is demonstrated in the destructor which calls
OpenGL. If an object is declared in the global score, the
destructor will run after the OpenGL context is destroyed,
which would be an error.
*/
class ILContainer
{
public:
ILContainer()
{
this->il_handle = BAD_IL_VALUE;
this->il_texture_handle = BAD_GL_VALUE;
}
~ILContainer();
bool Initialize(const char * file_name);
void Bind(GLuint texture_unit = 0);
void TakeDown();
static void TakeDown(std::vector<ILContainer> & textures);
ILint width;
ILint height;
ILint format;
ILuint il_handle;
GLuint il_texture_handle;
GLvoid * data;
};
/* Do not use
class ILCubemapContainer
{
public:
ILCubemapContainer()
{
this->il_handle = BAD_IL_VALUE;
this->il_texture_handle[0] = BAD_GL_VALUE;
}
~ILCubemapContainer();
bool Initialize(const char * file_name, int width, int height, int offsetx, int offsety);
void Bind(GLuint texture_unit = 0);
ILint width;
ILint height;
ILuint il_handle;
GLuint il_texture_handle[7];
};
*/