Visualization Library v1.0.3

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

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Attributes

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:
vl::RenderStateIndexed vl::RenderState vl::Object

List of all members.

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.
void setTexture (Texture *texture)
 The texture sampler by a texture unit.
Texturetexture ()
 The texture sampler by a texture unit.
const Texturetexture () const
 The texture sampler by a texture unit.
void setTexParameter (TexParameter *tex_param)
 The TexParameter used by the sampler used to override the one specified by the bound Texture.
TexParametergetTexParameter ()
 The TexParameter used by the sampler used to override the one specified by the bound Texture.
const TexParametergetTexParameter () const
 The TexParameter used by the sampler used to override the one specified by the bound Texture.
bool hasTexture () const
virtual ref< RenderStateclone () const

Protected Attributes

ref< TexturemTexture
ref< TexParametermTexParameter

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

vl::TextureSampler::TextureSampler (  ) [inline]

Definition at line 1752 of file Shader.hpp.

References VL_DEBUG_SET_OBJECT_NAME.


Member Function Documentation

virtual ERenderState vl::TextureSampler::type (  ) const [inline, virtual]

Reimplemented from vl::RenderState.

Definition at line 1757 of file Shader.hpp.

References vl::RS_TextureSampler.

void TextureSampler::apply ( int  index,
const Camera camera,
OpenGLContext ctx 
) const [virtual]
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 1762 of file Shader.hpp.

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

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

The texture sampler by a texture unit.

Definition at line 1765 of file Shader.hpp.

Referenced by apply(), vl::VLXClassWrapper_TextureSampler::exportTextureSampler(), and vl::Rendering::fillRenderQueue().

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

The texture sampler by a texture unit.

Definition at line 1768 of file Shader.hpp.

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 1772 of file Shader.hpp.

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

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

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

Definition at line 1775 of file Shader.hpp.

Referenced by apply(), and vl::VLXClassWrapper_TextureSampler::exportTextureSampler().

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 1778 of file Shader.hpp.

bool TextureSampler::hasTexture (  ) const

Definition at line 1137 of file Shader.cpp.

References mTexture.

Referenced by apply().

virtual ref<RenderState> vl::TextureSampler::clone (  ) const [inline, virtual]

Implements vl::RenderState.

Definition at line 1782 of file Shader.hpp.


Member Data Documentation

Definition at line 1790 of file Shader.hpp.

Referenced by hasTexture().

Definition at line 1791 of file Shader.hpp.


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

Visualization Library v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:12.
Permission is granted to use this page to write and publish articles regarding Visualization Library.