sgltk 0.6
Simple OpenGL Tool Kit
|
Manages cubemaps. More...
#include <texture.h>
Public Member Functions | |
Cubemap (unsigned int res_x, unsigned int res_y, GLenum internal_format, GLenum type, GLenum format) | |
Cubemap (const sgltk::Image &pos_x, const sgltk::Image &neg_x, const sgltk::Image &pos_y, const sgltk::Image &neg_y, const sgltk::Image &pos_z, const sgltk::Image &neg_z) | |
Load a new cubemap. | |
void | create_empty (unsigned int res_x, unsigned int res_y, GLenum internal_format, GLenum type, GLenum format) |
Creates an empty texture. | |
bool | load (const std::string &pos_x, const std::string &neg_x, const std::string &pos_y, const std::string &neg_y, const std::string &pos_z, const std::string &neg_z) |
Load a new cubemap. | |
bool | load (const sgltk::Image &pos_x, const sgltk::Image &neg_x, const sgltk::Image &pos_y, const sgltk::Image &neg_y, const sgltk::Image &pos_z, const sgltk::Image &neg_z) |
Load a new cubemap. | |
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. | |
Public Member Functions inherited from sgltk::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. |
Additional Inherited Members | |
Static Public Member Functions inherited from sgltk::Texture | |
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. | |
Public Attributes inherited from sgltk::Texture | |
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. |
Cubemap::Cubemap | ( | ) |
Definition at line 5 of file cubemap.cpp.
Cubemap::Cubemap | ( | unsigned int | res_x, |
unsigned int | res_y, | ||
GLenum | internal_format, | ||
GLenum | type, | ||
GLenum | format ) |
res_x | The texture x resolution |
res_y | The texture y resolution |
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 cubemap.cpp.
Cubemap::Cubemap | ( | const sgltk::Image & | pos_x, |
const sgltk::Image & | neg_x, | ||
const sgltk::Image & | pos_y, | ||
const sgltk::Image & | neg_y, | ||
const sgltk::Image & | pos_z, | ||
const sgltk::Image & | neg_z ) |
Load a new cubemap.
pos_x | The image to use as the positive x texture |
neg_x | The image to use as the negative x texture |
pos_y | The image to use as the positive y texture |
neg_y | The image to use as the negative y texture |
pos_z | The image to use as the positive z texture |
neg_z | The image to use as the negative z texture |
Definition at line 18 of file cubemap.cpp.
Cubemap::~Cubemap | ( | ) |
Definition at line 26 of file cubemap.cpp.
|
virtual |
Bind the texture to be used by the shader.
texture_unit | The texture unit to bind the texture to |
Implements sgltk::Texture.
Definition at line 95 of file cubemap.cpp.
void Cubemap::create_empty | ( | unsigned int | res_x, |
unsigned int | res_y, | ||
GLenum | internal_format, | ||
GLenum | type, | ||
GLenum | format ) |
Creates an empty texture.
res_x | The texture x resolution |
res_y | The texture y resolution |
internal_format | The internal format of the texture |
type | The type of pixel data |
format | The format of the textre |
Definition at line 29 of file cubemap.cpp.
bool Cubemap::load | ( | const sgltk::Image & | pos_x, |
const sgltk::Image & | neg_x, | ||
const sgltk::Image & | pos_y, | ||
const sgltk::Image & | neg_y, | ||
const sgltk::Image & | pos_z, | ||
const sgltk::Image & | neg_z ) |
Load a new cubemap.
pos_x | The image to use as the positive x texture |
neg_x | The image to use as the negative x texture |
pos_y | The image to use as the positive y texture |
neg_y | The image to use as the negative y texture |
pos_z | The image to use as the positive z texture |
neg_z | The image to use as the negative z texture |
Definition at line 65 of file cubemap.cpp.
bool Cubemap::load | ( | const std::string & | pos_x, |
const std::string & | neg_x, | ||
const std::string & | pos_y, | ||
const std::string & | neg_y, | ||
const std::string & | pos_z, | ||
const std::string & | neg_z ) |
Load a new cubemap.
pos_x | The image to use as the positive x texture |
neg_x | The image to use as the negative x texture |
pos_y | The image to use as the positive y texture |
neg_y | The image to use as the negative y texture |
pos_z | The image to use as the positive z texture |
neg_z | The image to use as the negative z texture |
Definition at line 51 of file cubemap.cpp.
|
virtual |
Unbind the texture.
texture_unit | The texture unit to bind the texture to |
Implements sgltk::Texture.
Definition at line 100 of file cubemap.cpp.