本文整理汇总了C++中TextureList::size方法的典型用法代码示例。如果您正苦于以下问题:C++ TextureList::size方法的具体用法?C++ TextureList::size怎么用?C++ TextureList::size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextureList
的用法示例。
在下文中一共展示了TextureList::size方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TextureAtlas
TextureAtlas::TextureAtlas(const char* path, float scale, TextureList regions)
: TextureAtlas(path, scale)
{
regions_.reserve(regions.size());
for (auto&& p : regions)
{
add_region(std::get<0>(p),
std::get<1>(p),
std::get<2>(p),
std::get<3>(p));
}
}
示例2: sendToShader
void sendToShader( GLuint shaderProgram ) {
auto numTextures = diffuseTextures.size();
for( int i = 0; i != numTextures; i++ ) {
glActiveTexture( GL_TEXTURE0 + i );
std::stringstream stream;
stream << "diffuse" << i;
std::string uniformName = stream.str();
glBindTexture( GL_TEXTURE_2D, diffuseTextures[ i ]->id );
glUniform1i( glGetUniformLocation( shaderProgram, uniformName.c_str() ), i );
}
}
示例3: Handle
void WaterNode::Handle(RenderingEventArg arg){
if (waterShader != NULL){
Vector<2, int> dim(400,300);
reflectionFbo = new FrameBuffer(dim, 1, false);
arg.renderer.BindFrameBuffer(reflectionFbo);
waterShader->SetTexture("reflection", reflectionFbo->GetTexAttachment(0));
if (normaldudvmap != NULL)
waterShader->SetTexture("normaldudvmap", (ITexture2DPtr)normaldudvmap);
waterShader->Load();
TextureList texs = waterShader->GetTextures();
for (unsigned int i = 0; i < texs.size(); ++i)
arg.renderer.LoadTexture(texs[i].get());
}else if (surface != NULL)
arg.renderer.LoadTexture(surface);
}
示例4: reloadTextures
void TextureManager::reloadTextures() {
m_collectionMap.clear();
m_texturesCaseSensitive.clear();
m_texturesCaseInsensitive.clear();
m_texturesByName.clear();
m_texturesByUsage.clear();
typedef std::pair<TextureMap::iterator, bool> InsertResult;
for (size_t i = 0; i < m_collections.size(); i++) {
TextureCollection* collection = m_collections[i];
const TextureList textures = collection->textures();
for (size_t j = 0; j < textures.size(); j++) {
Texture* texture = textures[j];
m_collectionMap[texture] = collection;
InsertResult result = m_texturesCaseSensitive.insert(TextureMapEntry(texture->name(), texture));
if (!result.second) { // texture with this name already existed
result.first->second->setOverridden(true);
m_texturesCaseSensitive.erase(result.first);
m_texturesCaseSensitive.insert(TextureMapEntry(texture->name(), texture));
}
m_texturesCaseInsensitive[Utility::toLower(texture->name())] = texture;
texture->setOverridden(false);
}
}
TextureMap::iterator it, end;
for (it = m_texturesCaseSensitive.begin(), end = m_texturesCaseSensitive.end(); it != end; ++it) {
Texture* texture = it->second;
m_texturesByName.push_back(texture);
m_texturesByUsage.push_back(texture);
}
std::sort(m_texturesByName.begin(), m_texturesByName.end(), CompareTexturesByName());
}