Axmol 3.0.0-89d6d9a
Loading...
Searching...
No Matches
Texture Class Referenceabstract

A base texture. More...

#include <Texture.h>

Inherits Object.

Inherited by TextureImpl, TextureImpl, TextureImpl, TextureImpl, and TextureImpl.

Public Member Functions

virtual void updateSamplerDesc (const SamplerDesc &desc)=0
 Update sampler.
virtual void updateTextureDesc (const TextureDesc &desc)
 Update texture description.
PixelFormat getPixelFormat () const
 Get texture format.
TextureUsage getTextureUsage () const
 Get texture usage.
TextureType getTextureType () const
 Get texture type.
bool hasMipmaps () const
 Check if mipmap had generated before.
virtual void updateData (const void *data, int width, int height, int level, int layerIndex)=0
 Update a two-dimensional texture image.
virtual void updateCompressedData (const void *data, int width, int height, size_t dataSize, int level, int layerIndex)=0
 Update a two-dimensional texture image in a compressed format.
virtual void updateSubData (int xoffset, int yoffset, int width, int height, int level, const void *data, int layerIndex)=0
 Update a two-dimensional texture subimage.
virtual void updateCompressedSubData (int xoffset, int yoffset, int width, int height, size_t dataSize, int level, const void *data, int layerIndex)=0
 Update a two-dimensional texture subimage in a compressed format.
virtual void updateFaceData (TextureCubeFace side, const void *data)=0
 Update texutre cube data in give slice side.
void zeroTexData ()
 clear texture data to zero.
Public Member Functions inherited from Object
void retain ()
 Retains the ownership.
void release ()
 Releases the ownership immediately.
Object * autorelease ()
 Releases the ownership sometime soon automatically.
unsigned int getReferenceCount () const
 Returns the Object's current reference count.
uint64_t getObjectID () const noexcept
 Returns the process-local diagnostic identifier assigned at construction.
virtual ~Object ()
 Destructor.

Detailed Description

A base texture.

Member Function Documentation

◆ updateSamplerDesc()

virtual void updateSamplerDesc ( const SamplerDesc & desc)
pure virtual

Update sampler.

Parameters
samplerSpecifies the sampler descriptor.

Implemented in TextureImpl, TextureImpl, TextureImpl, TextureImpl, and TextureImpl.

◆ updateTextureDesc()

virtual void updateTextureDesc ( const TextureDesc & desc)
virtual

Update texture description.

Parameters
descriptorSpecifies texture and sampler descriptor.

Reimplemented in TextureImpl, TextureImpl, TextureImpl, TextureImpl, and TextureImpl.

◆ getPixelFormat()

PixelFormat getPixelFormat ( ) const
inline

Get texture format.

Returns
Texture pixel format.

◆ getTextureUsage()

TextureUsage getTextureUsage ( ) const
inline

Get texture usage.

Symbolic constant can be READ, WRITE or RENDER_TARGET.

Returns
Texture usage.

◆ getTextureType()

TextureType getTextureType ( ) const
inline

Get texture type.

Symbolic constant value can be either TEXTURE_2D or TEXTURE_CUBE.

Returns
Texture type.

◆ hasMipmaps()

bool hasMipmaps ( ) const
inline

Check if mipmap had generated before.

Returns
true if the mipmap has always generated before, otherwise false.

◆ updateData()

virtual void updateData ( const void * data,
int width,
int height,
int level,
int layerIndex )
pure virtual

Update a two-dimensional texture image.

Parameters
dataSpecifies a pointer to the image data in memory.
widthSpecifies the width of the texture image.
heightSpecifies the height of the texture image.
levelSpecifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.
layerIndexSpecifies the layer index for 2D array textures.

Implemented in TextureImpl, TextureImpl, TextureImpl, TextureImpl, and TextureImpl.

◆ updateCompressedData()

virtual void updateCompressedData ( const void * data,
int width,
int height,
size_t dataSize,
int level,
int layerIndex )
pure virtual

Update a two-dimensional texture image in a compressed format.

Parameters
dataSpecifies a pointer to the compressed image data in memory.
widthSpecifies the width of the texture image.
heightSpecifies the height of the texture image.
dataSizeSpecifies the totoal size of compressed image in bytes.
levelSpecifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.
layerIndexSpecifies the layer index for 2D array textures.

Implemented in TextureImpl, TextureImpl, TextureImpl, TextureImpl, and TextureImpl.

◆ updateSubData()

virtual void updateSubData ( int xoffset,
int yoffset,
int width,
int height,
int level,
const void * data,
int layerIndex )
pure virtual

Update a two-dimensional texture subimage.

Parameters
xoffsetSpecifies a texel offset in the x direction within the texture array.
yoffsetSpecifies a texel offset in the y direction within the texture array.
widthSpecifies the width of the texture subimage.
heightSpecifies the height of the texture subimage.
levelSpecifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.
dataSpecifies a pointer to the image data in memory.
layerIndexSpecifies the layer index for 2D array textures.

Implemented in TextureImpl, TextureImpl, TextureImpl, TextureImpl, and TextureImpl.

◆ updateCompressedSubData()

virtual void updateCompressedSubData ( int xoffset,
int yoffset,
int width,
int height,
size_t dataSize,
int level,
const void * data,
int layerIndex )
pure virtual

Update a two-dimensional texture subimage in a compressed format.

Parameters
xoffsetSpecifies a texel offset in the x direction within the texture array.
yoffsetSpecifies a texel offset in the y direction within the texture array.
widthSpecifies the width of the texture subimage.
heightSpecifies the height of the texture subimage.
dataSizeSpecifies the totoal size of compressed subimage in bytes.
levelSpecifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.
dataSpecifies a pointer to the compressed image data in memory.
layerIndexSpecifies the layer index for 2D array textures.

Implemented in TextureImpl, TextureImpl, TextureImpl, TextureImpl, and TextureImpl.

◆ updateFaceData()

virtual void updateFaceData ( TextureCubeFace side,
const void * data )
pure virtual

Update texutre cube data in give slice side.

Parameters
sideSpecifies which slice texture of cube to be update.
dataSpecifies a pointer to the image data in memory.

Implemented in TextureImpl, TextureImpl, TextureImpl, TextureImpl, and TextureImpl.

◆ zeroTexData()

void zeroTexData ( )

clear texture data to zero.

Remarks
: only works for uncompressed texture.

The documentation for this class was generated from the following file:
  • Texture.h