当前位置: 首页>>代码示例>>C++>>正文


C++ TextureList::size方法代码示例

本文整理汇总了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));
    }
}
开发者ID:AntonioModer,项目名称:rainbow,代码行数:12,代码来源:TextureAtlas.cpp

示例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 );
      }
    }
开发者ID:ne0ndrag0n,项目名称:area51,代码行数:12,代码来源:material.hpp

示例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);
        }
开发者ID:OpenEngineDK,项目名称:extensions-HeightMap,代码行数:19,代码来源:WaterNode.cpp

示例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());
        }
开发者ID:ProPuke,项目名称:TrenchBroom,代码行数:36,代码来源:TextureManager.cpp


注:本文中的TextureList::size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。