Loading [MathJax]/extensions/tex2jax.js

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

 
Axmol Engine 2.4.0-ce063c5
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Modules Pages
Loading...
Searching...
No Matches
Texture2DGL Class Reference

A 2D texture. More...

#include <TextureGL.h>

Inherits Texture2DBackend.

Public Member Functions

 Texture2DGL (const TextureDescriptor &descriptor)
 
virtual void updateData (uint8_t *data, std::size_t width, std::size_t height, std::size_t level, int index=0) override
 Update a two-dimensional texture image.
 
virtual void updateCompressedData (uint8_t *data, std::size_t width, std::size_t height, std::size_t dataLen, std::size_t level, int index=0) override
 Update a two-dimensional texture image in a compressed format.
 
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, int index=0) override
 Update a two-dimensional texture subimage.
 
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, int index=0) override
 Update a two-dimensional texture subimage in a compressed format.
 
virtual void updateSamplerDescriptor (const SamplerDescriptor &sampler) override
 Update sampler.
 
virtual void generateMipmaps () override
 Generate mipmaps.
 
virtual void updateTextureDescriptor (const TextureDescriptor &descriptor, int index=0) override
 Update texture description.
 
uintptr_t getHandler (int index=0) const override
 Get texture object.
 
void apply (int slot, int index) const
 Set texture to pipeline.
 
- Public Member Functions inherited from Texture2DBackend
std::size_t getWidth () const
 Get texture width.
 
std::size_t getHeight () const
 Get texture height.
 
- Public Member Functions inherited from TextureBackend
PixelFormat getTextureFormat () 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.
 
- 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

A 2D texture.

Constructor & Destructor Documentation

◆ Texture2DGL()

Texture2DGL ( const TextureDescriptor & descriptor)
Parameters
descriptorSpecifies the texture description.

Member Function Documentation

◆ updateData()

virtual void updateData ( uint8_t * data,
std::size_t width,
std::size_t height,
std::size_t level,
int index = 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 Texture2DBackend.

◆ updateCompressedData()

virtual void updateCompressedData ( uint8_t * data,
std::size_t width,
std::size_t height,
std::size_t dataLen,
std::size_t level,
int index = 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.
dataLenSpecifies 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 Texture2DBackend.

◆ updateSubData()

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,
int index = 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 Texture2DBackend.

◆ updateCompressedSubData()

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,
int index = 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.
dataLenSpecifies 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 Texture2DBackend.

◆ updateSamplerDescriptor()

virtual void updateSamplerDescriptor ( const SamplerDescriptor & sampler)
overridevirtual

Update sampler.

Parameters
samplerSpecifies the sampler descriptor.

Implements TextureBackend.

◆ updateTextureDescriptor()

virtual void updateTextureDescriptor ( const TextureDescriptor & descriptor,
int index = 0 )
overridevirtual

Update texture description.

Parameters
descriptorSpecifies texture and sampler descriptor.

Reimplemented from TextureBackend.

◆ getHandler()

uintptr_t getHandler ( int index = 0) const
inlineoverridevirtual

Get texture object.

Returns
Texture object.

Reimplemented from TextureBackend.

◆ apply()

void apply ( int slot,
int index ) const
inline

Set texture to pipeline.

Parameters
indexSpecifies the texture image unit selector.

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