Visualization LibraryA lightweight C++ OpenGL middleware for 2D/3D graphics |
[Home] [Tutorials] [All Classes] [Grouped Classes] |
Wraps an OpenGL texture object representing and managing all the supported texture types. More...
#include <Texture.hpp>
Classes | |
| class | SetupParams |
| SetupParams wraps all the parameters needed to crate a Texture. More... | |
Public Member Functions | |
| Texture (const String &image_path, ETextureFormat format=TF_RGBA, bool mipmaps=true, bool border=false) | |
| Constructs a 1D, 2D, 3D or Cubemap texture from the specified file. | |
| Texture (const Image *image, ETextureFormat format=TF_RGBA, bool mipmaps=true, bool border=false) | |
| Constructs a 1D, 2D, 3D or Cubemap texture from the specified image. | |
| Texture (int width, ETextureFormat format=TF_RGBA, bool border=false) | |
| Constructs an empty 1D texture. | |
| Texture (int width, int height, ETextureFormat format=TF_RGBA, bool border=false) | |
| Constructs an empty 2D texture. | |
| Texture (int width, int height, int depth, ETextureFormat format=TF_RGBA, bool border=false) | |
| Constructs an empty 3D texture. | |
| Texture () | |
Constructs an null texture that can be initialized later using one of the prepareTexture*() functions or calling createTexture(). | |
| ~Texture () | |
| Destructor. | |
| TexParameter * | getTexParameter () |
| The TexParameter object associated to a Texture. | |
| const TexParameter * | getTexParameter () const |
| The TexParameter object associated to a Texture. | |
| const TexParameter * | getTexParameterOverride () const |
| The TexParameter belonging to a TextureSampler that is currently overriding the Texture's own TexParameter. | |
| BufferObject * | bufferObject () |
| The buffer object bound to a buffer object texture. | |
| const BufferObject * | bufferObject () const |
| The buffer object bound to a buffer object texture. | |
| void | destroyTexture () |
| Destroys the texture. | |
| bool | createTexture () |
Creates a texture using the parameters specified by the last prepareTexture*() called. | |
| bool | createTexture (ETextureDimension tex_dimension, ETextureFormat tex_format, int w, int h, int d, bool border, BufferObject *bo, int samples, bool fixedsamplelocations) |
| Creates an empty texture, with no mipmaps, of the specified type, format and dimensions. | |
| bool | setMipLevel (int mip_level, const Image *img, bool gen_mipmaps) |
| Copies the texture image to the specified mip-maping level. | |
| void | prepareTexture1D (int width, ETextureFormat format, bool border=false) |
| Prepares for creation an empty 1D texture. | |
| bool | createTexture1D (int width, ETextureFormat format, bool border=false) |
| Creates an empty 1D texture. | |
| void | prepareTexture1D (const String &image_path, ETextureFormat format, bool mipmaps=true, bool border=false) |
| Prepares for creation a 1D texture from the specified file. | |
| bool | createTexture1D (const String &image_path, ETextureFormat format, bool mipmaps=true, bool border=false) |
| Creates a 1D texture from the specified file. | |
| void | prepareTexture1D (const Image *image, ETextureFormat format, bool mipmaps=true, bool border=false) |
| Prepares for creation a 1D texture from the specified image. | |
| bool | createTexture1D (const Image *image, ETextureFormat format, bool mipmaps=true, bool border=false) |
| Creates a 1D texture from the specified image. | |
| void | prepareTexture2D (int width, int height, ETextureFormat format, bool border=false) |
| Prepares for creation an empty 2D texture. | |
| bool | createTexture2D (int width, int height, ETextureFormat format, bool border=false) |
| Creates an empty 2D texture. | |
| void | prepareTexture2D (const String &image_path, ETextureFormat format, bool mipmaps=true, bool border=false) |
| Prepares for creation a 2D texture from the specified file. | |
| bool | createTexture2D (const String &image_path, ETextureFormat format, bool mipmaps=true, bool border=false) |
| Creates a 2D texture from the specified file. | |
| void | prepareTexture2D (const Image *image, ETextureFormat format, bool mipmaps=true, bool border=false) |
| Prepares for creation a 2D texture from the specified image. | |
| bool | createTexture2D (const Image *image, ETextureFormat format, bool mipmaps=true, bool border=false) |
| Creates a 2D texture from the specified image. | |
| void | prepareTexture3D (int width, int height, int depth, ETextureFormat format, bool border=false) |
| Prepares for creation an empty 3D texture. | |
| bool | createTexture3D (int width, int height, int depth, ETextureFormat format, bool border=false) |
| Creates an empty 3D texture. | |
| void | prepareTexture3D (const String &image_path, ETextureFormat format, bool mipmaps=true, bool border=false) |
| Prepares for creation a 3D texture from the specified file. | |
| bool | createTexture3D (const String &image_path, ETextureFormat format, bool mipmaps=true, bool border=false) |
| Creates a 3D texture from the specified file. | |
| void | prepareTexture3D (const Image *image, ETextureFormat format, bool mipmaps=true, bool border=false) |
| Prepares for creation a 3D texture from the specified image. | |
| bool | createTexture3D (const Image *image, ETextureFormat format, bool mipmaps=true, bool border=false) |
| Creates a 3D texture from the specified image. | |
| void | prepareTextureCubemap (int width, int height, ETextureFormat format, bool border=false) |
| Prepares for creation an empty cubemap texture. | |
| bool | createTextureCubemap (int width, int height, ETextureFormat format, bool border=false) |
| Creates an empty cubemap texture. | |
| void | prepareTextureCubemap (const String &image_path, ETextureFormat format, bool mipmaps=true, bool border=false) |
| Prepares for creation a cubemap texture from the specified file. | |
| bool | createTextureCubemap (const String &image_path, ETextureFormat format, bool mipmaps=true, bool border=false) |
| Creates creation a cubemap texture from the specified file. | |
| void | prepareTextureCubemap (const Image *image, ETextureFormat format, bool mipmaps=true, bool border=false) |
| Prepares for creation a cubemap texture from the specified image. | |
| bool | createTextureCubemap (const Image *image, ETextureFormat format, bool mipmaps=true, bool border=false) |
| Creates a cubemap texture from the specified image. | |
| void | prepareTexture1DArray (int width, int count, ETextureFormat format) |
| Prepares for creation an empty 1D array texture. | |
| bool | createTexture1DArray (int width, int count, ETextureFormat format) |
| Creates an empty 1D array texture. | |
| void | prepareTexture1DArray (const String &image_path, ETextureFormat format, bool mipmaps=true) |
| Prepares for creation a 1d texture array from the specified file. | |
| bool | createTexture1DArray (const String &image_path, ETextureFormat format, bool mipmaps=true) |
| Creates a 1d texture array from the specified file. | |
| void | prepareTexture1DArray (const Image *image, ETextureFormat format, bool mipmaps=true) |
| Prepares for creation a 1d texture array from the specified image. | |
| bool | createTexture1DArray (const Image *image, ETextureFormat format, bool mipmaps=true) |
| Creates a 1d texture array from the specified image. | |
| void | prepareTexture2DArray (int width, int height, int count, ETextureFormat format) |
| Prepares for creation an empty 2D array texture. | |
| bool | createTexture2DArray (int width, int height, int count, ETextureFormat format) |
| Creates an empty 2D array texture. | |
| void | prepareTexture2DArray (const String &image_path, ETextureFormat format, bool mipmaps=true) |
| Prepares for creation a 2d texture array from the specified file. | |
| bool | createTexture2DArray (const String &image_path, ETextureFormat format, bool mipmaps=true) |
| Creates a 2d texture array from the specified file. | |
| void | prepareTexture2DArray (const Image *image, ETextureFormat format, bool mipmaps=true) |
| Prepares for creation a 2d texture array from the specified image. | |
| bool | createTexture2DArray (const Image *image, ETextureFormat format, bool mipmaps=true) |
| Creates a 2d texture array from the specified image. | |
| void | prepareTextureRectangle (int width, int height, ETextureFormat format) |
| Prepares for creation an empty texture rectangle. | |
| bool | createTextureRectangle (int width, int height, ETextureFormat format) |
| Creates an empty texture rectangle. | |
| void | prepareTextureRectangle (const String &image_path, ETextureFormat format) |
| Prepares for creation a texture rectangle from the specified file. | |
| bool | createTextureRectangle (const String &image_path, ETextureFormat format) |
| Creates a texture rectangle from the specified file. | |
| void | prepareTextureRectangle (const Image *image, ETextureFormat format) |
| Prepares for creation a texture rectangle from the specified image. | |
| bool | createTextureRectangle (const Image *image, ETextureFormat format) |
| Creates a texture rectangle from the specified image. | |
| void | prepareTextureBuffer (vl::ETextureFormat format, BufferObject *bo) |
| Prepares a texture buffer texture. | |
| bool | createTextureBuffer (vl::ETextureFormat format, BufferObject *bo) |
| Creates a texture buffer texture. | |
| void | prepareTexture2DMultisample (int width, int height, vl::ETextureFormat format, int samples, bool fixedsamplelocations) |
| Prepares a 2D multisample texture. | |
| bool | createTexture2DMultisample (int width, int height, vl::ETextureFormat format, int samples, bool fixedsamplelocations) |
| Creates a 2D multisample texture. | |
| void | prepareTexture2DMultisampleArray (int width, int height, int depth, vl::ETextureFormat format, int samples, bool fixedsamplelocations) |
| Prepares a 3D multisample texture. | |
| bool | createTexture2DMultisampleArray (int width, int height, int depth, vl::ETextureFormat format, int samples, bool fixedsamplelocations) |
| Creates a 3D multisample texture. | |
| bool | isValid () const |
Returns true if the current texture configuration seems valid. | |
| unsigned int | handle () const |
| OpenGL texture handle as returned by glGenTextures(). | |
| void | setHandle (unsigned int id) |
| OpenGL texture handle as returned by glGenTextures(). | |
| void | setDimension (ETextureDimension dimension) |
The texture type (1d, 2d, cubemap etc.) as specified by the target parameter of glTexImage*(). | |
| ETextureDimension | dimension () const |
The texture type (1d, 2d, cubemap etc.) as specified by the target parameter of glTexImage*(). | |
| void | setInternalFormat (ETextureFormat format) |
The texture internal format as pecified by the internalFormat parameter of glTexImage*(). | |
| ETextureFormat | internalFormat () const |
The texture internal format as pecified by the internalFormat parameter of glTexImage*(). | |
| void | setWidth (int x) |
| The horizontal dimension of the texture in texels. | |
| int | width () const |
| The horizontal dimension of the texture in texels. | |
| void | setHeight (int y) |
| The vertical dimension of the texture in texels. | |
| int | height () const |
| The vertical dimension of the texture in texels. | |
| void | setDepth (int z) |
| The z dimension of the texture in texels. | |
| int | depth () const |
| The z dimension of the texture in texels. | |
| void | setBorder (bool border) |
| Whether the texture has a 1 pixel texture border or not. | |
| bool | border () const |
| Whether the texture has a 1 pixel texture border or not. | |
| int | samples () const |
| Returns the number of samples of a multisample texture. | |
| bool | fixedSamplesLocation () const |
| Returns whether the samples location is fixed for a a multisample texture. | |
| const SetupParams * | setupParams () const |
| See SetupParams. | |
| SetupParams * | setupParams () |
| See SetupParams. | |
| void | setSetupParams (SetupParams *setup_params) |
| See SetupParams. | |
| bool | isDepthTexture () const |
| Returns true if the texture is a depth or depth/stencil textre. | |
| void | clone (const Texture &other) |
| Copies all the texture parameters form the specified texture, including the OpenGL texture handle. | |
Static Public Member Functions | |
| static bool | supports (ETextureDimension tex_dimension, ETextureFormat tex_format, int mip_level, EImageDimension img_dimension, int w, int h, int d, bool border, int samples, bool fixedsamplelocations, bool verbose) |
| Checks whether the specified texture type, format and dimension combination is supported by the current OpenGL driver. | |
| static bool | isCompressedFormat (int format) |
Returns true if the specified format is compressed. | |
Protected Attributes | |
| unsigned int | mHandle |
| ref< TexParameter > | mTexParameter |
| ref< TexParameter > | mTexParameterOverride |
| ref< SetupParams > | mSetupParams |
| ref< BufferObject > | mBufferObject |
| ETextureFormat | mFormat |
| ETextureDimension | mDimension |
| int | mWidth |
| int | mHeight |
| int | mDepth |
| int | mSamples |
| bool | mBorder |
| bool | mFixedSamplesLocation |
Friends | |
| class | TextureSampler |
Wraps an OpenGL texture object representing and managing all the supported texture types.
Definition at line 141 of file Texture.hpp.
| Texture::Texture | ( | const String & | image_path, |
| ETextureFormat | format = TF_RGBA, |
||
| bool | mipmaps = true, |
||
| bool | border = false |
||
| ) |
Constructs a 1D, 2D, 3D or Cubemap texture from the specified file.
Definition at line 448 of file Texture.cpp.
References border(), vl::Log::bug(), createTexture(), vl::Log::error(), vl::ref< T >::get(), vl::ID_1D, vl::ID_2D, vl::ID_3D, vl::ID_Cubemap, vl::loadImage(), mTexParameter, prepareTexture1D(), prepareTexture2D(), prepareTexture3D(), prepareTextureCubemap(), and VL_DEBUG_SET_OBJECT_NAME.
| Texture::Texture | ( | const Image * | image, |
| ETextureFormat | format = TF_RGBA, |
||
| bool | mipmaps = true, |
||
| bool | border = false |
||
| ) |
Constructs a 1D, 2D, 3D or Cubemap texture from the specified image.
Definition at line 420 of file Texture.cpp.
References vl::Log::bug(), createTexture(), vl::Image::dimension(), vl::Log::error(), vl::ID_1D, vl::ID_2D, vl::ID_3D, vl::ID_Cubemap, vl::Image::isValid(), mTexParameter, prepareTexture1D(), prepareTexture2D(), prepareTexture3D(), prepareTextureCubemap(), and VL_DEBUG_SET_OBJECT_NAME.
| Texture::Texture | ( | int | width, |
| ETextureFormat | format = TF_RGBA, |
||
| bool | border = false |
||
| ) |
Constructs an empty 1D texture.
Definition at line 387 of file Texture.cpp.
References createTexture(), vl::Log::error(), mTexParameter, NULL, vl::TD_TEXTURE_1D, and VL_DEBUG_SET_OBJECT_NAME.
| Texture::Texture | ( | int | width, |
| int | height, | ||
| ETextureFormat | format = TF_RGBA, |
||
| bool | border = false |
||
| ) |
Constructs an empty 2D texture.
Definition at line 398 of file Texture.cpp.
References createTexture(), vl::Log::error(), mTexParameter, NULL, vl::TD_TEXTURE_2D, and VL_DEBUG_SET_OBJECT_NAME.
| Texture::Texture | ( | int | width, |
| int | height, | ||
| int | depth, | ||
| ETextureFormat | format = TF_RGBA, |
||
| bool | border = false |
||
| ) |
Constructs an empty 3D texture.
Definition at line 409 of file Texture.cpp.
References createTexture(), vl::Log::error(), mTexParameter, NULL, vl::TD_TEXTURE_3D, and VL_DEBUG_SET_OBJECT_NAME.
| Texture::Texture | ( | ) |
Constructs an null texture that can be initialized later using one of the prepareTexture*() functions or calling createTexture().
Definition at line 478 of file Texture.cpp.
References mTexParameter, and VL_DEBUG_SET_OBJECT_NAME.
| Texture::~Texture | ( | ) |
| TexParameter* vl::Texture::getTexParameter | ( | ) | [inline] |
The TexParameter object associated to a Texture.
Definition at line 244 of file Texture.hpp.
Referenced by vl::TextureSampler::apply(), vl::VLXClassWrapper_Texture::exportTexture(), and vl::VLXClassWrapper_Texture::importTexture().
| const TexParameter* vl::Texture::getTexParameter | ( | ) | const [inline] |
The TexParameter object associated to a Texture.
Definition at line 247 of file Texture.hpp.
| const TexParameter* vl::Texture::getTexParameterOverride | ( | ) | const [inline] |
The TexParameter belonging to a TextureSampler that is currently overriding the Texture's own TexParameter.
Definition at line 250 of file Texture.hpp.
| BufferObject* vl::Texture::bufferObject | ( | ) | [inline] |
The buffer object bound to a buffer object texture.
Definition at line 253 of file Texture.hpp.
Referenced by createTexture().
| const BufferObject* vl::Texture::bufferObject | ( | ) | const [inline] |
The buffer object bound to a buffer object texture.
Definition at line 256 of file Texture.hpp.
| void Texture::destroyTexture | ( | ) |
Destroys the texture.
Definition at line 359 of file Texture.cpp.
References mHandle.
Referenced by ~Texture().
| bool Texture::createTexture | ( | ) |
Creates a texture using the parameters specified by the last prepareTexture*() called.
Definition at line 1085 of file Texture.cpp.
References vl::Texture::SetupParams::border(), border(), bufferObject(), vl::Texture::SetupParams::depth(), vl::Texture::SetupParams::dimension(), vl::Log::error(), vl::Texture::SetupParams::format(), vl::Texture::SetupParams::genMipmaps(), vl::ref< T >::get(), vl::Texture::SetupParams::height(), vl::Texture::SetupParams::image(), vl::loadImage(), NULL, samples(), vl::Texture::SetupParams::setImage(), setMipLevel(), vl::Object::setObjectName(), setupParams(), vl::TF_UNKNOWN, VL_CHECK_OGL, and vl::Texture::SetupParams::width().
Referenced by vl::Rendering::fillRenderQueue(), and Texture().
| bool Texture::createTexture | ( | ETextureDimension | tex_dimension, |
| ETextureFormat | tex_format, | ||
| int | w, | ||
| int | h, | ||
| int | d, | ||
| bool | border, | ||
| BufferObject * | bo, | ||
| int | samples, | ||
| bool | fixedsamplelocations | ||
| ) |
Creates an empty texture, with no mipmaps, of the specified type, format and dimensions.
Definition at line 701 of file Texture.cpp.
References vl::Log::bug(), vl::Log::error(), vl::getGLErrorString(), vl::BufferObject::handle(), vl::ID_None, mBufferObject, mFixedSamplesLocation, mHandle, mSamples, NULL, samples(), setBorder(), setDepth(), setDimension(), setHeight(), setInternalFormat(), setWidth(), supports(), vl::TD_TEXTURE_1D, vl::TD_TEXTURE_1D_ARRAY, vl::TD_TEXTURE_2D, vl::TD_TEXTURE_2D_ARRAY, vl::TD_TEXTURE_2D_MULTISAMPLE, vl::TD_TEXTURE_2D_MULTISAMPLE_ARRAY, vl::TD_TEXTURE_3D, vl::TD_TEXTURE_BUFFER, vl::TD_TEXTURE_CUBE_MAP, vl::TD_TEXTURE_RECTANGLE, VL_CHECK, VL_CHECK_OGL, and VL_TRAP.
| bool Texture::setMipLevel | ( | int | mip_level, |
| const Image * | img, | ||
| bool | gen_mipmaps | ||
| ) |
Copies the texture image to the specified mip-maping level.
This function can be useful to specify one by one the mipmapping images or to create texture animation effects.
| mip_level | The mip-mapping level to be modified. |
| img | The Image containing the pixels to be copied into the specified mip-mapping level. |
| gen_mipmaps | If true automatically generates the mip-mapping images for the levels below mip_level. |
Definition at line 846 of file Texture.cpp.
References border(), vl::Log::bug(), vl::Image::byteAlignment(), depth(), vl::Image::depth(), vl::Image::dimension(), dimension(), vl::Log::error(), vl::Image::format(), vl::Has_GL_GENERATE_MIPMAP, vl::Has_glGenerateMipmaps, height(), vl::Image::height(), internalFormat(), isCompressedFormat(), mHandle, vl::Image::pixels(), vl::Image::pixelsXN(), vl::Image::pixelsXP(), vl::Image::pixelsYN(), vl::Image::pixelsYP(), vl::Image::pixelsZN(), vl::Image::pixelsZP(), vl::Image::requiredMemory(), supports(), vl::TD_TEXTURE_1D, vl::TD_TEXTURE_1D_ARRAY, vl::TD_TEXTURE_2D, vl::TD_TEXTURE_2D_ARRAY, vl::TD_TEXTURE_2D_MULTISAMPLE, vl::TD_TEXTURE_2D_MULTISAMPLE_ARRAY, vl::TD_TEXTURE_3D, vl::TD_TEXTURE_BUFFER, vl::TD_TEXTURE_CUBE_MAP, vl::TD_TEXTURE_RECTANGLE, vl::Image::type(), VL_CHECK, VL_CHECK_OGL, VL_IS_POW_2, VL_TRAP, vl::Log::warning(), width(), and vl::Image::width().
Referenced by createTexture().
| void vl::Texture::prepareTexture1D | ( | int | width, |
| ETextureFormat | format, | ||
| bool | border = false |
||
| ) | [inline] |
Prepares for creation an empty 1D texture.
Definition at line 280 of file Texture.hpp.
References NULL.
Referenced by Texture().
| bool vl::Texture::createTexture1D | ( | int | width, |
| ETextureFormat | format, | ||
| bool | border = false |
||
| ) | [inline] |
Creates an empty 1D texture.
Definition at line 287 of file Texture.hpp.
| void vl::Texture::prepareTexture1D | ( | const String & | image_path, |
| ETextureFormat | format, | ||
| bool | mipmaps = true, |
||
| bool | border = false |
||
| ) | [inline] |
Prepares for creation a 1D texture from the specified file.
Definition at line 294 of file Texture.hpp.
References NULL.
| bool vl::Texture::createTexture1D | ( | const String & | image_path, |
| ETextureFormat | format, | ||
| bool | mipmaps = true, |
||
| bool | border = false |
||
| ) | [inline] |
Creates a 1D texture from the specified file.
Definition at line 301 of file Texture.hpp.
| void vl::Texture::prepareTexture1D | ( | const Image * | image, |
| ETextureFormat | format, | ||
| bool | mipmaps = true, |
||
| bool | border = false |
||
| ) | [inline] |
Prepares for creation a 1D texture from the specified image.
Definition at line 308 of file Texture.hpp.
References vl::Texture::SetupParams::setImage(), and vl::TD_TEXTURE_1D.
| bool vl::Texture::createTexture1D | ( | const Image * | image, |
| ETextureFormat | format, | ||
| bool | mipmaps = true, |
||
| bool | border = false |
||
| ) | [inline] |
Creates a 1D texture from the specified image.
Definition at line 319 of file Texture.hpp.
| void vl::Texture::prepareTexture2D | ( | int | width, |
| int | height, | ||
| ETextureFormat | format, | ||
| bool | border = false |
||
| ) | [inline] |
Prepares for creation an empty 2D texture.
Definition at line 326 of file Texture.hpp.
References NULL.
Referenced by Texture().
| bool vl::Texture::createTexture2D | ( | int | width, |
| int | height, | ||
| ETextureFormat | format, | ||
| bool | border = false |
||
| ) | [inline] |
Creates an empty 2D texture.
Definition at line 334 of file Texture.hpp.
| void vl::Texture::prepareTexture2D | ( | const String & | image_path, |
| ETextureFormat | format, | ||
| bool | mipmaps = true, |
||
| bool | border = false |
||
| ) | [inline] |
Prepares for creation a 2D texture from the specified file.
Definition at line 341 of file Texture.hpp.
References NULL.
| bool vl::Texture::createTexture2D | ( | const String & | image_path, |
| ETextureFormat | format, | ||
| bool | mipmaps = true, |
||
| bool | border = false |
||
| ) | [inline] |
Creates a 2D texture from the specified file.
Definition at line 348 of file Texture.hpp.
| void vl::Texture::prepareTexture2D | ( | const Image * | image, |
| ETextureFormat | format, | ||
| bool | mipmaps = true, |
||
| bool | border = false |
||
| ) | [inline] |
Prepares for creation a 2D texture from the specified image.
Definition at line 355 of file Texture.hpp.
References vl::Texture::SetupParams::setImage(), and vl::TD_TEXTURE_2D.
| bool vl::Texture::createTexture2D | ( | const Image * | image, |
| ETextureFormat | format, | ||
| bool | mipmaps = true, |
||
| bool | border = false |
||
| ) | [inline] |
Creates a 2D texture from the specified image.
Definition at line 366 of file Texture.hpp.
| void vl::Texture::prepareTexture3D | ( | int | width, |
| int | height, | ||
| int | depth, | ||
| ETextureFormat | format, | ||
| bool | border = false |
||
| ) | [inline] |
Prepares for creation an empty 3D texture.
Definition at line 373 of file Texture.hpp.
References NULL.
Referenced by Texture().
| bool vl::Texture::createTexture3D | ( | int | width, |
| int | height, | ||
| int | depth, | ||
| ETextureFormat | format, | ||
| bool | border = false |
||
| ) | [inline] |
Creates an empty 3D texture.
Definition at line 382 of file Texture.hpp.
| void vl::Texture::prepareTexture3D | ( | const String & | image_path, |
| ETextureFormat | format, | ||
| bool | mipmaps = true, |
||
| bool | border = false |
||
| ) | [inline] |
Prepares for creation a 3D texture from the specified file.
Definition at line 389 of file Texture.hpp.
References NULL.
| bool vl::Texture::createTexture3D | ( | const String & | image_path, |
| ETextureFormat | format, | ||
| bool | mipmaps = true, |
||
| bool | border = false |
||
| ) | [inline] |
Creates a 3D texture from the specified file.
Definition at line 396 of file Texture.hpp.
| void vl::Texture::prepareTexture3D | ( | const Image * | image, |
| ETextureFormat | format, | ||
| bool | mipmaps = true, |
||
| bool | border = false |
||
| ) | [inline] |
Prepares for creation a 3D texture from the specified image.
Definition at line 403 of file Texture.hpp.
References vl::Texture::SetupParams::setImage(), and vl::TD_TEXTURE_3D.
| bool vl::Texture::createTexture3D | ( | const Image * | image, |
| ETextureFormat | format, | ||
| bool | mipmaps = true, |
||
| bool | border = false |
||
| ) | [inline] |
Creates a 3D texture from the specified image.
Definition at line 414 of file Texture.hpp.
| void vl::Texture::prepareTextureCubemap | ( | int | width, |
| int | height, | ||
| ETextureFormat | format, | ||
| bool | border = false |
||
| ) | [inline] |
Prepares for creation an empty cubemap texture.
Definition at line 421 of file Texture.hpp.
References NULL.
Referenced by Texture().
| bool vl::Texture::createTextureCubemap | ( | int | width, |
| int | height, | ||
| ETextureFormat | format, | ||
| bool | border = false |
||
| ) | [inline] |
Creates an empty cubemap texture.
Definition at line 429 of file Texture.hpp.
| void vl::Texture::prepareTextureCubemap | ( | const String & | image_path, |
| ETextureFormat | format, | ||
| bool | mipmaps = true, |
||
| bool | border = false |
||
| ) | [inline] |
Prepares for creation a cubemap texture from the specified file.
Definition at line 436 of file Texture.hpp.
References NULL.
| bool vl::Texture::createTextureCubemap | ( | const String & | image_path, |
| ETextureFormat | format, | ||
| bool | mipmaps = true, |
||
| bool | border = false |
||
| ) | [inline] |
Creates creation a cubemap texture from the specified file.
Definition at line 443 of file Texture.hpp.
| void vl::Texture::prepareTextureCubemap | ( | const Image * | image, |
| ETextureFormat | format, | ||
| bool | mipmaps = true, |
||
| bool | border = false |
||
| ) | [inline] |
Prepares for creation a cubemap texture from the specified image.
Definition at line 450 of file Texture.hpp.
References vl::Texture::SetupParams::setImage(), and vl::TD_TEXTURE_CUBE_MAP.
| bool vl::Texture::createTextureCubemap | ( | const Image * | image, |
| ETextureFormat | format, | ||
| bool | mipmaps = true, |
||
| bool | border = false |
||
| ) | [inline] |
Creates a cubemap texture from the specified image.
Definition at line 461 of file Texture.hpp.
| void vl::Texture::prepareTexture1DArray | ( | int | width, |
| int | count, | ||
| ETextureFormat | format | ||
| ) | [inline] |
Prepares for creation an empty 1D array texture.
Definition at line 468 of file Texture.hpp.
References NULL.
| bool vl::Texture::createTexture1DArray | ( | int | width, |
| int | count, | ||
| ETextureFormat | format | ||
| ) | [inline] |
Creates an empty 1D array texture.
Definition at line 476 of file Texture.hpp.
| void vl::Texture::prepareTexture1DArray | ( | const String & | image_path, |
| ETextureFormat | format, | ||
| bool | mipmaps = true |
||
| ) | [inline] |
Prepares for creation a 1d texture array from the specified file.
Definition at line 483 of file Texture.hpp.
References NULL.
| bool vl::Texture::createTexture1DArray | ( | const String & | image_path, |
| ETextureFormat | format, | ||
| bool | mipmaps = true |
||
| ) | [inline] |
Creates a 1d texture array from the specified file.
Definition at line 490 of file Texture.hpp.
| void vl::Texture::prepareTexture1DArray | ( | const Image * | image, |
| ETextureFormat | format, | ||
| bool | mipmaps = true |
||
| ) | [inline] |
Prepares for creation a 1d texture array from the specified image.
Definition at line 497 of file Texture.hpp.
References vl::Texture::SetupParams::setImage(), and vl::TD_TEXTURE_1D_ARRAY.
| bool vl::Texture::createTexture1DArray | ( | const Image * | image, |
| ETextureFormat | format, | ||
| bool | mipmaps = true |
||
| ) | [inline] |
Creates a 1d texture array from the specified image.
Definition at line 508 of file Texture.hpp.
| void vl::Texture::prepareTexture2DArray | ( | int | width, |
| int | height, | ||
| int | count, | ||
| ETextureFormat | format | ||
| ) | [inline] |
Prepares for creation an empty 2D array texture.
Definition at line 515 of file Texture.hpp.
References NULL.
| bool vl::Texture::createTexture2DArray | ( | int | width, |
| int | height, | ||
| int | count, | ||
| ETextureFormat | format | ||
| ) | [inline] |
Creates an empty 2D array texture.
Definition at line 524 of file Texture.hpp.
| void vl::Texture::prepareTexture2DArray | ( | const String & | image_path, |
| ETextureFormat | format, | ||
| bool | mipmaps = true |
||
| ) | [inline] |
Prepares for creation a 2d texture array from the specified file.
Definition at line 531 of file Texture.hpp.
References NULL.
| bool vl::Texture::createTexture2DArray | ( | const String & | image_path, |
| ETextureFormat | format, | ||
| bool | mipmaps = true |
||
| ) | [inline] |
Creates a 2d texture array from the specified file.
Definition at line 538 of file Texture.hpp.
| void vl::Texture::prepareTexture2DArray | ( | const Image * | image, |
| ETextureFormat | format, | ||
| bool | mipmaps = true |
||
| ) | [inline] |
Prepares for creation a 2d texture array from the specified image.
Definition at line 545 of file Texture.hpp.
References vl::Texture::SetupParams::setImage(), and vl::TD_TEXTURE_2D_ARRAY.
| bool vl::Texture::createTexture2DArray | ( | const Image * | image, |
| ETextureFormat | format, | ||
| bool | mipmaps = true |
||
| ) | [inline] |
Creates a 2d texture array from the specified image.
Definition at line 556 of file Texture.hpp.
| void vl::Texture::prepareTextureRectangle | ( | int | width, |
| int | height, | ||
| ETextureFormat | format | ||
| ) | [inline] |
Prepares for creation an empty texture rectangle.
Definition at line 563 of file Texture.hpp.
References NULL.
| bool vl::Texture::createTextureRectangle | ( | int | width, |
| int | height, | ||
| ETextureFormat | format | ||
| ) | [inline] |
Creates an empty texture rectangle.
Definition at line 571 of file Texture.hpp.
| void vl::Texture::prepareTextureRectangle | ( | const String & | image_path, |
| ETextureFormat | format | ||
| ) | [inline] |
Prepares for creation a texture rectangle from the specified file.
Definition at line 578 of file Texture.hpp.
References NULL.
| bool vl::Texture::createTextureRectangle | ( | const String & | image_path, |
| ETextureFormat | format | ||
| ) | [inline] |
Creates a texture rectangle from the specified file.
Definition at line 585 of file Texture.hpp.
| void vl::Texture::prepareTextureRectangle | ( | const Image * | image, |
| ETextureFormat | format | ||
| ) | [inline] |
Prepares for creation a texture rectangle from the specified image.
Definition at line 592 of file Texture.hpp.
References vl::Texture::SetupParams::setImage(), and vl::TD_TEXTURE_RECTANGLE.
| bool vl::Texture::createTextureRectangle | ( | const Image * | image, |
| ETextureFormat | format | ||
| ) | [inline] |
Creates a texture rectangle from the specified image.
Definition at line 603 of file Texture.hpp.
| void vl::Texture::prepareTextureBuffer | ( | vl::ETextureFormat | format, |
| BufferObject * | bo | ||
| ) | [inline] |
Prepares a texture buffer texture.
The BufferObject can come from an Array* or from ImagePBO or can be a stand-alone BufferObject as well.
Definition at line 610 of file Texture.hpp.
References vl::Texture::SetupParams::setDimension(), and vl::TD_TEXTURE_BUFFER.
| bool vl::Texture::createTextureBuffer | ( | vl::ETextureFormat | format, |
| BufferObject * | bo | ||
| ) | [inline] |
Creates a texture buffer texture.
The BufferObject can come from an Array* or from ImagePBO or can be a stand-alone BufferObject as well.
Definition at line 621 of file Texture.hpp.
| void vl::Texture::prepareTexture2DMultisample | ( | int | width, |
| int | height, | ||
| vl::ETextureFormat | format, | ||
| int | samples, | ||
| bool | fixedsamplelocations | ||
| ) | [inline] |
Prepares a 2D multisample texture.
Definition at line 628 of file Texture.hpp.
References vl::Texture::SetupParams::setDimension(), and vl::TD_TEXTURE_2D_MULTISAMPLE.
| bool vl::Texture::createTexture2DMultisample | ( | int | width, |
| int | height, | ||
| vl::ETextureFormat | format, | ||
| int | samples, | ||
| bool | fixedsamplelocations | ||
| ) | [inline] |
Creates a 2D multisample texture.
Definition at line 642 of file Texture.hpp.
| void vl::Texture::prepareTexture2DMultisampleArray | ( | int | width, |
| int | height, | ||
| int | depth, | ||
| vl::ETextureFormat | format, | ||
| int | samples, | ||
| bool | fixedsamplelocations | ||
| ) | [inline] |
Prepares a 3D multisample texture.
Definition at line 649 of file Texture.hpp.
References vl::Texture::SetupParams::setDimension(), and vl::TD_TEXTURE_2D_MULTISAMPLE_ARRAY.
| bool vl::Texture::createTexture2DMultisampleArray | ( | int | width, |
| int | height, | ||
| int | depth, | ||
| vl::ETextureFormat | format, | ||
| int | samples, | ||
| bool | fixedsamplelocations | ||
| ) | [inline] |
Creates a 3D multisample texture.
Definition at line 664 of file Texture.hpp.
| bool Texture::isValid | ( | ) | const |
| unsigned int vl::Texture::handle | ( | ) | const [inline] |
OpenGL texture handle as returned by glGenTextures().
Definition at line 674 of file Texture.hpp.
Referenced by isValid().
| void vl::Texture::setHandle | ( | unsigned int | id ) | [inline] |
OpenGL texture handle as returned by glGenTextures().
Definition at line 676 of file Texture.hpp.
| void vl::Texture::setDimension | ( | ETextureDimension | dimension ) | [inline] |
The texture type (1d, 2d, cubemap etc.) as specified by the target parameter of glTexImage*().
Definition at line 679 of file Texture.hpp.
Referenced by createTexture().
| ETextureDimension vl::Texture::dimension | ( | ) | const [inline] |
The texture type (1d, 2d, cubemap etc.) as specified by the target parameter of glTexImage*().
Definition at line 681 of file Texture.hpp.
Referenced by vl::TextureSampler::apply(), vl::FBOTexture2DAttachment::bindAttachment(), and setMipLevel().
| void vl::Texture::setInternalFormat | ( | ETextureFormat | format ) | [inline] |
The texture internal format as pecified by the internalFormat parameter of glTexImage*().
Definition at line 684 of file Texture.hpp.
Referenced by createTexture().
| ETextureFormat vl::Texture::internalFormat | ( | ) | const [inline] |
The texture internal format as pecified by the internalFormat parameter of glTexImage*().
Definition at line 686 of file Texture.hpp.
Referenced by isDepthTexture(), and setMipLevel().
| void vl::Texture::setWidth | ( | int | x ) | [inline] |
The horizontal dimension of the texture in texels.
Definition at line 689 of file Texture.hpp.
Referenced by createTexture().
| int vl::Texture::width | ( | ) | const [inline] |
The horizontal dimension of the texture in texels.
Definition at line 691 of file Texture.hpp.
Referenced by vl::FBOTextureLayerAttachment::bindAttachment(), vl::FBOTexture3DAttachment::bindAttachment(), vl::FBOTexture2DAttachment::bindAttachment(), vl::FBOTexture1DAttachment::bindAttachment(), setMipLevel(), and supports().
| void vl::Texture::setHeight | ( | int | y ) | [inline] |
The vertical dimension of the texture in texels.
Definition at line 694 of file Texture.hpp.
Referenced by createTexture().
| int vl::Texture::height | ( | ) | const [inline] |
The vertical dimension of the texture in texels.
Definition at line 696 of file Texture.hpp.
Referenced by vl::FBOTextureLayerAttachment::bindAttachment(), vl::FBOTexture3DAttachment::bindAttachment(), vl::FBOTexture2DAttachment::bindAttachment(), and setMipLevel().
| void vl::Texture::setDepth | ( | int | z ) | [inline] |
The z dimension of the texture in texels.
Definition at line 699 of file Texture.hpp.
Referenced by createTexture().
| int vl::Texture::depth | ( | ) | const [inline] |
The z dimension of the texture in texels.
Definition at line 701 of file Texture.hpp.
Referenced by setMipLevel().
| void vl::Texture::setBorder | ( | bool | border ) | [inline] |
Whether the texture has a 1 pixel texture border or not.
Definition at line 704 of file Texture.hpp.
Referenced by createTexture().
| bool vl::Texture::border | ( | ) | const [inline] |
Whether the texture has a 1 pixel texture border or not.
Definition at line 706 of file Texture.hpp.
Referenced by createTexture(), setMipLevel(), and Texture().
| int vl::Texture::samples | ( | ) | const [inline] |
Returns the number of samples of a multisample texture.
Definition at line 709 of file Texture.hpp.
Referenced by createTexture().
| bool vl::Texture::fixedSamplesLocation | ( | ) | const [inline] |
Returns whether the samples location is fixed for a a multisample texture.
Definition at line 712 of file Texture.hpp.
| const SetupParams* vl::Texture::setupParams | ( | ) | const [inline] |
See SetupParams.
Definition at line 715 of file Texture.hpp.
Referenced by createTexture(), vl::VLXClassWrapper_Texture::exportTexture(), vl::Rendering::fillRenderQueue(), and vl::VLXClassWrapper_Texture::importTexture().
| SetupParams* vl::Texture::setupParams | ( | ) | [inline] |
See SetupParams.
Definition at line 718 of file Texture.hpp.
| void vl::Texture::setSetupParams | ( | SetupParams * | setup_params ) | [inline] |
See SetupParams.
Definition at line 721 of file Texture.hpp.
Referenced by vl::VLXClassWrapper_Texture::importTexture().
| bool Texture::supports | ( | ETextureDimension | tex_dimension, |
| ETextureFormat | tex_format, | ||
| int | mip_level, | ||
| EImageDimension | img_dimension, | ||
| int | w, | ||
| int | h, | ||
| int | d, | ||
| bool | border, | ||
| int | samples, | ||
| bool | fixedsamplelocations, | ||
| bool | verbose | ||
| ) | [static] |
Checks whether the specified texture type, format and dimension combination is supported by the current OpenGL driver.
Definition at line 493 of file Texture.cpp.
References vl::Log::error(), vl::Has_Cubemap_Textures, vl::Has_Texture_Array, vl::Has_Texture_Buffer, vl::Has_Texture_Multisample, vl::Has_Texture_Rectangle, vl::ID_2D, vl::ID_3D, NULL, vl::TD_TEXTURE_1D, vl::TD_TEXTURE_1D_ARRAY, vl::TD_TEXTURE_2D, vl::TD_TEXTURE_2D_ARRAY, vl::TD_TEXTURE_2D_MULTISAMPLE, vl::TD_TEXTURE_2D_MULTISAMPLE_ARRAY, vl::TD_TEXTURE_3D, vl::TD_TEXTURE_BUFFER, vl::TD_TEXTURE_CUBE_MAP, vl::TD_TEXTURE_RECTANGLE, VL_CHECK, VL_CHECK_OGL, and width().
Referenced by createTexture(), and setMipLevel().
| bool Texture::isCompressedFormat | ( | int | format ) | [static] |
Returns true if the specified format is compressed.
Definition at line 1227 of file Texture.cpp.
References vl::TF_COMPRESSED_ALPHA, vl::TF_COMPRESSED_INTENSITY, vl::TF_COMPRESSED_LUMINANCE, vl::TF_COMPRESSED_LUMINANCE_ALPHA, vl::TF_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT, vl::TF_COMPRESSED_LUMINANCE_LATC1_EXT, vl::TF_COMPRESSED_RED_GREEN_RGTC2_EXT, vl::TF_COMPRESSED_RED_RGTC1_EXT, vl::TF_COMPRESSED_RGB, vl::TF_COMPRESSED_RGB_FXT1_3DFX, vl::TF_COMPRESSED_RGB_S3TC_DXT1_EXT, vl::TF_COMPRESSED_RGBA, vl::TF_COMPRESSED_RGBA_FXT1_3DFX, vl::TF_COMPRESSED_RGBA_S3TC_DXT1_EXT, vl::TF_COMPRESSED_RGBA_S3TC_DXT3_EXT, vl::TF_COMPRESSED_RGBA_S3TC_DXT5_EXT, vl::TF_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT, vl::TF_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT, vl::TF_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT, and vl::TF_COMPRESSED_SIGNED_RED_RGTC1_EXT.
Referenced by setMipLevel().
| bool Texture::isDepthTexture | ( | ) | const |
Returns true if the texture is a depth or depth/stencil textre.
Definition at line 1206 of file Texture.cpp.
References internalFormat(), vl::TF_DEPTH24_STENCIL8, vl::TF_DEPTH32F_STENCIL8, vl::TF_DEPTH_COMPONENT, vl::TF_DEPTH_COMPONENT16, vl::TF_DEPTH_COMPONENT24, vl::TF_DEPTH_COMPONENT32, vl::TF_DEPTH_COMPONENT32F, and vl::TF_DEPTH_STENCIL.
| void Texture::clone | ( | const Texture & | other ) |
Copies all the texture parameters form the specified texture, including the OpenGL texture handle.
Mainly useful when you want to use the same texture object with different texture parameters.
Definition at line 1186 of file Texture.cpp.
References mBorder, mBufferObject, mDepth, mDimension, mFixedSamplesLocation, mFormat, mHandle, mHeight, mSamples, mSetupParams, mTexParameter, mWidth, and NULL.
friend class TextureSampler [friend] |
Definition at line 144 of file Texture.hpp.
unsigned int vl::Texture::mHandle [protected] |
Definition at line 742 of file Texture.hpp.
Referenced by clone(), createTexture(), destroyTexture(), and setMipLevel().
ref<TexParameter> vl::Texture::mTexParameter [protected] |
Definition at line 743 of file Texture.hpp.
ref<TexParameter> vl::Texture::mTexParameterOverride [mutable, protected] |
Definition at line 744 of file Texture.hpp.
Referenced by vl::TextureSampler::apply().
ref<SetupParams> vl::Texture::mSetupParams [protected] |
Definition at line 745 of file Texture.hpp.
Referenced by clone().
ref<BufferObject> vl::Texture::mBufferObject [protected] |
Definition at line 746 of file Texture.hpp.
Referenced by clone(), and createTexture().
ETextureFormat vl::Texture::mFormat [protected] |
Definition at line 747 of file Texture.hpp.
Referenced by clone().
ETextureDimension vl::Texture::mDimension [protected] |
Definition at line 748 of file Texture.hpp.
Referenced by clone().
int vl::Texture::mWidth [protected] |
Definition at line 749 of file Texture.hpp.
int vl::Texture::mHeight [protected] |
Definition at line 750 of file Texture.hpp.
int vl::Texture::mDepth [protected] |
Definition at line 751 of file Texture.hpp.
int vl::Texture::mSamples [protected] |
Definition at line 752 of file Texture.hpp.
Referenced by clone(), and createTexture().
bool vl::Texture::mBorder [protected] |
Definition at line 753 of file Texture.hpp.
Referenced by clone().
bool vl::Texture::mFixedSamplesLocation [protected] |
Definition at line 754 of file Texture.hpp.
Referenced by clone(), and createTexture().