clan::Texture Class Reference - ClanLib SDK
Description: clan::Texture Class Reference

Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
clan::Texture Class Reference
clanDisplay Display

Texture object class. More...

`#include <texture.h>`

Inheritance diagram for clan::Texture:

## Public Member Functions
| Texture ()
| Constructs a null instance.
| Texture (const std::shared_ptr< Texture_Impl > &impl)
| Constructs a texture from an implementation.
| Texture (GraphicContext &gc, PixelBufferSet pixelbuffer_set)
| Constructs a texture as described in a pixelbuffer set.
| Texture (std::unique_ptr< TextureProvider > provider)
| Constructs a texture from a texture provider.
virtual | ~Texture ()
void | generate_mipmap ()
| Generate the mipmap.
int | get_base_level () const
| Get the texture base level.
CompareFunction | get_compare_function () const
| Get the texture compare function.
TextureCompareMode | get_compare_mode () const
| Get the texture compare mode.
std::weak_ptr< Texture_Impl > | get_impl () const
| Get the implementation weakptr.
float | get_lod_bias () const
| Get the level of detail bias constant.
TextureFilter | get_mag_filter () const
| Get the texture magnification filter.
int | get_max_level () const
| Get the texture max level.
float | get_max_lod () const
| Get the maximum level of detail.
TextureFilter | get_min_filter () const
| Get the texture minification filter.
float | get_min_lod () const
| Get the minimum level of detail.
TextureProvider * | get_provider () const
| Get Provider.
bool | is_null () const
| Returns true if this object is invalid.
bool | is_resident () const
| Returns true if texture is resident in texture memory.
| operator bool () const
bool | operator!= (const Texture &other) const
| Inequality operator.
bool | operator< (const Texture &other) const
| Less than operator.
bool | operator== (const Texture &other) const
| Equality operator.
void | set_base_level (int base_level)
| Sets the texture base level texture parameter.
void | set_lod_bias (float lod_bias)
| Sets the level of detail bias constant.
void | set_mag_filter (TextureFilter filter)
| Set the magnification filter.
void | set_max_anisotropy (float max_anisotropy)
| Set the maximum degree of anisotropy.
void | set_max_level (int max_level)
| Sets the texture max level texture parameter.
void | set_max_lod (float max_lod)
| Set the maximum level of detail texture parameter.
void | set_min_filter (TextureFilter filter)
| Set the minification filter.
void | set_min_lod (float min_lod)
| Set the minimum level of detail texture parameter.
void | set_texture_compare (TextureCompareMode mode, CompareFunction func)
| Sets the texture compare mode and compare function texture parameters.
void | throw_if_null () const
| Throw an exception if this object is invalid.
Texture1D | to_texture_1d () const
| Dynamic cast to Texture1D.
Texture1DArray | to_texture_1d_array () const
| Dynamic cast to Texture1DArray.
Texture2D | to_texture_2d () const
| Dynamic cast to Texture2D.
Texture2DArray | to_texture_2d_array () const
| Dynamic cast to Texture2DArray.
Texture3D | to_texture_3d () const
| Dynamic cast to Texture3D.
TextureCube | to_texture_cube () const
| Dynamic cast to TextureCube.
TextureCubeArray | to_texture_cube_array () const
| Dynamic cast to TextureCubeArray.

## Static Public Member Functions
static Texture | load (GraphicContext &gc, const std::string &id, const XMLResourceDocument &doc, const ImageImportDescription &import_desc=ImageImportDescription())
| Loads a Texture from a XML resource definition.
static Resource< Texture > | resource (GraphicContext &gc, const std::string &id, const ResourceManager &resources)
| Retrieves a Texture resource from the resource manager.

## Protected Attributes
std::shared_ptr< Texture_Impl > | impl

## Friends
class | Texture2DArray

## Detailed Description

Texture object class.

## Constructor & Destructor Documentation

