A 2D texture. More...
Inherits Texture2DBackend.
Public Member Functions | |
| TextureMTL (id< MTLDevice > mtlDevice, const TextureDescriptor &descriptor) | |
| virtual void | updateData (uint8_t *data, std::size_t width, std::size_t height, std::size_t level) override |
| Update a two-dimensional texture image. More... | |
| virtual void | updateCompressedData (uint8_t *data, std::size_t width, std::size_t height, std::size_t dataLen, std::size_t level) override |
| Update a two-dimensional texture image in a compressed format. More... | |
| virtual void | updateSubData (std::size_t xoffset, std::size_t yoffset, std::size_t width, std::size_t height, std::size_t level, uint8_t *data) override |
| Update a two-dimensional texture subimage. More... | |
| virtual void | updateCompressedSubData (std::size_t xoffset, std::size_t yoffset, std::size_t width, std::size_t height, std::size_t dataLen, std::size_t level, uint8_t *data) override |
| Update a two-dimensional texture subimage in a compressed format. More... | |
| virtual void | updateSamplerDescriptor (const SamplerDescriptor &sampler) override |
| Update sampler. More... | |
| 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. More... | |
| virtual void | generateMipmaps () override |
| Generate mipmaps. | |
| virtual void | updateTextureDescriptor (const cocos2d::backend::TextureDescriptor &descriptor) override |
| Update texture description. More... | |
| id< MTLTexture > | getMTLTexture () const |
| Get MTLTexture object. More... | |
| id< MTLSamplerState > | getMTLSamplerState () const |
| Get MTLSamplerState object. More... | |
Public Member Functions inherited from Texture2DBackend | |
| std::size_t | getWidth () const |
| Get texture width. More... | |
| std::size_t | getHeight () const |
| Get texture height. More... | |
Public Member Functions inherited from TextureBackend | |
| PixelFormat | getTextureFormat () const |
| Get texture format. More... | |
| TextureUsage | getTextureUsage () const |
| Get texture usage. More... | |
| TextureType | getTextureType () const |
| Get texture type. More... | |
| bool | hasMipmaps () const |
| Check if mipmap had generated before. More... | |
Public Member Functions inherited from Ref | |
| void | retain () |
| Retains the ownership. More... | |
| void | release () |
| Releases the ownership immediately. More... | |
| Ref * | autorelease () |
| Releases the ownership sometime soon automatically. More... | |
| unsigned int | getReferenceCount () const |
| Returns the Ref's current reference count. More... | |
| virtual | ~Ref () |
| Destructor. More... | |
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. | |
A 2D texture.
| TextureMTL | ( | id< MTLDevice > | mtlDevice, |
| const TextureDescriptor & | descriptor | ||
| ) |
| mtlDevice | The device for which MTLTexture and MTLSamplerState object was created. |
| descriptor | Specify texture and sampler description. |
|
overridevirtual |
Update a two-dimensional texture image.
| data | Specifies a pointer to the image data in memory. |
| width | Specifies the width of the texture image. |
| height | Specifies the height of the texture image. |
| level | Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. |
Implements Texture2DBackend.
|
overridevirtual |
Update a two-dimensional texture image in a compressed format.
| data | Specifies a pointer to the compressed image data in memory. |
| width | Specifies the width of the texture image. |
| height | Specifies the height of the texture image. |
| dataLen | Specifies the totoal size of compressed image in bytes. |
| level | Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. |
Implements Texture2DBackend.
|
overridevirtual |
Update a two-dimensional texture subimage.
| xoffset | Specifies a texel offset in the x direction within the texture array. |
| yoffset | Specifies a texel offset in the y direction within the texture array. |
| width | Specifies the width of the texture subimage. |
| height | Specifies the height of the texture subimage. |
| level | Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. |
| data | Specifies a pointer to the image data in memory. |
Implements Texture2DBackend.
|
overridevirtual |
Update a two-dimensional texture subimage in a compressed format.
| xoffset | Specifies a texel offset in the x direction within the texture array. |
| yoffset | Specifies a texel offset in the y direction within the texture array. |
| width | Specifies the width of the texture subimage. |
| height | Specifies the height of the texture subimage. |
| dataLen | Specifies the totoal size of compressed subimage in bytes. |
| level | Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. |
| data | Specifies a pointer to the compressed image data in memory. |
Implements Texture2DBackend.
|
overridevirtual |
|
overridevirtual |
Read a block of pixels from the drawable texture.
| x,y | Specify 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,height | Specify the dimensions of the pixel rectangle. width and height of one correspond to a single pixel. |
| flipImage | Specifies if needs to flip the image. |
| callback | Specifies a call back function to deal with the image. |
Implements TextureBackend.
|
overridevirtual |
Update texture description.
| descriptor | Specifies texture and sampler descriptor. |
Reimplemented from TextureBackend.
|
inline |
Get MTLTexture object.
|
inline |
Get MTLSamplerState object.