VoltAir
|
Class which loads and caches Textures. More...
Public Member Functions | |
TexturePtr | getTexture (const QString &path) |
Returns a Texture containing the image at path relative to the standard image directory. More... | |
TexturePtr | getTextureAsset (const QString &assetPath) |
Returns a Texture containing the image at assetPath relative to the standard asset directory. More... | |
TexturePtr | getTextureImage (const QString &imagePath) |
Returns a Texture containing the image at imagePath relative to the standard image directory. More... | |
void | markAllTexturesForDeletion () |
Move all Textures currently cached onto the deletion list, to be deleted on the next call to processDeletion(). More... | |
void | processDeletion () |
Release references to all Textures on the delete list. More... | |
Class which loads and caches Textures.
Textures are loaded as QSGTextures and wrapped into Texture objects. Returned textures are cached until the next call to markAllTexturesForDeletion() which occurs when Engine switches levels. Textures that are requested before the next frame ends are retained in the cache. Textures that were not referenced during that frame are released.
This is used to:
TexturePtr TextureManager::getTexture | ( | const QString & | path | ) |
Returns a Texture containing the image at path
relative to the standard image directory.
path | Platform dependent absolute path of image to get |
TexturePtr TextureManager::getTextureAsset | ( | const QString & | assetPath | ) |
Returns a Texture containing the image at assetPath
relative to the standard asset directory.
assetPath | Path of image to get |
TexturePtr TextureManager::getTextureImage | ( | const QString & | imagePath | ) |
Returns a Texture containing the image at imagePath
relative to the standard image directory.
imagePath | Path of image to get |
void TextureManager::markAllTexturesForDeletion | ( | ) |
Move all Textures currently cached onto the deletion list, to be deleted on the next call to processDeletion().
If a Texture on the delete list is requested through one of the getTexture() calls, it will move off the delete list and back into the cache.
void TextureManager::processDeletion | ( | ) |
Release references to all Textures on the delete list.
This list contains all Textures that have not been requested since the last call to markAllTexturesForDeletion().