HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE_IconTextureCache Class Reference

#include <RE_IconTextureCache.h>

Public Member Functions

 RE_IconTextureCache ()
 
 ~RE_IconTextureCache ()
 
RE_TextureaddTexture (RE_Render *r, PXL_Raster *texture)
 Add a regular texture from a raster and return its unique ID. More...
 
RE_TextureaddMipMapTexture (RE_Render *r, PXL_Raster *texture)
 
RE_TextureaddMipMapTexture (RE_Render *r, const UT_Array< PXL_Raster * > &levels)
 
void removeTexture (RE_Texture *tex)
 Remove a texture from the cache. More...
 
void clearTextureCache ()
 Free all textures. More...
 
int getTextureVersion () const
 
void renderTexture (RE_Render *r, int x, int y, int w, int h, RE_Texture *tex, float alpha, float z)
 Render a given texture at (x, y) with width and height w, h. More...
 
void beginTextureDefer (RE_Render *r)
 
void endTextureDefer (RE_Render *r)
 
void flushTextureDefer (RE_Render *r)
 
int64 getCacheSize () const
 

Detailed Description

Definition at line 55 of file RE_IconTextureCache.h.

Constructor & Destructor Documentation

RE_IconTextureCache::RE_IconTextureCache ( )
RE_IconTextureCache::~RE_IconTextureCache ( )

Member Function Documentation

RE_Texture* RE_IconTextureCache::addMipMapTexture ( RE_Render r,
PXL_Raster texture 
)

Add a texture from a raster, and automatically generate the mip-map levels for it.

RE_Texture* RE_IconTextureCache::addMipMapTexture ( RE_Render r,
const UT_Array< PXL_Raster * > &  levels 
)

Add a mip-mapped texture, with many levels defined by the rasters passed as levels, and return its unique ID. The levels must all be powers of two in size, and must follow the progression from 2^Nx2^N, 2^(N-1)x2^(N-1), ..., 1x1.

RE_Texture* RE_IconTextureCache::addTexture ( RE_Render r,
PXL_Raster texture 
)

Add a regular texture from a raster and return its unique ID.

void RE_IconTextureCache::beginTextureDefer ( RE_Render r)

These methods record the textures to be drawn, and draws them all at once when endTextureDefer() is called. If you need all cached textures to be drawn immediately without doing an end, call flushTextureDefer().

void RE_IconTextureCache::clearTextureCache ( )

Free all textures.

void RE_IconTextureCache::endTextureDefer ( RE_Render r)
void RE_IconTextureCache::flushTextureDefer ( RE_Render r)
int64 RE_IconTextureCache::getCacheSize ( ) const
inline

Definition at line 96 of file RE_IconTextureCache.h.

int RE_IconTextureCache::getTextureVersion ( ) const
inline

Returns a version # for the cache; every time it is cleared, this number is bumped;

Definition at line 83 of file RE_IconTextureCache.h.

void RE_IconTextureCache::removeTexture ( RE_Texture tex)

Remove a texture from the cache.

void RE_IconTextureCache::renderTexture ( RE_Render r,
int  x,
int  y,
int  w,
int  h,
RE_Texture tex,
float  alpha,
float  z 
)

Render a given texture at (x, y) with width and height w, h.


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