Vis 2 Demo
1.0
Technical illustration type real-time rendering of geometry
|
This class manages textures. More...
Public Member Functions | |
Texture () | |
Empty constructor. More... | |
Texture (const std::string &_str_path) | |
Constructor for creating a texture from a JPEG file. More... | |
Texture (const unsigned int _width, const unsigned int _height, const unsigned int _type) | |
Constructor for creating an empty texture for rendering. More... | |
~Texture () | |
Destructor. More... | |
void | textureBind (const int _unit) |
This function binds texture as a source. More... | |
void | textureBind2FBO (const int _unit) |
This function binds texture to a bound FBO as a rendering target. More... | |
unsigned int | getTextureType () const |
getter for the texture attributes: type More... | |
unsigned int | getTextureWidth () const |
getter for the texture attributes: width More... | |
unsigned int | getTextureHeight () const |
getter for the texture attributes: height More... | |
Static Public Member Functions | |
static void | initDevIL () |
Function for calling the DevIL library. More... | |
Private Member Functions | |
void | loadTextureFromFile (const std::string _file_path) |
Hidden copy-constructor. More... | |
Texture (const Texture &) | |
Private Attributes | |
ILuint | image_data_handle |
is the id of this texture data as implemented by DevIL More... | |
GLuint | texture_handle |
is the id of this texture on the Graphics Card More... | |
unsigned int | texture_type |
holds the type of the texture More... | |
unsigned int | texture_width |
holds the width of the texture More... | |
unsigned int | texture_height |
holds the height of the texture More... | |
This class manages textures.
This class contains functionality for loading textures from JPEG files
as well as creating empty textures for rendering.
Texture::Texture | ( | const std::string & | _str_path | ) |
Constructor for creating a texture from a JPEG file.
This constructor laods the texture to the Graphics Card
and defines interpolation parameters and calls mipmap generation.
[in] | _str_path | is the path to the JPEG file |
Definition at line 6 of file Texture.cpp.
Texture::Texture | ( | const unsigned int | _width, |
const unsigned int | _height, | ||
const unsigned int | _type | ||
) |
Constructor for creating an empty texture for rendering.
Color textures have GLRGB8 or GL_RGBA8 format, depth textures have GL_DEPTH_COMPONENT32F format.
[in] | _width | is the width of the new texture, |
[in] | _height | is the height of the new texture, |
[in] | _type | can be VIS2_TEX_TYPE_RGB, VIS2_TEX_TYPE_RGBA or VIS2_TEX_TYPE_DEPTH. |
Definition at line 30 of file Texture.cpp.
Texture::~Texture | ( | ) |
Destructor.
Definition at line 73 of file Texture.cpp.
|
private |
|
inline |
|
inline |
|
inline |
|
static |
Function for calling the DevIL library.
|
private |
Hidden copy-constructor.
[in] | is | the path to the file on the local system |
Definition at line 106 of file Texture.cpp.
void Texture::textureBind | ( | const int | _unit | ) |
This function binds texture as a source.
Definition at line 81 of file Texture.cpp.
void Texture::textureBind2FBO | ( | const int | _unit | ) |
This function binds texture to a bound FBO as a rendering target.
[in] | _unit | is the id of the color or depth attachment, to which to bind the texture |
Definition at line 87 of file Texture.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |