LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::Texture Class Referenceabstract

Texture interface. More...

#include <Texture.h>

Inheritance diagram for LLGL::Texture:
LLGL::Resource LLGL::RenderSystemChild LLGL::Interface LLGL::NonCopyable

Public Member Functions

ResourceType GetResourceType () const override final
 Returns ResourceType::Texture.
TextureType GetType () const
 Returns the type of this texture.
long GetBindFlags () const
virtual TextureDescriptor GetDesc () const =0
 Queries a descriptor of this texture.
virtual Format GetFormat () const =0
 Returns the hardware format of this texture.
virtual Extent3D GetMipExtent (std::uint32_t mipLevel) const =0
 Returns the texture extent for the specified MIP-level. This also includes the number of array layers.
virtual SubresourceFootprint GetSubresourceFootprint (std::uint32_t mipLevel) const =0
 Returns the memory footprint of the specified MIP-map subresource.
Public Member Functions inherited from LLGL::Resource
virtual bool GetNativeHandle (void *nativeHandle, std::size_t nativeHandleSize)=0
 Returns the native resource handle.
Public Member Functions inherited from LLGL::RenderSystemChild
virtual void SetDebugName (const char *name)
 Sets the name of this class instance for debugging purposes.
Public Member Functions inherited from LLGL::Interface
virtual bool IsInstanceOf (int id) const
 Returns true if this object is an instance of the specified interface.
Public Member Functions inherited from LLGL::NonCopyable
 NonCopyable (const NonCopyable &)=delete
NonCopyable & operator= (const NonCopyable &)=delete
virtual ~NonCopyable ()=default

Protected Member Functions

 Texture (const TextureType type, long bindFlags)
Protected Member Functions inherited from LLGL::NonCopyable
 NonCopyable ()=default

Detailed Description

Constructor & Destructor Documentation

◆ Texture()

LLGL::Texture::Texture ( const TextureType type,
long bindFlags )
protected

Member Function Documentation

◆ GetBindFlags()

long LLGL::Texture::GetBindFlags ( ) const
inline

◆ GetDesc()

virtual TextureDescriptor LLGL::Texture::GetDesc ( ) const
pure virtual

Queries a descriptor of this texture.

Remarks
This function only queries the following attributes:
  • type
  • bindFlags
  • format
  • extent
  • arrayLayers
  • mipLevels
  • samples
All other attributes (i.e. miscFlags and clearValue) cannot be queried by this function. Those attributes are either set to zero (for flags) or the default value specified in TextureDescriptor is used. If only the texture format is required, use GetFormat instead.
See also
TextureDescriptor
GetFormat
Buffer::GetDesc

◆ GetFormat()

virtual Format LLGL::Texture::GetFormat ( ) const
pure virtual

Returns the hardware format of this texture.

Remarks
This is usually the format this texture was created with. However, sometimes the internal hardware format might be different from what the client programmer requested, especially with the OpenGL backend. This function returns the actual internal hardware format.
See also
TextureDescriptor::format.

◆ GetMipExtent()

virtual Extent3D LLGL::Texture::GetMipExtent ( std::uint32_t mipLevel) const
pure virtual

Returns the texture extent for the specified MIP-level. This also includes the number of array layers.

Parameters
[in]mipLevelSpecifies the MIP-map level to query from. The first and largest MIP-map is level zero. If this level is greater than or equal to the maximum number of MIP-maps for this texture, the return value is undefined (i.e. depends on the render system).
Remarks
For a 1D array texture, the number of array layers is stored in the height extent.
For a 2D and cube array texture, the number of array layers is stored in the depth extent.
For cube textures and cube array textures (i.e. texture type TextureType::TextureCube and TextureType::TextureCubeArray), the depth extent will be a multiple of 6.
See also
TextureDescriptor::mipLevels
CommandBuffer::GenerateMips
NumMipDimensions
LLGL::GetMipExtent

◆ GetResourceType()

ResourceType LLGL::Texture::GetResourceType ( ) const
finaloverridevirtual

Returns ResourceType::Texture.

Implements LLGL::Resource.

◆ GetSubresourceFootprint()

virtual SubresourceFootprint LLGL::Texture::GetSubresourceFootprint ( std::uint32_t mipLevel) const
pure virtual

Returns the memory footprint of the specified MIP-map subresource.

Parameters
[in]mipLevelSpecifies the MIP-map level to query from. The first and largest MIP-map level is zero.
Returns
Memory footprint of the specified subresource. If this operation failed, all fields in the returned structure are default initialized.
See also
GetMipExtent

◆ GetType()

TextureType LLGL::Texture::GetType ( ) const
inline

Returns the type of this texture.


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