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


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

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


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

示例1: initialize

void ParticleRendererComponent::initialize()
{
    if( !d->item )
    {
        d->item = GluonGraphics::Engine::instance()->createItem( "default" );
    }

    if( d->material )
    {
        Asset* materialAsset = qobject_cast<Asset*>( d->material->parent() );
        if( materialAsset )
            materialAsset->load();

        Asset* texture = 0;
        if( d->material->property( "texture0" ).type() == QVariant::String )
        {
            QString theName( d->material->property( "texture0" ).toString() );
            QString theObjectName = GluonObject::nameToObjectName( theName );
            texture = gameProject()->findChild<Asset*>( theObjectName );
            if( !texture )
                debug( QString( "Texture failed to load - attempted to load texture named %1 (searched for %2)" ).arg( theName ).arg( theObjectName ) );
        }
        else
            texture = qobject_cast<Asset*>( GluonCore::GluonObjectFactory::instance()->wrappedObject( d->material->property( "texture0" ) ) );

        if( texture )
            texture->load();
        d->item->setMaterialInstance( d->material );
    }
}
开发者ID:pranavrc,项目名称:example-gluon,代码行数:30,代码来源:particlerenderer.cpp

示例2:

void BeamRendererComponent::Private::loadMaterial( GluonGraphics::MaterialInstance* material )
{
    Asset* materialAsset = qobject_cast<Asset*>( material->parent() );
    if( materialAsset )
        materialAsset->load();

    Asset* texture = Game::instance()->gameProject()->findChild<Asset*>( material->property( "texture0" ).toString() );
    if( texture )
        texture->load();
}
开发者ID:pranavrc,项目名称:gluon,代码行数:10,代码来源:beamrenderercomponent.cpp

示例3: initialize

void CameraControllerComponent::initialize()
{
    if( !d->camera )
        d->camera = new GluonGraphics::Camera();

    if( d->active )
    {
        GluonGraphics::Engine::instance()->setActiveCamera( d->camera );
    }

    if( !d->material )
    {
        d->material = GluonGraphics::Engine::instance()->mainRenderTarget()->materialInstance();
    }
    else
    {
        Asset* materialAsset = qobject_cast<Asset*>( d->material->parent() );
        if( materialAsset )
            materialAsset->load();
        if( GluonGraphics::Engine::instance()->mainRenderTarget() )
            GluonGraphics::Engine::instance()->mainRenderTarget()->setMaterialInstance( d->material );
        else
            debug( QString( "Warning: there is no main RenderTarget set!" ) );
    }

    d->camera->frustrum()->setOrthoAdjusted( d->visibleArea, GluonGraphics::Engine::instance()->currentViewport()->aspectRatio(), d->nearPlane, d->farPlane );
}
开发者ID:pranavrc,项目名称:example-gluon,代码行数:27,代码来源:cameracontrollercomponent.cpp

示例4: get

Asset* AssetSystem::get(const char* pFileName)
{
	Asset* pAsset = addPending(pFileName);
	if (pAsset && !pAsset->getLoaded())
	{
	  pAsset->load();
	}
	
	return pAsset;
}
开发者ID:jpalves,项目名称:androidndkgame,代码行数:10,代码来源:AssetSystem.cpp

示例5: loadPending

void AssetSystem::loadPending()
{
  // Can't cache the element count here because loading may cause
  // new assets to be added to the table.
  for (int x = 0; x < mLoadedAssetTable.getElementCount(); x++)
  {
    Asset* asset = mLoadedAssetTable.get(x);
    if (!asset->getLoaded())
    {
      asset->load();
    }
  }
}
开发者ID:jpalves,项目名称:androidndkgame,代码行数:13,代码来源:AssetSystem.cpp


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