# Visualization Library

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

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

# vl::Texture Class Reference

Wraps an OpenGL texture object. More...

`#include <Texture.hpp>`

Inheritance diagram for vl::Texture:

List of all members.

## Classes

class | SetupParams
| The SetupParams function wraps all the parameters neede to crate a Texture. More...

## Public Member Functions

virtual const char * | className ()
| Returns the name of the class.
| Texture (const String &image_path, ETextureFormat format=TF_RGBA, bool mipmaps=true, bool border=false)
| Texture (Image *image, ETextureFormat format=TF_RGBA, bool mipmaps=true, bool border=false)
| Texture (int width, ETextureFormat format=TF_RGBA, bool border=false)
| Texture (int width, int height, ETextureFormat format=TF_RGBA, bool border=false)
| Texture (int width, int height, int depth, ETextureFormat format=TF_RGBA, bool border=false)
| Texture ()
virtual | ~Texture ()
TexParameter * | getTexParameter () const
bool | createTexture ()
| Performs the actual creation of the texture.
void | setupTexture1D (const String &image_path, ETextureFormat format=TF_RGBA, bool mipmaps=true, bool border=false)
void | setupTexture1D (Image *image, ETextureFormat format=TF_RGBA, bool mipmaps=true, bool border=false)
void | setupTexture2D (const String &image_path, ETextureFormat format=TF_RGBA, bool mipmaps=true, bool border=false)
void | setupTexture2D (Image *image, ETextureFormat format=TF_RGBA, bool mipmaps=true, bool border=false)
void | setupTexture3D (const String &image_path, ETextureFormat format=TF_RGBA, bool mipmaps=true, bool border=false)
void | setupTexture3D (Image *image, ETextureFormat format=TF_RGBA, bool mipmaps=true, bool border=false)
void | setupTextureCubemap (const String &image_path, ETextureFormat format=TF_RGBA, bool mipmaps=true, bool border=false)
void | setupTextureCubemap (Image *image, ETextureFormat format=TF_RGBA, bool mipmaps=true, bool border=false)
void | setupTexture1DArray (const String &image_path, ETextureFormat format=TF_RGBA, bool mipmaps=true)
void | setupTexture1DArray (Image *image, ETextureFormat format=TF_RGBA, bool mipmaps=true)
void | setupTexture2DArray (const String &image_path, ETextureFormat format=TF_RGBA, bool mipmaps=true)
void | setupTexture2DArray (Image *image, ETextureFormat format=TF_RGBA, bool mipmaps=true)
void | setupTextureRectangle (const String &image_path, ETextureFormat format=TF_RGBA)
void | setupTextureRectangle (Image *image, ETextureFormat format=TF_RGBA)
bool | isValid () const
bool | hasMipMaps () const
void | setHandle (unsigned int id)
void | setDimension (ETextureDimension dimension)
void | setWidth (int x)
void | setHeight (int y)
void | setDepth (int z)
void | setBorder (bool border)
void | setInternalFormat (ETextureFormat format)
unsigned int | handle () const
ETextureDimension | dimension () const
int | width () const
int | height () const
int | depth () const
bool | border () const
ETextureFormat | internalFormat () const
const SetupParams * | setupParams () const
| See SetupParams.
SetupParams * | setupParams ()
| See SetupParams.
void | setSetupParams (SetupParams *setup_params)
| See SetupParams.

## Static Public Member Functions

static bool | supports (ETextureDimension texture_dim, ETextureFormat format, bool border, const Image *image, bool verbose=true)
static bool | isCompressedFormat (int format)

## Protected Attributes

unsigned int | mHandle
ref< TexParameter > | mTexParameter
ref< SetupParams > | mSetupParams
ETextureDimension | mDimension
ETextureFormat | mFormat
bool | mBorder
int | mWidth
int | mHeight
int | mDepth
bool | mHasMipmaps

## Detailed Description

Wraps an OpenGL texture object.

Note:
  A TexParameter defines a set of variables associated to a Texture while TexGen and TexEnv define a set of variables associated to a TextureUnit.

See also:
  - TextureUnit
  - Texture
  - TexParameter
  - TexGen
  - TexEnv
  - Shader
  - Effect
  - Actor

## Constructor & Destructor Documentation

Texture::Texture | ( | const String & | image_path,
|  | ETextureFormat | format = `TF_RGBA`,
|  | bool | mipmaps = `true`,
|  | bool | border = `false` |
| ) |  |  |

Texture::Texture | ( | Image * | image,
|  | ETextureFormat | format = `TF_RGBA`,
|  | bool | mipmaps = `true`,
|  | bool | border = `false` |
| ) |  |  |

Texture::Texture | ( | int | width,
|  | ETextureFormat | format = `TF_RGBA`,
|  | bool | border = `false` |
| ) |  |  |

Texture::Texture | ( | int | width,
|  | int | height,
|  | ETextureFormat | format = `TF_RGBA`,
|  | bool | border = `false` |
| ) |  |  |

Texture::Texture | ( | int | width,
|  | int | height,
|  | int | depth,
|  | ETextureFormat | format = `TF_RGBA`,
|  | bool | border = `false` |
| ) |  |  |

Texture::Texture | ( |  | ) |

Texture::~Texture | ( |  | ) | `[virtual]`

## Member Function Documentation

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

Returns the name of the class.

Reimplemented from vl::Object.

TexParameter* vl::Texture::getTexParameter | ( |  | ) | const`[inline]`

bool Texture::createTexture | ( |  | ) |

Performs the actual creation of the texture.

See also:
  - setupTexture2D()
  - SetupParams

