SimpleGL
1.1.0
A framework for platform independent rendering
Main Page
Namespaces
Classes
Files
File List
File Members
Backends
OpenGL
include
SimpleGL_gl
texture_object.hpp
Go to the documentation of this file.
1
8
#ifndef TEXTURE_OBJECT_HPP
9
#define TEXTURE_OBJECT_HPP
10
11
#include <SimpleGL_gl/SimpleGL_gl_Export.h>
12
13
#include <GL/glew.h>
14
15
namespace
sgl
{
16
22
enum class
TextureFilter
: GLint {
23
25
NEAREST
= GL_NEAREST,
26
28
LINEAR
= GL_LINEAR
29
};
30
36
enum class
TextureWrap
: GLint {
37
39
CLAMP_TO_EDGE
= GL_CLAMP_TO_EDGE,
40
42
CLAMP_TO_BORDER
= GL_CLAMP_TO_BORDER,
43
45
REPEAT
= GL_REPEAT,
46
48
MIRRORED_REPEAT
= GL_MIRRORED_REPEAT
49
};
50
56
struct
SIMPLEGL_GL_EXPORT
TextureData
{
57
59
int
width
;
60
62
int
height
;
63
65
int
components
;
66
68
unsigned
char
*
pixels
;
69
};
70
76
class
SIMPLEGL_GL_EXPORT
Texture
{
77
78
private
:
80
static
Texture
* current;
81
83
GLuint handle;
84
86
int
width;
87
89
int
height;
90
91
public
:
93
Texture
(
void
);
94
96
~
Texture
(
void
);
97
103
GLuint getHandle();
104
110
int
getWidth();
111
117
int
getHeight();
118
120
void
bind();
121
123
void
generateMipMap();
124
130
void
setMinFilter(
TextureFilter
filter);
131
137
void
setMagFilter(
TextureFilter
filter);
138
144
void
setWrapS(
TextureWrap
wrap);
145
151
void
setWrapT(
TextureWrap
wrap);
152
160
void
uploadImage(
int
width,
int
height,
unsigned
char
* data);
161
167
void
uploadImage(
TextureData
image);
168
};
169
}
170
171
#endif
/* TEXTURE_OBJECT_HPP */
sgl::TextureData
This structure stores texture image data.
Definition:
texture_object.hpp:56
sgl::TextureData::pixels
unsigned char * pixels
The pixel data of the image.
Definition:
texture_object.hpp:68
sgl::TextureData::height
int height
The height of the image.
Definition:
texture_object.hpp:62
sgl::TextureWrap::CLAMP_TO_EDGE
Equivalent to GL_CLAMP_TO_EDGE.
sgl::TextureData::components
int components
The number of color channels.
Definition:
texture_object.hpp:65
sgl
Generic namespace for the SimpleGL framework.
Definition:
application.hpp:18
sgl::TextureFilter::LINEAR
Equivalent to GL_LINEAR.
sgl::Texture
This class wraps an OpenGL texture object.
Definition:
texture_object.hpp:76
sgl::TextureWrap
TextureWrap
This enum wraps the texture object's wrapping functions.
Definition:
texture_object.hpp:36
sgl::TextureWrap::MIRRORED_REPEAT
Equivalent to GL_MIRRORED_REPEAT.
sgl::Action::REPEAT
Equivalent to GLFW_REPEAT.
sgl::TextureFilter
TextureFilter
This enum wraps the texture object's filter.
Definition:
texture_object.hpp:22
sgl::TextureWrap::CLAMP_TO_BORDER
Equivalent to GL_CLAMP_TO_BORDER.
sgl::TextureData::width
int width
The width of the image.
Definition:
texture_object.hpp:59
sgl::TextureFilter::NEAREST
Equivalent to GL_NEAREST.
Generated on Sat Jun 30 2018 21:55:23 for SimpleGL by
1.8.11