⚠️ This documentation corresponds to the latest development branch of axmol. It might diverge from the official releases.

Axmol Engine 3.0.0-14b93b2
Loading...
Searching...
No Matches
TextureImpl Class Reference

The texture implementation supports 2D, cubemap, and 2D array textures. More...

#include <TextureMTL.h>

Inherits Texture.

Public Member Functions

 TextureImpl (id< MTLDevice > mtlDevice, const TextureDesc &descriptor)
void updateData (const void *data, int width, int height, int level, int layerIndex=0) override
 Update a two-dimensional texture image.
void updateCompressedData (const void *data, int width, int height, std::size_t dataSize, int level, int layerIndex=0) override
 Update a two-dimensional texture image in a compressed format.
void updateSubData (int xoffset, int yoffset, int width, int height, int level, const void *data, int layerIndex=0) override
 Update a two-dimensional texture subimage.
void updateCompressedSubData (int xoffset, int yoffset, int width, int height, std::size_t dataSize, int level, const void *data, int layerIndex=0) override
 Update a two-dimensional texture subimage in a compressed format.
void updateSamplerDesc (const SamplerDesc &desc) override
 Update sampler.
void generateMipmaps ()
 Generate mipmaps.
void updateTextureDesc (const TextureDesc &desc) override
 Update texture description.
void updateFaceData (TextureCubeFace side, const void *data) override
 Update texutre cube data in give slice side.
id< MTLTexture > internalHandle () const
 Get MTLTexture object.
id< MTLSamplerState > internalSampler () const
 Get MTLSamplerState object.
Public Member Functions inherited from Texture
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.
void zeroTexData ()
 clear texture data to zero.
Public Member Functions inherited from Object
void retain ()
 Retains the ownership.
void release ()
 Releases the ownership immediately.
Objectautorelease ()
 Releases the ownership sometime soon automatically.
unsigned int getReferenceCount () const
 Returns the Object's current reference count.
virtual ~Object ()
 Destructor.

Additional Inherited Members

Public Attributes inherited from Object
unsigned int _ID
 object id, ScriptSupport need public _ID
int _luaID
 Lua reference id.

Detailed Description

The texture implementation supports 2D, cubemap, and 2D array textures.

Constructor & Destructor Documentation

◆ TextureImpl()

TextureImpl ( id< MTLDevice > mtlDevice,
const TextureDesc & descriptor )
Parameters
mtlDeviceThe device for which MTLTexture and MTLSamplerState object was created.
descriptorSpecify texture and sampler description.

Member Function Documentation

◆ updateData()

void updateData ( const void * data,
int width,
int height,
int level,
int layerIndex = 0 )
overridevirtual

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.

Implements Texture.

◆ updateCompressedData()

void updateCompressedData ( const void * data,
int width,
int height,
std::size_t dataSize,
int level,
int layerIndex = 0 )
overridevirtual

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.

Implements Texture.

◆ updateSubData()

void updateSubData ( int xoffset,
int yoffset,
int width,
int height,
int level,
const void * data,
int layerIndex = 0 )
overridevirtual

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.

Implements Texture.

◆ updateCompressedSubData()

void updateCompressedSubData ( int xoffset,
int yoffset,
int width,
int height,
std::size_t dataSize,
int level,
const void * data,
int layerIndex = 0 )
overridevirtual

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.

Implements Texture.

◆ updateSamplerDesc()

void updateSamplerDesc ( const SamplerDesc & desc)
overridevirtual

Update sampler.

Parameters
descSpecifies the sampler descriptor.

Implements Texture.

◆ updateTextureDesc()

void updateTextureDesc ( const TextureDesc & desc)
overridevirtual

Update texture description.

Parameters
descSpecifies texture and sampler descriptor.

Reimplemented from Texture.

◆ updateFaceData()

void updateFaceData ( TextureCubeFace side,
const void * data )
overridevirtual

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.

Implements Texture.

◆ internalHandle()

id< MTLTexture > internalHandle ( ) const
inline

Get MTLTexture object.

reinterpret_cast<id<MTLTexture>>(handler);

Returns
A MTLTexture object.

◆ internalSampler()

id< MTLSamplerState > internalSampler ( ) const
inline

Get MTLSamplerState object.

Returns
A MTLSamplerState object.

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