Cocos2d-x  4.0.0
Public Member Functions | List of all members
TextureCubeMTL Class Reference

A texture cube. More...

Inherits TextureCubemapBackend.

Public Member Functions

 TextureCubeMTL (id< MTLDevice > mtlDevice, const TextureDescriptor &descriptor)
 
virtual void updateSamplerDescriptor (const SamplerDescriptor &sampler) override
 Update sampler.
 
virtual void updateFaceData (TextureCubeFace side, void *data) override
 Update texutre cube data in give slice side.
 
virtual void getBytes (std::size_t x, std::size_t y, std::size_t width, std::size_t height, bool flipImage, std::function< void(const unsigned char *, std::size_t, std::size_t)> callback) override
 Read a block of pixels from the drawable texture.
 
virtual void generateMipmaps () override
 Generate mipmaps.
 
virtual void updateTextureDescriptor (const cocos2d::backend::TextureDescriptor &descriptor) override
 Update texture description.
 
id< MTLTexture > getMTLTexture () const
 Get MTLTexture object.
 
id< MTLSamplerState > getMTLSamplerState () const
 Get MTLSamplerState object.
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 

Detailed Description

A texture cube.

Constructor & Destructor Documentation

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

Member Function Documentation

virtual void updateSamplerDescriptor ( const SamplerDescriptor &  sampler)
overridevirtual

Update sampler.

Parameters
samplerSpecifies the sampler descriptor.

Implements TextureBackend.

virtual void updateFaceData ( TextureCubeFace  side,
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 TextureCubemapBackend.

virtual void getBytes ( std::size_t  x,
std::size_t  y,
std::size_t  width,
std::size_t  height,
bool  flipImage,
std::function< void(const unsigned char *, std::size_t, std::size_t)>  callback 
)
overridevirtual

Read a block of pixels from the drawable texture.

Parameters
x,ySpecify the window coordinates of the first pixel that is read from the drawable texture. This location is the lower left corner of a rectangular block of pixels.
width,heightSpecify the dimensions of the pixel rectangle. width and height of one correspond to a single pixel.
flipImageSpecifies if needs to flip the image.
callback

Implements TextureBackend.

virtual void updateTextureDescriptor ( const cocos2d::backend::TextureDescriptor descriptor)
overridevirtual

Update texture description.

Parameters
descriptorSpecifies texture and sampler descriptor.

Reimplemented from TextureBackend.

id<MTLTexture> getMTLTexture ( ) const
inline

Get MTLTexture object.

Returns
A MTLTexture object.
id<MTLSamplerState> getMTLSamplerState ( ) const
inline

Get MTLSamplerState object.

Returns
A MTLSamplerState object.

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