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


C++ TexturePtr::load方法代码示例

本文整理汇总了C++中TexturePtr::load方法的典型用法代码示例。如果您正苦于以下问题:C++ TexturePtr::load方法的具体用法?C++ TexturePtr::load怎么用?C++ TexturePtr::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TexturePtr的用法示例。


在下文中一共展示了TexturePtr::load方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createScene

// -----------------------------------------------------------------------------------------
void CDemoGlassApplication::createScene()
{
    m_pSceneManager->createSkyBox(_T("snow.jpg"), 500);

    CPepeEngineEntity*      pVase       = new CPepeEngineEntity(_T("Vase"), _T("Teapot.3ds"));
    CPepeEngineSceneNode*   pRootNode   = m_pSceneManager->getRootSceneNode();

    pRootNode->attachObject(pVase);
    pRootNode->setPosition(0.0f, 0.0f, -15.0f);
    pRootNode->setScale(0.1f, 0.1f, 0.1f);

    pVase->setVertexShader(_T("glass.vs"));
    pVase->setPixelShader(_T("glass.ps"));
    pVase->setCullingMode(CULL_CLOCKWISE);


    GPUProgramPtr   pVasePS         = IPepeEngineGPUProgramManager::getSingleton().getByName(_T("glass.ps"));
    TexturePtr      pRainbowTexture = IPepeEngineTextureManager::getSingleton().create(_T("Rainbow.tga"));
    pRainbowTexture->load();

    pVasePS->getParameters()->bindTexture(_T("Rainbow"), pRainbowTexture);
    pVasePS->getParameters()->setNamedConstant(_T("indexOfRefractionRatio"), 1.14f);
    pVasePS->getParameters()->setNamedConstant(_T("rainbowSpread"), 0.18f);
    pVasePS->getParameters()->setNamedConstant(_T("rainbowScale"), 0.2f);
    pVasePS->getParameters()->setNamedConstant(_T("reflectionScale"), 1.0f);
    pVasePS->getParameters()->setNamedConstant(_T("refractionScale"), 1.0f);
    pVasePS->getParameters()->setNamedConstant(_T("ambient"), 0.2f);
    pVasePS->getParameters()->setNamedConstant(_T("baseColor"), CPepeEngineVector4(0.78f, 0.78f, 0.78f, 1.0f));
}
开发者ID:pepewuzzhere,项目名称:PepeEngine,代码行数:30,代码来源:CDemoGlassApplication.cpp

示例2: load

    //-----------------------------------------------------------------------
    TexturePtr TextureManager::load(const String &name, const String& group, TextureType texType,
                                    int numMipmaps, Real gamma, bool isAlpha, PixelFormat desiredFormat,
                                    bool hwGamma)
    {
		ResourceCreateOrRetrieveResult res =
            createOrRetrieve(name,group,false,0,0,texType,numMipmaps,gamma,isAlpha,desiredFormat,hwGamma);
        TexturePtr tex = res.first;
		tex->load();
        return tex;
    }
开发者ID:terminus510,项目名称:OgreBulletTest,代码行数:11,代码来源:OgreTextureManager.cpp

示例3: getShadowTextures

    //---------------------------------------------------------------------
    void ShadowTextureManager::getShadowTextures(const ShadowTextureConfigList& configList,
        ShadowTextureList& listToPopulate)
    {
        listToPopulate.clear();

        set<Texture*>::type usedTextures;

        for (ShadowTextureConfigList::const_iterator c = configList.begin(); c != configList.end(); ++c)
        {
            const ShadowTextureConfig& config = *c;
            bool found = false;
            for (ShadowTextureList::iterator t = mTextureList.begin(); t != mTextureList.end(); ++t)
            {
                const TexturePtr& tex = *t;
                // Skip if already used this one
                if (usedTextures.find(tex.getPointer()) != usedTextures.end())
                    continue;

                if (config.width == tex->getWidth() && config.height == tex->getHeight()
                    && config.format == tex->getFormat() && config.fsaa == tex->getFSAA())
                {
                    // Ok, a match
                    listToPopulate.push_back(tex);
                    usedTextures.insert(tex.getPointer());
                    found = true;
                    break;
                }
            }
            if (!found)
            {
                // Create a new texture
                static const String baseName = "Ogre/ShadowTexture";
                String targName = baseName + StringConverter::toString(mCount++);
                TexturePtr shadowTex = TextureManager::getSingleton().createManual(
                    targName,
                    ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME,
                    TEX_TYPE_2D, config.width, config.height, 0, config.format,
                    TU_RENDERTARGET, NULL, false, config.fsaa);
                // Ensure texture loaded
                shadowTex->load();
                listToPopulate.push_back(shadowTex);
                usedTextures.insert(shadowTex.getPointer());
                mTextureList.push_back(shadowTex);
            }
        }

    }
开发者ID:Kanma,项目名称:Ogre,代码行数:48,代码来源:OgreShadowTextureManager.cpp


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