GPU-Accelerated Coverage  0.1.0
Compute coverage tours for known environment with articulated objects on GPU
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gpu_coverage::Texture Class Reference

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.
 

Detailed Description

Texture object.

This method manages the OpenGL texture object and metadata, but no image data.

Constructor & Destructor Documentation

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.

Parameters
[in]pathImage file path passed to Image::get().
[in]mappingAssimp texture mapping, unused.
[in]uvIndexAssimp UV index, unused.
[in]blendAssimp blend mode, unused.
[in]textureOpAssimp texture operator, unused.
[in]mapModeAssimp 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.

Parameters
[in]textureObjectExisting 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.

Parameters
[in]imageInput image.

The destructor will later delete the OpenGL texture and call Image::release() on the loaded image.

Member Function Documentation

void gpu_coverage::Texture::bindToUnit ( const GLuint  unit) const

Bind the texture to an OpenGL texture unit as a GL_TEXTURE_2D.

Parameters
[in]unitThe texture unit.
void gpu_coverage::Texture::createTextureObject ( const aiTextureMapMode &  mapMode)
protected

Create texture object, called from constructors.

Parameters
mapModeAssimp texture mode.
GLuint gpu_coverage::Texture::getTextureObject ( ) const
inline

Returns the OpenGL texture ID.

Returns
OpenGL Texture ID.

The documentation for this class was generated from the following file: