-
Notifications
You must be signed in to change notification settings - Fork 0
/
Texture1D.h
50 lines (44 loc) · 1.51 KB
/
Texture1D.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
#ifndef TEXTURE1D_HEADER
#define TEXTURE1D_HEADER
#ifdef GL_API_GLAD_OPENGL_3
#include <glad/glad.h>
#endif
class Texture1D {
public:
#ifdef GL_API_GLAD_OPENGL_3
static const GLenum bufferType = GL_TEXTURE_1D;
GLuint ID;
GLint width;
#endif
#ifdef GL_API_GLAD_OPENGL_3
template <typename type>
Texture1D(type* pixels, GLsizei width, GLenum slot, GLint internalFormat, GLenum format, GLenum pixelType);
#endif
~Texture1D();
#ifdef GL_API_GLAD_OPENGL_3
template <typename type>
void Init(type* pixels, GLint width, GLenum slot, GLint internalFormat, GLenum format, GLenum pixelType);
template <typename type>
static void Init(GLuint* ID, type* pixels, GLsizei width, GLenum slot, GLint internalFormat, GLenum format, GLenum pixelType, GLsizei* widthVar);
static void TexParameter(GLenum parameter, GLint value);
void TexUnit(GLuint shader, const char* uniform, GLint unit);
template <typename type>
void Data(GLint level, GLint internalFormat, GLenum format, GLenum pixelType, type* pixels);
template <typename type>
static void Data(GLsizei width, GLint level, GLint internalFormat, GLenum format, GLenum pixelType, type* pixels);
template <typename type>
static void SubData(GLint xOffset, GLsizei width, GLint level, GLenum format, GLenum pixelType, type* pixels);
#endif
void Bind();
#ifdef GL_API_GLAD_OPENGL_3
static void Bind(GLuint ID);
#endif
static void Unbind();
void Delete();
#ifdef GL_API_GLAD_OPENGL_3
static void Delete(GLuint* ID);
void GenerateMipmap();
#endif
};
#include "Texture1D.tpp"
#endif