HDK
|
#include <RE_IconTextureCache.h>
Public Member Functions | |
RE_IconTextureCache () | |
RE_Texture * | addTexture (RE_Render *r, PXL_Raster *texture) |
Add a regular texture from a raster and return its unique ID. More... | |
RE_Texture * | addMipMapTexture (RE_Render *r, PXL_Raster *texture) |
RE_Texture * | addMipMapTexture (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 |
Definition at line 58 of file RE_IconTextureCache.h.
RE_IconTextureCache::RE_IconTextureCache | ( | ) |
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.
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.
|
inline |
Definition at line 100 of file RE_IconTextureCache.h.
|
inline |
Returns a version # for the cache; every time it is cleared, this number is bumped;
Definition at line 87 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.