172 inline const string&
getId()
const {
386 auto widthMipLevels = 1;
387 auto heightMipLevels = 1;
398 auto mipLevels = Math::min(widthMipLevels, heightMipLevels);
400 auto borderSize = 32;
402 while (borderSize > 4) {
406 return Math::min(mipLevels, maxLevel);
TextureFilter getMinFilter() const
static TextureFormat getBC7FormatByPixelBitsPerPixel(int bpp)
Return BC7 RGB/A texture format by bits per pixel.
uint16_t getWidth() const
const vector< MipMapTexture > & getMipMapTextures(bool bc7Encoded)
Get mip map textures.
static TextureFormat getRGBFormatByPixelBitsPerPixel(int bpp)
Return RGB/A texture format by bits per pixel.
ByteBuffer generateMipMap(int textureWidth, int textureHeight, int bytesPerPixel, const ByteBuffer &textureTextureData)
Generate mip map texture.
@ CLAMPMODE_TRANSPARENTPIXEL
bool isBC7TextureFormat() const
ByteBuffer getRGBTextureData()
uint8_t getRGBDepthBitsPerPixel() const
virtual void onDelete() override
Callback method to be overridden, will be called if object will be deleted.
const string & getId() const
ByteBuffer getBC7TextureData()
bool isRGBTextureFormat() const
ByteBuffer * getTextureData()
uint16_t getTextureHeight() const
TextureFilter getMagFilter() const
vector< MipMapTexture > mipMapTextures
static TextureFormat getPNGFormatByPixelBitsPerPixel(int bpp)
Return PNG RGB/A texture format by bits per pixel.
uint16_t getTextureWidth() const
void setUseCompression(bool useCompression)
Set if to use compression.
void setClampMode(ClampMode clampMode)
Set clamp mode.
void setTextureData(TextureFormat format, const ByteBuffer &textureData)
Set RGB(A) texture data.
ClampMode getClampMode() const
TextureFormat getTextureFormat() const
void setUseMipMap(bool useMipMap)
Set if to use mip map.
static TextureDepth getRGBDepthByPixelBitsPerPixel(int bpp)
Return RGB/A texture depth by bits per pixel.
uint16_t getHeight() const
@ TEXTUREFILTER_LINEAR_MIPMAP_LINEAR
@ TEXTUREFILTER_LINEAR_MIPMAP_NEAREST
@ TEXTUREFILTER_NEAREST_MIPMAP_NEAREST
@ TEXTUREFILTER_NEAREST_MIPMAP_LINEAR
void setRepeat(bool repeat)
Set repeat.
void setAtlasSize(uint16_t atlasSize)
Set atlas size.
uint16_t getAtlasSize() const
bool isPNGTextureFormat() const
virtual ~Texture()
Destructor.
void setMinFilter(TextureFilter filter)
Set texture min filter.
bool isUseCompression() const
void setMagFilter(TextureFilter filter)
Set texture mag filter.
void setMipMapTextures(const vector< MipMapTexture > &mipMapTextures)
Set mip map textures.
Reference counter implementation to be used with inheritance.
MipMapTexture(TextureFormat format, uint16_t width, uint16_t height, ByteBuffer textureData)
#define FORBID_CLASS_COPY(CLASS)