Visualization Library 2.0.0-b3

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
vl::TextureSampler Class Reference

The TextureSampler class associates a Texture object to an OpenGL texture unit. More...

#include <Shader.hpp>

+ Inheritance diagram for vl::TextureSampler:

Public Member Functions

 TextureSampler ()
 
virtual ERenderState type () const
 
virtual void apply (int index, const Camera *, OpenGLContext *ctx) const
 The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it. More...
 
void setTexture (Texture *texture)
 The texture sampler by a texture unit. More...
 
Texturetexture ()
 The texture sampler by a texture unit. More...
 
const Texturetexture () const
 The texture sampler by a texture unit. More...
 
void setTexParameter (TexParameter *tex_param)
 The TexParameter used by the sampler used to override the one specified by the bound Texture. More...
 
TexParametergetTexParameter ()
 The TexParameter used by the sampler used to override the one specified by the bound Texture. More...
 
const TexParametergetTexParameter () const
 The TexParameter used by the sampler used to override the one specified by the bound Texture. More...
 
bool hasTexture () const
 
virtual ref< RenderStateclone () const
 
- Public Member Functions inherited from vl::RenderStateIndexed
 RenderStateIndexed ()
 
- Public Member Functions inherited from vl::RenderState
 RenderState ()
 
- Public Member Functions inherited from vl::Object
 Object ()
 Constructor. More...
 
 Object (const Object &other)
 Copy constructor: copies the name, ref count mutex and user data. More...
 
Objectoperator= (const Object &other)
 Copy operator: copies the object's name, ref count mutex and user data. More...
 
const std::string & objectName () const
 The name of the object, by default set to the object's class name. More...
 
void setObjectName (const char *name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setObjectName (const std::string &name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setRefCountMutex (IMutex *mutex)
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
IMutexrefCountMutex ()
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
const IMutexrefCountMutex () const
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
int referenceCount () const
 Returns the number of references of an object. More...
 
void incReference () const
 Increments the reference count of an object. More...
 
void decReference ()
 Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More...
 
void setAutomaticDelete (bool autodel_on)
 If set to true the Object is deleted when its reference count reaches 0. More...
 
bool automaticDelete () const
 If set to true the Object is deleted when its reference count reaches 0. More...
 
template<class T >
T * as ()
 Casts an Object to the specified class. More...
 
template<class T >
const T * as () const
 Casts an Object to the specified class. More...
 

Static Public Member Functions

static void reset (int index, OpenGLContext *ctx)
 Reset texture sampler to it's default disabled state. More...
 

Protected Attributes

ref< TexturemTexture
 
ref< TexParametermTexParameter
 
- Protected Attributes inherited from vl::Object
std::string mObjectName
 
IMutexmRefCountMutex
 
int mReferenceCount
 
bool mAutomaticDelete
 

Additional Inherited Members

- Protected Member Functions inherited from vl::Object
virtual ~Object ()
 

Detailed Description

The TextureSampler class associates a Texture object to an OpenGL texture unit.

See also
Texture, TexParameter, Shader, TextureMatrix, TexEnv, TexGen, Effect, Actor

Definition at line 1747 of file Shader.hpp.

Constructor & Destructor Documentation

◆ TextureSampler()

vl::TextureSampler::TextureSampler ( )
inline

Definition at line 1752 of file Shader.hpp.

Member Function Documentation

◆ apply()

void TextureSampler::apply ( int  index,
const Camera camera,
OpenGLContext ctx 
) const
virtual

◆ clone()

virtual ref<RenderState> vl::TextureSampler::clone ( ) const
inlinevirtual

Implements vl::RenderState.

Definition at line 1785 of file Shader.hpp.

◆ getTexParameter() [1/2]

TexParameter* vl::TextureSampler::getTexParameter ( )
inline

The TexParameter used by the sampler used to override the one specified by the bound Texture.

Definition at line 1778 of file Shader.hpp.

Referenced by vl::VLXClassWrapper_TextureSampler::exportTextureSampler().

◆ getTexParameter() [2/2]

const TexParameter* vl::TextureSampler::getTexParameter ( ) const
inline

The TexParameter used by the sampler used to override the one specified by the bound Texture.

Definition at line 1781 of file Shader.hpp.

◆ hasTexture()

bool TextureSampler::hasTexture ( ) const

Definition at line 1106 of file Shader.cpp.

◆ reset()

static void vl::TextureSampler::reset ( int  index,
OpenGLContext ctx 
)
inlinestatic

Reset texture sampler to it's default disabled state.

Definition at line 1761 of file Shader.hpp.

References apply(), and NULL.

◆ setTexParameter()

void vl::TextureSampler::setTexParameter ( TexParameter tex_param)
inline

The TexParameter used by the sampler used to override the one specified by the bound Texture.

Note
Using this method some performance penalty might incur as the Texture's TexParameter might need to be setup and restored several times during the rendering.

Definition at line 1775 of file Shader.hpp.

Referenced by vl::VLXClassWrapper_TextureSampler::importTextureSampler().

◆ setTexture()

void vl::TextureSampler::setTexture ( Texture texture)
inline

The texture sampler by a texture unit.

Note
You can override the Texture's TexParameter on a per-TextureSampler basis using the setTexParameter() method.

Definition at line 1765 of file Shader.hpp.

Referenced by vl::VLXClassWrapper_TextureSampler::importTextureSampler(), vl::Terrain::init(), vl::loadAC3D(), vl::ObjLoader::loadOBJ(), vl::VectorGraphics::popScissor(), and vl::DaeLoader::setup_vl_Effect().

◆ texture() [1/2]

Texture* vl::TextureSampler::texture ( )
inline

◆ texture() [2/2]

const Texture* vl::TextureSampler::texture ( ) const
inline

The texture sampler by a texture unit.

Definition at line 1771 of file Shader.hpp.

◆ type()

virtual ERenderState vl::TextureSampler::type ( ) const
inlinevirtual

Reimplemented from vl::RenderState.

Definition at line 1757 of file Shader.hpp.

References vl::RS_TextureSampler.

Member Data Documentation

◆ mTexParameter

ref<TexParameter> vl::TextureSampler::mTexParameter
protected

Definition at line 1794 of file Shader.hpp.

◆ mTexture

ref<Texture> vl::TextureSampler::mTexture
protected

Definition at line 1793 of file Shader.hpp.


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