FPLBase
An open source project by FPL.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Texture

Texture class and methods. More...

Detailed Description

Texture class and methods.

Classes

class  fplbase::Texture
 Abstraction for a texture object loaded on the GPU. More...
 

Typedefs

typedef std::function< Texture
*(const char *filename,
TextureFormat format,
TextureFlags flags)> 
fplbase::TextureLoaderFn
 used by some functions to allow the texture loading mechanism to be specified by the caller.
 

Enumerations

enum  fplbase::TextureFormat {
  fplbase::kFormatAuto = 0, kFormat8888, kFormat888, kFormat5551,
  kFormat565, kFormatLuminance, kFormatASTC, kFormatPKM,
  kFormatKTX, fplbase::kFormatNative, kFormatLuminanceAlpha, kFormatCount
}
 
enum  fplbase::TextureFlags {
  fplbase::kTextureFlagsNone = 0, fplbase::kTextureFlagsClampToEdge = 1 << 0, fplbase::kTextureFlagsUseMipMaps = 1 << 1, fplbase::kTextureFlagsIsCubeMap = 1 << 2,
  fplbase::kTextureFlagsLoadAsync = 1 << 3, fplbase::kTextureFlagsPremultiplyAlpha = 1 << 4
}
 Flags affecting loading and sampler modes for a texture. More...
 

Functions

TextureFlags fplbase::operator| (TextureFlags a, TextureFlags b)
 
bool fplbase::HasAlpha (TextureFormat format)
 determines if the format has an alpha component.
 
bool fplbase::IsCompressed (TextureFormat format)
 determines if the format is already compressed in some way. If image data is supplied in these formats, we use them as-is.
 

Enumeration Type Documentation

Flags affecting loading and sampler modes for a texture.

Enumerator
kTextureFlagsNone 

Default behavior.

kTextureFlagsClampToEdge 

If not set, use repeating texcoords.

kTextureFlagsUseMipMaps 

Uses (or generates) mipmaps.

kTextureFlagsIsCubeMap 

Data represents a 1x6 cubemap.

kTextureFlagsLoadAsync 

Load texture asynchronously.

kTextureFlagsPremultiplyAlpha 

Premultiply by alpha on load. Not supported for ASTC, PKM, or KTX images.

Enumerator
kFormatAuto 

The default, picks based on loaded data.

kFormatNative 

Uses the same format as the source file.