## ◆ Texture() [1/4]

clan::Texture::Texture | ( |  | ) |

Constructs a null instance.

Referenced by clan::Texture1D::Texture1D(), clan::Texture1DArray::Texture1DArray(), clan::Texture2D::Texture2D(), clan::Texture2DArray::Texture2DArray(), clan::Texture3D::Texture3D(), clan::TextureCube::TextureCube(), clan::TextureCubeArray::TextureCubeArray(), load(), operator!=(), operator<(), and operator==().

## ◆ Texture() [2/4]

clan::Texture::Texture | ( | GraphicContext & | gc,
|  | PixelBufferSet | pixelbuffer_set )

Constructs a texture as described in a pixelbuffer set.

## ◆ Texture() [3/4]

clan::Texture::Texture | ( | const std::shared_ptr< Texture_Impl > & | impl | ) |

Constructs a texture from an implementation.

Parameters

  impl | = The implementation

References impl.

## ◆ Texture() [4/4]

clan::Texture::Texture | ( | std::unique_ptr< TextureProvider > | provider | ) |

Constructs a texture from a texture provider.

Parameters

  provider | = The provider

## ◆ ~Texture()

virtual clan::Texture::~Texture | ( |  | ) |
| virtual

## Member Function Documentation

## ◆ generate_mipmap()

void clan::Texture::generate_mipmap | ( |  | ) |

Generate the mipmap.

## ◆ get_base_level()

int clan::Texture::get_base_level | ( |  | ) | const

Get the texture base level.

## ◆ get_compare_function()

CompareFunction clan::Texture::get_compare_function | ( |  | ) | const

Get the texture compare function.

## ◆ get_compare_mode()

TextureCompareMode clan::Texture::get_compare_mode | ( |  | ) | const

Get the texture compare mode.

## ◆ get_impl()

std::weak_ptr< Texture_Impl > clan::Texture::get_impl | ( |  | ) | const

Get the implementation weakptr.

This is used to assist is creating Texture caches internally within clanlib

## ◆ get_lod_bias()

float clan::Texture::get_lod_bias | ( |  | ) | const

Get the level of detail bias constant.

## ◆ get_mag_filter()

TextureFilter clan::Texture::get_mag_filter | ( |  | ) | const

Get the texture magnification filter.

## ◆ get_max_level()

int clan::Texture::get_max_level | ( |  | ) | const

Get the texture max level.

## ◆ get_max_lod()

float clan::Texture::get_max_lod | ( |  | ) | const

Get the maximum level of detail.

## ◆ get_min_filter()

TextureFilter clan::Texture::get_min_filter | ( |  | ) | const

Get the texture minification filter.

## ◆ get_min_lod()

float clan::Texture::get_min_lod | ( |  | ) | const

Get the minimum level of detail.

## ◆ get_provider()

TextureProvider * clan::Texture::get_provider | ( |  | ) | const

Get Provider.

Returns
  provider

## ◆ is_null()

bool clan::Texture::is_null | ( |  | ) | const
| inline

Returns true if this object is invalid.

References impl.

## ◆ is_resident()

bool clan::Texture::is_resident | ( |  | ) | const

Returns true if texture is resident in texture memory.

## ◆ load()

Texture clan::Texture::load | ( | GraphicContext & | gc,
|  | const std::string & | id,
|  | const XMLResourceDocument & | doc,
|  | const ImageImportDescription & | import_desc = ImageImportDescription() )
| static

Loads a Texture from a XML resource definition.

References Texture().

## ◆ operator bool()

clan::Texture::operator bool | ( |  | ) | const
| inlineexplicit

References impl.

## ◆ operator!=()

bool clan::Texture::operator!= | ( | const Texture & | other | ) | const
| inline

Inequality operator.

References Texture(), and impl.

## ◆ operator<()

bool clan::Texture::operator< | ( | const Texture & | other | ) | const
| inline

Less than operator.