void vl::Texture::setupTexture1D | ( | const String & | image_path,
|  | ETextureFormat | format = `TF_RGBA`,
|  | bool | mipmaps = `true`,
|  | bool | border = `false` |
| ) |  |  | `[inline]`

void vl::Texture::setupTexture1D | ( | Image * | image,
|  | ETextureFormat | format = `TF_RGBA`,
|  | bool | mipmaps = `true`,
|  | bool | border = `false` |
| ) |  |  | `[inline]`

void vl::Texture::setupTexture2D | ( | const String & | image_path,
|  | ETextureFormat | format = `TF_RGBA`,
|  | bool | mipmaps = `true`,
|  | bool | border = `false` |
| ) |  |  | `[inline]`

void vl::Texture::setupTexture2D | ( | Image * | image,
|  | ETextureFormat | format = `TF_RGBA`,
|  | bool | mipmaps = `true`,
|  | bool | border = `false` |
| ) |  |  | `[inline]`

void vl::Texture::setupTexture3D | ( | const String & | image_path,
|  | ETextureFormat | format = `TF_RGBA`,
|  | bool | mipmaps = `true`,
|  | bool | border = `false` |
| ) |  |  | `[inline]`

void vl::Texture::setupTexture3D | ( | Image * | image,
|  | ETextureFormat | format = `TF_RGBA`,
|  | bool | mipmaps = `true`,
|  | bool | border = `false` |
| ) |  |  | `[inline]`

void vl::Texture::setupTextureCubemap | ( | const String & | image_path,
|  | ETextureFormat | format = `TF_RGBA`,
|  | bool | mipmaps = `true`,
|  | bool | border = `false` |
| ) |  |  | `[inline]`

void vl::Texture::setupTextureCubemap | ( | Image * | image,
|  | ETextureFormat | format = `TF_RGBA`,
|  | bool | mipmaps = `true`,
|  | bool | border = `false` |
| ) |  |  | `[inline]`

void vl::Texture::setupTexture1DArray | ( | const String & | image_path,
|  | ETextureFormat | format = `TF_RGBA`,
|  | bool | mipmaps = `true` |
| ) |  |  | `[inline]`

void vl::Texture::setupTexture1DArray | ( | Image * | image,
|  | ETextureFormat | format = `TF_RGBA`,
|  | bool | mipmaps = `true` |
| ) |  |  | `[inline]`

void vl::Texture::setupTexture2DArray | ( | const String & | image_path,
|  | ETextureFormat | format = `TF_RGBA`,
|  | bool | mipmaps = `true` |
| ) |  |  | `[inline]`

void vl::Texture::setupTexture2DArray | ( | Image * | image,
|  | ETextureFormat | format = `TF_RGBA`,
|  | bool | mipmaps = `true` |
| ) |  |  | `[inline]`

void vl::Texture::setupTextureRectangle | ( | const String & | image_path,
|  | ETextureFormat | format = `TF_RGBA` |
| ) |  |  | `[inline]`

void vl::Texture::setupTextureRectangle | ( | Image * | image,
|  | ETextureFormat | format = `TF_RGBA` |
| ) |  |  | `[inline]`

bool Texture::isValid | ( |  | ) | const

bool vl::Texture::hasMipMaps | ( |  | ) | const`[inline]`

void vl::Texture::setHandle | ( | unsigned int | id | ) | `[inline]`

void vl::Texture::setDimension | ( | ETextureDimension | dimension | ) | `[inline]`

void vl::Texture::setWidth | ( | int | x | ) | `[inline]`

void vl::Texture::setHeight | ( | int | y | ) | `[inline]`

void vl::Texture::setDepth | ( | int | z | ) | `[inline]`

void vl::Texture::setBorder | ( | bool | border | ) | `[inline]`

void vl::Texture::setInternalFormat | ( | ETextureFormat | format | ) | `[inline]`

unsigned int vl::Texture::handle | ( |  | ) | const`[inline]`

ETextureDimension vl::Texture::dimension | ( |  | ) | const`[inline]`

int vl::Texture::width | ( |  | ) | const`[inline]`

int vl::Texture::height | ( |  | ) | const`[inline]`

int vl::Texture::depth | ( |  | ) | const`[inline]`

bool vl::Texture::border | ( |  | ) | const`[inline]`

ETextureFormat vl::Texture::internalFormat | ( |  | ) | const`[inline]`

const SetupParams* vl::Texture::setupParams | ( |  | ) | const`[inline]`

See SetupParams.

SetupParams* vl::Texture::setupParams | ( |  | ) | `[inline]`

See SetupParams.

void vl::Texture::setSetupParams | ( | SetupParams * | setup_params | ) | `[inline]`

See SetupParams.

bool Texture::supports | ( | ETextureDimension | texture_dim,
|  | ETextureFormat | format,
|  | bool | border,
|  | const Image * | image,
|  | bool | verbose = `true` |
| ) |  |  | `[static]`

bool Texture::isCompressedFormat | ( | int | format | ) | `[static]`

## Member Data Documentation

unsigned int vl::Texture::mHandle`[protected]`

ref<TexParameter> vl::Texture::mTexParameter`[protected]`

ref<SetupParams> vl::Texture::mSetupParams`[protected]`

ETextureDimension vl::Texture::mDimension`[protected]`

ETextureFormat vl::Texture::mFormat`[protected]`

bool vl::Texture::mBorder`[protected]`

int vl::Texture::mWidth`[protected]`

int vl::Texture::mHeight`[protected]`

int vl::Texture::mDepth`[protected]`

bool vl::Texture::mHasMipmaps`[protected]`

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

- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/Texture.hpp
- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/Texture.cpp

Visualization Library v2009.07 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Mon Aug 10 21:41:43 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.