Manages 1d texture arrays.
More...
#include <texture.h>
|
| Texture_1d_Array (const std::vector< std::string > &paths) |
| Texture_1d_Array (const std::vector< sgltk::Image > &images) |
| Texture_1d_Array (unsigned int res, unsigned int num_layers, GLenum internal_format, GLenum type, GLenum format) |
void | create_empty (unsigned int res, unsigned int num_layers, GLenum internal_format, GLenum type, GLenum format) |
| Creates an empty texture.
|
bool | load (const std::vector< sgltk::Image > &images) |
| Load a new image as texture.
|
bool | load (const std::vector< std::string > &paths) |
| Load a new image as texture.
|
void | bind (unsigned int texture_unit=0) |
| Bind the texture to be used by the shader.
|
void | unbind (unsigned int texture_unit=0) |
| Unbind the texture.
|
void | set_parameter (GLenum name, int parameter) |
| Sets a texture parameter.
|
void | set_parameter (GLenum name, float parameter) |
| Sets a texture parameter.
|
void | set_parameter (GLenum name, float *parameter) |
| Sets a texture parameter.
|
void | bind_image (GLuint unit, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format) |
| Binds a level of a texture to an image unit.
|
|
static void | add_path (std::string path) |
| Adds a path to the list of paths to be searched for image files.
|
static bool | store_texture (std::string name, std::shared_ptr< Texture > texture) |
| Stores a texture object in an internal map using the name parameter as key (no duplicates)
|
static std::shared_ptr< Texture > | find_texture (std::string name) |
| Finds a texture in the internal map using the name as key.
|
GLenum | target |
| The texture target.
|
GLuint | texture |
| The texture name.
|
unsigned int | width |
| The width of the texture.
|
unsigned int | height |
| The height of the texture.
|
unsigned int | num_layers |
| The number of layers.
|
Manages 1d texture arrays.
Definition at line 178 of file texture.h.
◆ Texture_1d_Array() [1/4]
Texture_1d_Array::Texture_1d_Array |
( |
| ) |
|
◆ Texture_1d_Array() [2/4]
Texture_1d_Array::Texture_1d_Array |
( |
const std::vector< std::string > & | paths | ) |
|
◆ Texture_1d_Array() [3/4]
sgltk::Texture_1d_Array::Texture_1d_Array |
( |
const std::vector< sgltk::Image > & | images | ) |
|
- Parameters
-
images | The images to use as the texture layers |
◆ Texture_1d_Array() [4/4]
Texture_1d_Array::Texture_1d_Array |
( |
unsigned int | res, |
|
|
unsigned int | num_layers, |
|
|
GLenum | internal_format, |
|
|
GLenum | type, |
|
|
GLenum | format ) |
- Parameters
-
res | The texture resolution |
num_layers | The number of layers |
internal_format | The internal format of the texture |
type | The type of pixel data |
format | The format of the textre |
Definition at line 9 of file texture_1d_array.cpp.
◆ ~Texture_1d_Array()
Texture_1d_Array::~Texture_1d_Array |
( |
| ) |
|
◆ bind()
void Texture_1d_Array::bind |
( |
unsigned int | texture_unit = 0 | ) |
|
|
virtual |
Bind the texture to be used by the shader.
- Parameters
-
texture_unit | The texture unit to bind the texture to |
Implements sgltk::Texture.
Definition at line 104 of file texture_1d_array.cpp.
◆ create_empty()
void Texture_1d_Array::create_empty |
( |
unsigned int | res, |
|
|
unsigned int | num_layers, |
|
|
GLenum | internal_format, |
|
|
GLenum | type, |
|
|
GLenum | format ) |
Creates an empty texture.
- Parameters
-
res | The texture resolution |
num_layers | The number of layers |
internal_format | The internal format of the texture |
type | The type of pixel data |
format | The format of the textre |
Definition at line 32 of file texture_1d_array.cpp.
◆ load() [1/2]
bool sgltk::Texture_1d_Array::load |
( |
const std::vector< sgltk::Image > & | images | ) |
|
Load a new image as texture.
- Parameters
-
images | The images to use as the texture layers |
◆ load() [2/2]
bool Texture_1d_Array::load |
( |
const std::vector< std::string > & | paths | ) |
|
Load a new image as texture.
- Parameters
-
paths | The path to the image file |
Definition at line 50 of file texture_1d_array.cpp.
◆ unbind()
void Texture_1d_Array::unbind |
( |
unsigned int | texture_unit = 0 | ) |
|
|
virtual |
The documentation for this class was generated from the following files: