GPU-Accelerated Coverage
0.1.0
Compute coverage tours for known environment with articulated objects on GPU
|
Texture object. More...
#include <Texture.h>
Public Member Functions | |
Texture (const std::string &path, const aiTextureMapping mapping, const unsigned int uvIndex, const float blend, const aiTextureOp textureOp, const aiTextureMapMode mapMode) | |
Constructor for creating a texture from a file. More... | |
Texture (const GLuint textureObject) | |
Constructor for creating a texture object from an existing OpenGL texture. More... | |
Texture (const Image *const image) | |
Constructor for creating a texture object from an Image. More... | |
~Texture () | |
Destructor. | |
void | bindToUnit (const GLuint unit) const |
Bind the texture to an OpenGL texture unit as a GL_TEXTURE_2D. More... | |
GLuint | getTextureObject () const |
Returns the OpenGL texture ID. More... | |
Protected Member Functions | |
void | createTextureObject (const aiTextureMapMode &mapMode) |
Protected Attributes | |
const Image *const | texture |
The texture or NULL if the texture object has been created from an existing OpenGL texture. | |
GLuint | textureObject |
OpenGL texture ID. | |
bool | createdTextureObject |
True if the constructor has created the OpenGL texture object and the destructor should delete it later. | |
Texture object.
This method manages the OpenGL texture object and metadata, but no image data.
gpu_coverage::Texture::Texture | ( | const std::string & | path, |
const aiTextureMapping | mapping, | ||
const unsigned int | uvIndex, | ||
const float | blend, | ||
const aiTextureOp | textureOp, | ||
const aiTextureMapMode | mapMode | ||
) |
Constructor for creating a texture from a file.
[in] | path | Image file path passed to Image::get(). |
[in] | mapping | Assimp texture mapping, unused. |
[in] | uvIndex | Assimp UV index, unused. |
[in] | blend | Assimp blend mode, unused. |
[in] | textureOp | Assimp texture operator, unused. |
[in] | mapMode | Assimp map mode, unused. |
The destructor will later delete the OpenGL texture and call Image::release() on the loaded image.
gpu_coverage::Texture::Texture | ( | const GLuint | textureObject | ) |
Constructor for creating a texture object from an existing OpenGL texture.
[in] | textureObject | Existing OpenGL texture. |
The destructor will not delete the OpenGL texture.
gpu_coverage::Texture::Texture | ( | const Image *const | image | ) |
Constructor for creating a texture object from an Image.
[in] | image | Input image. |
The destructor will later delete the OpenGL texture and call Image::release() on the loaded image.
void gpu_coverage::Texture::bindToUnit | ( | const GLuint | unit | ) | const |
Bind the texture to an OpenGL texture unit as a GL_TEXTURE_2D.
[in] | unit | The texture unit. |
|
protected |
Create texture object, called from constructors.
mapMode | Assimp texture mode. |
|
inline |
Returns the OpenGL texture ID.