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


C++ LPDIRECT3DDEVICE9::SetCurrentTexturePalette方法代码示例

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


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

示例1:

HRESULT HookIDirect3DDevice9::SetCurrentTexturePalette(LPVOID _this, UINT PaletteNumber)
{
	LOG_API();
	return pD3Dev->SetCurrentTexturePalette(PaletteNumber);
}
开发者ID:zxmarcos,项目名称:bg4t_monitor,代码行数:5,代码来源:D3DWrapper.cpp

示例2: SetPalette

/* Load the palette, if any, for the given texture into a palette slot, and make
 * it current. */
static void SetPalette( unsigned TexResource )
{
	/* If the texture isn't paletted, we have nothing to do. */
	if( g_TexResourceToTexturePalette.find(TexResource) == g_TexResourceToTexturePalette.end() )
		return;

	/* Is the palette already loaded? */
	if( g_TexResourceToPaletteIndex.find(TexResource) == g_TexResourceToPaletteIndex.end() )
	{
		/* It's not.  Grab the least recently used slot. */
		int iPalIndex = g_PaletteIndex.front();

		/* If any other texture is currently using this slot, mark that palette unloaded. */
		for( map<unsigned,int>::iterator i = g_TexResourceToPaletteIndex.begin(); i != g_TexResourceToPaletteIndex.end(); ++i )
		{
			if( i->second != iPalIndex )
				continue;
			g_TexResourceToPaletteIndex.erase(i);
			break;
		}

		/* Load it. */
#if !defined(XBOX)
		TexturePalette& pal = g_TexResourceToTexturePalette[TexResource];
		g_pd3dDevice->SetPaletteEntries( iPalIndex, pal.p );
#else
		ASSERT(0);
#endif

		g_TexResourceToPaletteIndex[TexResource] = iPalIndex;
	}
	
	const int iPalIndex = g_TexResourceToPaletteIndex[TexResource];

	/* Find this palette index in the least-recently-used queue and move it to the end. */
	for(list<int>::iterator i = g_PaletteIndex.begin(); i != g_PaletteIndex.end(); ++i)
	{
		if( *i != iPalIndex )
			continue;
		g_PaletteIndex.erase(i);
		g_PaletteIndex.push_back(iPalIndex);
		break;
	}

#if !defined(XBOX)
	g_pd3dDevice->SetCurrentTexturePalette( iPalIndex );
#else
	ASSERT(0);
#endif
}
开发者ID:augustg,项目名称:openitg,代码行数:52,代码来源:RageDisplay_D3D.cpp


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