Rasterfarm-SDK
Loading...
Searching...
No Matches
Texture Class Reference

#include <texture.h>

Classes

class  Attribute
 

Public Types

typedef std::map< TextureType, AttributeUploadTargetMap
 

Public Member Functions

 Texture (TextureManager *pManager=nullptr, TextureUnit textureUnit=TEXTURE_UNIT_BASE)
 
 Texture (const Attribute &attribute, TextureType target, TextureManager *pManager=nullptr, TextureUnit textureUnit=TEXTURE_UNIT_BASE)
 
virtual ~Texture ()
 
bool isManaged ()
 
bool isManaged (TextureManager *pManager)
 
void manage (TextureManager *pManager)
 
void unmanage (TextureManager *pManager)
 
void operator++ ()
 
void operator-- ()
 
bool hasAttribute (TextureType uploadTarget) const
 
const AttributegetAttribute (TextureType uploadTarget)
 
void setAttributesForTarget (const Attribute &attribute, TextureType target)
 
TextureHandle getHandle () const
 
void setTextureHandle (TextureHandle textureHandle)
 
void setTextureUnit (TextureUnit textureUnit)
 
void bind (TextureType target)
 
void setMinFilter (TextureFilterSetting minFilter, TextureType target)
 
void setMagFilter (TextureFilterSetting magFilter, TextureType target)
 
void setFilters (TextureFilterSetting minFilter, TextureFilterSetting magFilter, TextureType target)
 
void setWrapBehaviourS (TextureWrap wrapBehaviour, TextureType target)
 
void setWrapBehaviourT (TextureWrap wrapBehaviour, TextureType target)
 
void setWrapBehaviours (TextureWrap wrapBehaviourS, TextureWrap wrapBehaviourT, TextureType target)
 
uint getWidth (TextureType target=QUAD_MAP, uint level=0)
 
uint getHeight (TextureType target=QUAD_MAP, uint level=0)
 
void uploadPixels (Byte *pPixels, TextureType target, uint level=0)
 
void downloadPixels (Byte *pPixels, TextureType target, PixelFormat format)
 
void allocate (TextureType target, bool shaderAttachment)
 
void autoGenerateMipmaps (TextureType target)
 
TextureUnit getTextureUnit () const
 

Static Public Member Functions

static uint mipLevels (Attribute attribute)
 
static bool isDepthFormat (PixelFormat format)
 

Friends

class TextureImage
 

Member Typedef Documentation

◆ UploadTargetMap

Constructor & Destructor Documentation

◆ Texture() [1/2]

Texture::Texture ( TextureManager * pManager = nullptr,
TextureUnit textureUnit = TEXTURE_UNIT_BASE )
Parameters
Themanager to call when the reference count is decremented to zero. Pass nullptr for no callback.
Theindex of the texture-unit(ie engine) to render the texture.
Thebehavior of the horizontal(eg. u, s, or x dimension) for values outside the range {0,1}
Thebehavior of the vertical(eg. v, t, or y dimension) for values outside the range {0,1}
Theinterpolation filter for minification or scaled below 1(far-away).
Theinterpolation filter for magnification or scaled above 1(close-up).

◆ Texture() [2/2]

Texture::Texture ( const Attribute & attribute,
TextureType target,
TextureManager * pManager = nullptr,
TextureUnit textureUnit = TEXTURE_UNIT_BASE )
Parameters
Themanager to call when the reference count is decremented to zero. Pass nullptr for no callback.
Theindex of the texture-unit(ie engine) to render the texture.
Thebehavior of the horizontal(eg. u, s, or x dimension) for values outside the range {0,1}
Thebehavior of the vertical(eg. v, t, or y dimension) for values outside the range {0,1}
Theinterpolation filter for minification or scaled below 1(far-away).
Theinterpolation filter for magnification or scaled above 1(close-up).

◆ ~Texture()

virtual Texture::~Texture ( )
virtual

Member Function Documentation

◆ allocate()

void Texture::allocate ( TextureType target,
bool shaderAttachment )

Allocates data for the given target. This will be on the order-of width * height * pixel-size of the format.

◆ autoGenerateMipmaps()

void Texture::autoGenerateMipmaps ( TextureType target)

◆ bind()

void Texture::bind ( TextureType target)

◆ downloadPixels()

void Texture::downloadPixels ( Byte * pPixels,
TextureType target,
PixelFormat format )

Exports a texture to a buffer of pixels.

Parameters
Anallocated buffer determined by width, height, and number of bytes-per-pixel.

◆ getAttribute()

const Attribute & Texture::getAttribute ( TextureType uploadTarget)

◆ getHandle()

TextureHandle Texture::getHandle ( ) const
inline

◆ getHeight()

uint Texture::getHeight ( TextureType target = QUAD_MAP,
uint level = 0 )

◆ getTextureUnit()

TextureUnit Texture::getTextureUnit ( ) const
inline

◆ getWidth()

uint Texture::getWidth ( TextureType target = QUAD_MAP,
uint level = 0 )

◆ hasAttribute()

bool Texture::hasAttribute ( TextureType uploadTarget) const

◆ isDepthFormat()

static bool Texture::isDepthFormat ( PixelFormat format)
inlinestatic

◆ isManaged() [1/2]

bool Texture::isManaged ( )
inline

/return True if this texture is being managed by a TextureManager.

◆ isManaged() [2/2]

bool Texture::isManaged ( TextureManager * pManager)
inline

/return True if this texture is being managed by the given TextureManager.

◆ manage()

void Texture::manage ( TextureManager * pManager)

◆ mipLevels()

static uint Texture::mipLevels ( Attribute attribute)
inlinestatic

◆ operator++()

void Texture::operator++ ( )

◆ operator--()

void Texture::operator-- ( )

◆ setAttributesForTarget()

void Texture::setAttributesForTarget ( const Attribute & attribute,
TextureType target )

◆ setFilters()

void Texture::setFilters ( TextureFilterSetting minFilter,
TextureFilterSetting magFilter,
TextureType target )

◆ setMagFilter()

void Texture::setMagFilter ( TextureFilterSetting magFilter,
TextureType target )

◆ setMinFilter()

void Texture::setMinFilter ( TextureFilterSetting minFilter,
TextureType target )

◆ setTextureHandle()

void Texture::setTextureHandle ( TextureHandle textureHandle)

◆ setTextureUnit()

void Texture::setTextureUnit ( TextureUnit textureUnit)

◆ setWrapBehaviourS()

void Texture::setWrapBehaviourS ( TextureWrap wrapBehaviour,
TextureType target )

◆ setWrapBehaviours()

void Texture::setWrapBehaviours ( TextureWrap wrapBehaviourS,
TextureWrap wrapBehaviourT,
TextureType target )

◆ setWrapBehaviourT()

void Texture::setWrapBehaviourT ( TextureWrap wrapBehaviour,
TextureType target )

◆ unmanage()

void Texture::unmanage ( TextureManager * pManager)

◆ uploadPixels()

void Texture::uploadPixels ( Byte * pPixels,
TextureType target,
uint level = 0 )

Friends And Related Symbol Documentation

◆ TextureImage

friend class TextureImage
friend

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