# Visualization Library

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

[Home] [Tutorials] [All Classes] [Grouped Classes]

Public Member Functions | Protected Attributes

# vl::TextureUnit Class Reference

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

`#include <Shader.hpp>`

Inheritance diagram for vl::TextureUnit:

List of all members.

## Public Member Functions

virtual const char * | className ()
| Returns the name of the class.
| TextureUnit (int texunit)
virtual ERenderState | type () const
virtual void | apply (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)
Texture * | texture ()
const Texture * | texture () const
bool | hasTexture () const

## Protected Attributes

ref< Texture > | mTexture

## Detailed Description

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

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

Definition at line 1153 of file Shader.hpp.

## Constructor & Destructor Documentation

vl::TextureUnit::TextureUnit | ( | int | texunit ) | `[inline]`

Definition at line 1157 of file Shader.hpp.

References VL_DEBUG_SET_OBJECT_NAME.

## Member Function Documentation

virtual const char* vl::TextureUnit::className | ( | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::TextureState.

Definition at line 1156 of file Shader.hpp.

virtual ERenderState vl::TextureUnit::type | ( | ) | const`[inline, virtual]`

Reimplemented from vl::RenderState.

Definition at line 1163 of file Shader.hpp.

References vl::RS_TextureUnit0.

void TextureUnit::apply | ( | const Camera * | camera,
|  | OpenGLContext * | ctx
| ) |  | const`[virtual]`

The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it.

Implements vl::RenderState.

Definition at line 940 of file Shader.cpp.

References vl::TexParameter::apply(), vl::Log::bug(), vl::Texture::dimension(), vl::Texture::getTexParameter(), hasTexture(), vl::OpenGLContext::isCompatible(), vl::Object::objectName(), vl::OpenGLContext::setTexUnitBinding(), vl::TD_TEXTURE_1D_ARRAY, vl::TD_TEXTURE_2D_ARRAY, vl::TD_TEXTURE_2D_MULTISAMPLE, vl::TD_TEXTURE_2D_MULTISAMPLE_ARRAY, vl::TD_TEXTURE_BUFFER, vl::TD_TEXTURE_CUBE_MAP, texture(), vl::TextureState::textureUnit(), vl::OpenGLContext::texUnitBinding(), vl::TPF_LINEAR_MIPMAP_LINEAR, vl::TPF_LINEAR_MIPMAP_NEAREST, vl::TPF_NEAREST_MIPMAP_LINEAR, vl::TPF_NEAREST_MIPMAP_NEAREST, VL_CHECK, VL_CHECK_OGL, vl::VL_glActiveTexture(), VL_MAX_TEXTURE_UNITS, and VL_TRAP.

void vl::TextureUnit::setTexture | ( | Texture * | texture ) | `[inline]`

Definition at line 1166 of file Shader.hpp.

Texture* vl::TextureUnit::texture | ( | ) | `[inline]`

Definition at line 1167 of file Shader.hpp.

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

const Texture* vl::TextureUnit::texture | ( | ) | const`[inline]`

Definition at line 1168 of file Shader.hpp.

bool TextureUnit::hasTexture | ( | ) | const

Definition at line 935 of file Shader.cpp.

References mTexture.

Referenced by apply().

## Member Data Documentation

ref<Texture> vl::TextureUnit::mTexture`[protected]`

Definition at line 1173 of file Shader.hpp.

Referenced by hasTexture().

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

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/Shader.hpp
- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/Shader.cpp

Visualization Library v2011.05.1142 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 26 2011 22:51:46.
Permission is granted to use this page to write and publish articles regarding Visualization Library.