ManiVault 1.0.0
A Flexible and Extensible Visual Analytics Framework for High-Dimensional Data
Loading...
Searching...
No Matches
hdps::Texture Class Reference

#include <Texture.h>

Inheritance diagram for hdps::Texture:
hdps::Texture1D hdps::Texture2D hdps::GaussianTexture

Public Member Functions

 Texture (GLenum target)
 
void create ()
 
void destroy ()
 
void bind (unsigned int textureUnit)
 
void bind ()
 
void release ()
 
bool isCreated ()
 
GLuint getHandle ()
 

Protected Attributes

const unsigned int MAX_TEXTURE_UNITS = 16
 
bool _created
 
GLuint _handle
 
GLenum _target
 

Detailed Description

Base texture class. Contains most of the functionality, but can only be used through one of the sub-classes. The texture subclasses provide the specifics of the operations performed on the texture (such as dimensionality). It is wise to only call functions in this class when an OpenGL context is current and active, otherwise their behaviour is undefined.

Constructor & Destructor Documentation

◆ Texture()

hdps::Texture::Texture ( GLenum  target)
inline

Texture constructor

Parameters
targetThe GLenum specifying the target of texture operations. GL_TEXTURE_1D, GL_TEXTURE_2D and GL_TEXTURE_3D are accepted.

Member Function Documentation

◆ bind() [1/2]

void hdps::Texture::bind ( )
inline

Binds the texture to the active texture unit.

◆ bind() [2/2]

void hdps::Texture::bind ( unsigned int  textureUnit)
inline

Binds the texture to the given texture unit.

Parameters
textureUnitThe texture unit should be a value in the range [0-16). One shouldn't try to pass OpenGL texture units in here, as the given value gets added to GL_TEXTURE0.

◆ create()

void hdps::Texture::create ( )
inline

Initializes the use of OpenGL functions in this context and generates the raw OpenGL ID of the texture. This function should be called before doing any other texture operations and only when an OpenGL context is current and active.

◆ destroy()

void hdps::Texture::destroy ( )
inline

Deletes the OpenGL texture ID and invalidates this texture until create() is called again.

◆ getHandle()

GLuint hdps::Texture::getHandle ( )
inline

Return the raw OpenGL texture ID.

◆ isCreated()

bool hdps::Texture::isCreated ( )
inline

Return whether the texture has been allocated

◆ release()

void hdps::Texture::release ( )
inline

Unbinds the texture by binding the default (0) texture.

Member Data Documentation

◆ _created

bool hdps::Texture::_created
protected

◆ _handle

GLuint hdps::Texture::_handle
protected

◆ _target

GLenum hdps::Texture::_target
protected

◆ MAX_TEXTURE_UNITS

const unsigned int hdps::Texture::MAX_TEXTURE_UNITS = 16
protected

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