NvUITexture Class Reference
Abstraction of a texture object, allowing for texture caching, lookup, and reuse/refcounting. More...
#include <NvUI.h>
Public Member Functions | |
NvUITexture (const std::string &texname, bool noMips=true) | |
Constructor for texture loaded from filename; may load from/to the texture cache. | |
virtual | ~NvUITexture () |
Default destructor, helps with refcounting and cleanup of owned textures. | |
int32_t | GetWidth () |
Accessor for texture width. | |
int32_t | GetHeight () |
Accessor for texture height. | |
uint32_t | IsTexValid () |
Accessor for GL texture object ID. | |
bool | GetHasAlpha () |
Accessor for whether texture was flagged as having alpha channel. | |
NvUITextureRender * | GetRender () |
void | AddRef () |
Add reference to this texture. | |
void | DelRef () |
Subtract a reference from this texture/. | |
Static Public Member Functions | |
static NvUITexture * | CacheTexture (const std::string &texname, bool noMips=true) |
Static method for loading textures via internal cache. | |
Protected Attributes | |
std::string | m_filename |
The requested bitmap filename, used in hashing and debugging. | |
NvUITextureRender * | m_render |
The GL texture ID allocated for our texture upload. | |
int32_t | m_width |
The loaded texture width. | |
int32_t | m_height |
The loaded texture height. | |
bool | m_hasAlpha |
Flag for if this texture has data with an alpha channel. | |
uint32_t | m_refcount |
Trivial internal refcount of a given texture object. | |
bool | m_cached |
Whether or not the texture is cached in our master NvUITexture table. |
Detailed Description
Abstraction of a texture object, allowing for texture caching, lookup, and reuse/refcounting.In addition, it stores a set of 'knowledge' about the texture data loaded in the object, including things like the source filename and dimensions.
Constructor & Destructor Documentation
NvUITexture::NvUITexture | ( | const std::string & | texname, | |
bool | noMips = true | |||
) |
Constructor for texture loaded from filename; may load from/to the texture cache.
virtual NvUITexture::~NvUITexture | ( | ) | [virtual] |
Default destructor, helps with refcounting and cleanup of owned textures.
Member Function Documentation
void NvUITexture::AddRef | ( | ) | [inline] |
Add reference to this texture.
static NvUITexture* NvUITexture::CacheTexture | ( | const std::string & | texname, | |
bool | noMips = true | |||
) | [static] |
Static method for loading textures via internal cache.
First tries to find existing object in the cache. If not found in the cache, tries to load from disk, and if successful then store in the cache for later load attempts.
bool NvUITexture::GetHasAlpha | ( | ) | [inline] |
Accessor for whether texture was flagged as having alpha channel.
int32_t NvUITexture::GetHeight | ( | ) | [inline] |
Accessor for texture height.
int32_t NvUITexture::GetWidth | ( | ) | [inline] |
Accessor for texture width.
uint32_t NvUITexture::IsTexValid | ( | ) | [inline] |
Accessor for GL texture object ID.
Member Data Documentation
bool NvUITexture::m_cached [protected] |
Whether or not the texture is cached in our master NvUITexture table.
std::string NvUITexture::m_filename [protected] |
The requested bitmap filename, used in hashing and debugging.
bool NvUITexture::m_hasAlpha [protected] |
Flag for if this texture has data with an alpha channel.
int32_t NvUITexture::m_height [protected] |
The loaded texture height.
uint32_t NvUITexture::m_refcount [protected] |
Trivial internal refcount of a given texture object.
NvUITextureRender* NvUITexture::m_render [protected] |
The GL texture ID allocated for our texture upload.
int32_t NvUITexture::m_width [protected] |
The loaded texture width.
The documentation for this class was generated from the following file: