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


C++ ITexture::GetName方法代码示例

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


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

示例1: GetTexture

ITexture* GLGraphics::GetTexture (const String& name, bool createIfMissing)
{
	ITexture* tex = 0;

	if (name.IsValid())
	{
		mTextures.Lock();
		{
			for (uint i = 0; i < mTextures.GetSize(); ++i)
			{
				tex = mTextures[i];

				if (tex != 0 && tex->GetName() == name)
				{
					mTextures.Unlock();
					return tex;
				}
			}

			if (createIfMissing)
			{
				GLTexture* myTex = new GLTexture(name, this);
				mTextures.Expand() = myTex;
				tex = myTex;
			}
			else tex = 0;
		}
		mTextures.Unlock();
	}
	return tex;
}
开发者ID:saggita,项目名称:r5ge,代码行数:31,代码来源:GLGraphics.cpp

示例2: OnBind

void CTextureProxy::OnBind( void *pEntity )
{
	// Bail if no base variable
	if ( !m_pBaseTextureVar )
		return;

	char texture[128];

	if (Q_stricmp(m_szTextureType, "hometeamcrest") == 0 && GetGlobalTeam(TEAM_A)->HasCrest())
		Q_snprintf(texture, sizeof(texture), "%s/%s/teamcrest", TEAMKITS_PATH, GetGlobalTeam(TEAM_A)->GetFolderName());
	else if (Q_stricmp(m_szTextureType, "awayteamcrest") == 0 && GetGlobalTeam(TEAM_B)->HasCrest())
		Q_snprintf(texture, sizeof(texture), "%s/%s/teamcrest", TEAMKITS_PATH, GetGlobalTeam(TEAM_B)->GetFolderName());
	else
		Q_snprintf(texture, sizeof(texture), "%s", m_pDefaultTexture->GetName());

	m_pNewTexture = materials->FindTexture(texture, NULL, true);
		
	m_pBaseTextureVar->SetTextureValue(m_pNewTexture);

	GetMaterial()->RecomputeStateSnapshots();
}
开发者ID:Rahmstein,项目名称:IOS,代码行数:21,代码来源:ios_playertextureproxy.cpp

示例3: ProcessEvent

            virtual void ProcessEvent( EFlowEvent evt, SActivationInfo* pActInfo )
            {
                switch ( evt )
                {
                    case eFE_Suspend:
                        pActInfo->pGraph->SetRegularlyUpdated( pActInfo->myID, false );
                        break;

                    case eFE_Resume:
                        pActInfo->pGraph->SetRegularlyUpdated( pActInfo->myID, true );
                        break;

                    case eFE_Initialize:
                        break;

                    case eFE_Activate:

                        if ( IsPortActive( pActInfo, EIP_GET ) && !m_pVideo )
                        {
                            m_pVideo = gVideoplayerSystem->GetVideoplayerById( GetPortInt( pActInfo, EIP_VIDEOID ) );
                            pActInfo->pGraph->SetRegularlyUpdated( pActInfo->myID, true );
                        }

                        else if ( m_pVideo )
                        {
                            // Set changed properties
                            if ( IsPortActive( pActInfo, EIP_VIDEOID ) )
                            {
                                m_pVideo = gVideoplayerSystem->GetVideoplayerById( GetPortInt( pActInfo, EIP_VIDEOID ) );
                            }
                        }

                        break;

                    case eFE_Update:
                        if ( m_pVideo )
                        {
                            ITexture* tex = m_pVideo->GetTexture();

                            if ( tex && m_nID != tex->GetTextureID() )
                            {
                                m_nID = tex->GetTextureID();
                                m_sName = tex->GetName();

                                ActivateOutput( pActInfo, EOP_TEXID, m_nID );
                                ActivateOutput( pActInfo, EOP_TEXNAME, m_sName );
                                ActivateOutput( pActInfo, EOP_CHANGED, true );
                            }
                        }

                        if ( !m_pVideo && m_nID != -1 )
                        {
                            m_nID = -1;
                            m_sName = "";

                            ActivateOutput( pActInfo, EOP_TEXID, m_nID );
                            ActivateOutput( pActInfo, EOP_TEXNAME, m_sName );
                            ActivateOutput( pActInfo, EOP_CHANGED, true );

                            pActInfo->pGraph->SetRegularlyUpdated( pActInfo->myID, false );
                        }

                        break;
                }
            }
开发者ID:ooyanglinoo,项目名称:Plugin_Videoplayer,代码行数:65,代码来源:CFlowVideoOutputTextureNode.cpp

示例4: OnUpdateSkymask

void ShaderEditorInterface::OnUpdateSkymask( bool bCombineMode, int x, int y, int w, int h )
{
	SetFramebufferCopyTexOverride( NULL );

	if ( !IsSkymaskAvailable() )
		return;

	//UpdateFramebufferTexture( true );

	ITexture *pSkyMask = GetSkymaskTex();

	if ( IsErrorTexture( pSkyMask ) )
		return;

	static CMaterialReference pMatSkyDraw = NULL;
	static CMaterialReference pMatScreenRestore = NULL;
	static CMaterialReference pMatCombineMasks = NULL;
#ifdef SHADER_EDITOR_DLL_2006
	pMatSkyDraw = materials->FindMaterial( "postprocessing/skymask_fill_0", TEXTURE_GROUP_OTHER );
	pMatCombineMasks = materials->FindMaterial( "postprocessing/skymask_fill_1", TEXTURE_GROUP_OTHER );
	pMatScreenRestore = materials->FindMaterial( "postprocessing/fb_restore", TEXTURE_GROUP_OTHER );
#else
	if ( !pMatSkyDraw )
	{
		pSkyMats[ 0 ] = new KeyValues( "FILL_SKYMASK" );
		pSkyMats[ 0 ]->SetInt( "$COMBINEMODE", 0 );
		pMatSkyDraw.Init( "__sedit_skyfill", TEXTURE_GROUP_CLIENT_EFFECTS, pSkyMats[ 0 ] );
		//pMatSkyDraw->Refresh();
		//pKV->Clear();
		Assert( pMatSkyDraw );
	}
	if ( !pMatScreenRestore )
	{
		pSkyMats[ 1 ] = new KeyValues( "FULLSCREENQUAD_WRITEA" );
		pSkyMats[ 1 ]->SetString( "$BASETEXTURE", GetFBTex()->GetName() );
		pSkyMats[ 1 ]->SetInt( "$COMBINEMODE", 0 );
		pMatScreenRestore.Init( "__sedit_fbrestore", TEXTURE_GROUP_CLIENT_EFFECTS, pSkyMats[ 1 ] );
		//pMatScreenRestore->Refresh();
		//pKV->Clear();
		Assert( pMatScreenRestore );
	}
	if ( !pMatCombineMasks )
	{
		const char *skymaskname = pSkyMask->GetName();
		pSkyMats[ 2 ] = new KeyValues( "FILL_SKYMASK" );
		pSkyMats[ 2 ]->SetString( "$BASETEXTURE", skymaskname );
		pSkyMats[ 2 ]->SetInt( "$COMBINEMODE", 1 );
		pMatCombineMasks.Init( "__sedit_skyfill", TEXTURE_GROUP_CLIENT_EFFECTS, pSkyMats[ 2 ] );
		//pMatCombineMasks->Refresh();
		//pKV->Clear();
		Assert( pMatCombineMasks );
	}
#endif

	// _rt_SEdit_Skymask
	CMatRenderContextPtr pRenderContext( materials );

	IMaterial *pOperation = pMatSkyDraw;
	if ( bCombineMode )
		pOperation = pMatCombineMasks;

	int dest_width = w;
	int dest_height = h;
	float src_x1 = w - 1;
	float src_y1 = h - 1;

#ifdef SHADER_EDITOR_DLL_2006
	Frustum frustum;
	CViewSetup setup;
	setup.angles = _MainView.angles;
	setup.origin = _MainView.origin;
	setup.x = _MainView.x;
	setup.y = _MainView.y;
	setup.width = _MainView.width;
	setup.height = _MainView.height;
	setup.fov = _MainView.fov;
	setup.context = 0;
	setup.m_bOrtho = false;
	setup.m_flAspectRatio = _MainView.m_flAspectRatio;
	setup.m_vUnreflectedOrigin = setup.origin;
	render->Push3DView( setup, 0, false, NULL, frustum );
#endif

	pRenderContext->PushRenderTargetAndViewport( NULL );
	//pRenderContext->Viewport( x, y, w, h );
	//pRenderContext->DepthRange( 0, 1 );
	//MaterialHeightClipMode_t hClipLast = pRenderContext->GetHeightClipMode();
	//pRenderContext->SetHeightClipMode( MATERIAL_HEIGHTCLIPMODE_DISABLE );
	//const bool bEnableClipping = pRenderContext->EnableClipping( false );

#ifndef SHADER_EDITOR_DLL_2006
	UpdateScreenEffectTexture( GetFBTex(), x, y, w, h );
	//pRenderContext->CopyRenderTargetToTexture( GetFBTex() );
#endif

	// do ops
	pRenderContext->DrawScreenSpaceRectangle( pOperation,
		x, y, dest_width, dest_height,
		x, y, src_x1, src_y1,
		w, h );
//.........这里部分代码省略.........
开发者ID:Biohazard90,项目名称:source-shader-editor,代码行数:101,代码来源:editorinit.cpp


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