References Texture(), and impl.

## ◆ operator==()

bool clan::Texture::operator== | ( | const Texture & | other | ) | const
| inline

Equality operator.

References Texture(), and impl.

## ◆ resource()

Resource< Texture > clan::Texture::resource | ( | GraphicContext & | gc,
|  | const std::string & | id,
|  | const ResourceManager & | resources )
| static

Retrieves a Texture resource from the resource manager.

Parameters

  gc | = Graphic Context
  resources | = Resource manager
  id | = id

## ◆ set_base_level()

void clan::Texture::set_base_level | ( | int | base_level | ) |

Sets the texture base level texture parameter.

## ◆ set_lod_bias()

void clan::Texture::set_lod_bias | ( | float | lod_bias | ) |

Sets the level of detail bias constant.

## ◆ set_mag_filter()

void clan::Texture::set_mag_filter | ( | TextureFilter | filter | ) |

Set the magnification filter.

## ◆ set_max_anisotropy()

void clan::Texture::set_max_anisotropy | ( | float | max_anisotropy | ) |

Set the maximum degree of anisotropy.

## ◆ set_max_level()

void clan::Texture::set_max_level | ( | int | max_level | ) |

Sets the texture max level texture parameter.

## ◆ set_max_lod()

void clan::Texture::set_max_lod | ( | float | max_lod | ) |

Set the maximum level of detail texture parameter.

## ◆ set_min_filter()

void clan::Texture::set_min_filter | ( | TextureFilter | filter | ) |

Set the minification filter.

## ◆ set_min_lod()

void clan::Texture::set_min_lod | ( | float | min_lod | ) |

Set the minimum level of detail texture parameter.

## ◆ set_texture_compare()

void clan::Texture::set_texture_compare | ( | TextureCompareMode | mode,
|  | CompareFunction | func )

Sets the texture compare mode and compare function texture parameters.

## ◆ throw_if_null()

void clan::Texture::throw_if_null | ( |  | ) | const

Throw an exception if this object is invalid.

## ◆ to_texture_1d()

Texture1D clan::Texture::to_texture_1d | ( |  | ) | const

Dynamic cast to Texture1D.

## ◆ to_texture_1d_array()

Texture1DArray clan::Texture::to_texture_1d_array | ( |  | ) | const

Dynamic cast to Texture1DArray.

## ◆ to_texture_2d()

Texture2D clan::Texture::to_texture_2d | ( |  | ) | const

Dynamic cast to Texture2D.

## ◆ to_texture_2d_array()

Texture2DArray clan::Texture::to_texture_2d_array | ( |  | ) | const

Dynamic cast to Texture2DArray.

References Texture2DArray.

## ◆ to_texture_3d()

Texture3D clan::Texture::to_texture_3d | ( |  | ) | const

Dynamic cast to Texture3D.

## ◆ to_texture_cube()

TextureCube clan::Texture::to_texture_cube | ( |  | ) | const

Dynamic cast to TextureCube.

## ◆ to_texture_cube_array()

TextureCubeArray clan::Texture::to_texture_cube_array | ( |  | ) | const

Dynamic cast to TextureCubeArray.

## Friends And Related Symbol Documentation

## ◆ Texture2DArray

friend class Texture2DArray
| friend

References Texture2DArray.

Referenced by Texture2DArray, and to_texture_2d_array().

## Member Data Documentation

## ◆ impl

std::shared_ptr<Texture_Impl> clan::Texture::impl
| protected

Referenced by Texture(), clan::Texture1D::Texture1D(), clan::Texture1DArray::Texture1DArray(), clan::Texture2D::Texture2D(), clan::Texture2DArray::Texture2DArray(), clan::Texture3D::Texture3D(), clan::TextureCube::TextureCube(), clan::TextureCubeArray::TextureCubeArray(), is_null(), operator bool(), operator!=(), operator<(), and operator==().

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

- texture.h