本文整理汇总了C++中TextureCache::fetchAndPin方法的典型用法代码示例。如果您正苦于以下问题:C++ TextureCache::fetchAndPin方法的具体用法?C++ TextureCache::fetchAndPin怎么用?C++ TextureCache::fetchAndPin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextureCache
的用法示例。
在下文中一共展示了TextureCache::fetchAndPin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: prepareTexture
//
// only call this function immediately after GetOverlayList()
// which will ensure the list of texture id's are valid
//
int gstTextureManager::prepareTexture(TexTile& tile,
const gstTextureGuard &tex) {
// if no secondary textures have been loaded, return immediately
if (getCurrTexID() == 0)
return -1;
tile.src = tex->id();
// determine what is the best tile that exists in our db
TileExistance* te = tile_existance_cache_->fetch(tile.addr());
assert(te != NULL);
// no texture available
if (te->bestAvailable == 0)
return -1;
// now try to get this best one, but take anything less as long
// as we can get something immediately
// this will fill our read queue with everything from this tile
// all the way up the stack until we've found a tile
requested_level_ = LEVFROMADDR(te->bestAvailable);
while (tile.lev > requested_level_)
tile.upLevel();
uint texid;
TextureCache* textureCache = tile.alpha() == 0 ? overlay_RGB_texture_cache_ :
overlay_alpha_texture_cache_;
while ((texid = textureCache->fetchAndPin(tile.addr())) == 0) {
if (tile.upLevel() == -1)
return -1;
}
// we found one, so let's load it up!
glBindTexture(GL_TEXTURE_2D, texid);
return tile.lev;
}