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


C++ LPDIRECT3D8::CheckDeviceFormat方法代码示例

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


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

示例1:

int	IsTextureFormatOk( D3DFORMAT TextureFormat, D3DFORMAT AdapterFormat )
{
	int	ret=0;
	HRESULT hr;
	hr = pD3D->CheckDeviceFormat( D3DADAPTER_DEFAULT,
											D3DDEVTYPE_HAL,
											AdapterFormat,
											0,
											D3DRTYPE_TEXTURE,
											TextureFormat );
	if(D3D_OK == hr){
		ret=1;
	}

	hr = pD3D->CheckDeviceFormat( D3DADAPTER_DEFAULT,
											D3DDEVTYPE_HAL,
											AdapterFormat,
											D3DUSAGE_RENDERTARGET,
											D3DRTYPE_TEXTURE,
											TextureFormat );
	if(D3D_OK == hr){
		ret=2;
	}

	return ret;
}
开发者ID:0xrofi,项目名称:Aquaplus,代码行数:26,代码来源:d3d_main.cpp

示例2: SUCCEEDED

bool RageDisplay_D3D::SupportsTextureFormat( PixelFormat pixfmt, bool realtime )
{
#if defined(XBOX)
	// Lazy...  Xbox handles paletted textures completely differently
	// than D3D and I don't want to add a bunch of code for it.  Also, 
	// paletted textures result in worse cache efficiency (see "Xbox 
	// Palettized Texture Performance" in XDK).  So, we'll force 32bit
	// ARGB textures.  -Chris
	// This is also needed for XGSwizzleRect().
	return pixfmt == FMT_RGBA8;
#endif

	// Some cards (Savage) don't support alpha in palettes.
	// Don't allow paletted textures if this is the case.
	if( pixfmt == FMT_PAL  &&  !(g_DeviceCaps.TextureCaps & D3DPTEXTURECAPS_ALPHAPALETTE) )
		return false;

	if(	D3DFORMATS[pixfmt] == D3DFMT_UNKNOWN )
		return false;

	D3DFORMAT d3dfmt = D3DFORMATS[pixfmt];
	HRESULT hr = g_pd3d->CheckDeviceFormat( 
		D3DADAPTER_DEFAULT,
		D3DDEVTYPE_HAL,
		g_d3dpp.BackBufferFormat,
		0,
		D3DRTYPE_TEXTURE,
		d3dfmt);

    return SUCCEEDED( hr );
}
开发者ID:Prcuvu,项目名称:StepMania-3.95,代码行数:31,代码来源:RageDisplay_D3D.cpp

示例3: SUCCEEDED

bool RageDisplay_D3D::SupportsTextureFormat( PixelFormat pixfmt, bool realtime )
{
	// Some cards (Savage) don't support alpha in palettes.
	// Don't allow paletted textures if this is the case.
	if( pixfmt == PixelFormat_PAL  &&  !(g_DeviceCaps.TextureCaps & D3DPTEXTURECAPS_ALPHAPALETTE) )
		return false;

	if( D3DFORMATS[pixfmt] == D3DFMT_UNKNOWN )
		return false;

	D3DFORMAT d3dfmt = D3DFORMATS[pixfmt];
	HRESULT hr = g_pd3d->CheckDeviceFormat( 
		D3DADAPTER_DEFAULT,
		D3DDEVTYPE_HAL,
		g_d3dpp.BackBufferFormat,
		0,
		D3DRTYPE_TEXTURE,
		d3dfmt);

	return SUCCEEDED( hr );
}
开发者ID:SamDecrock,项目名称:stepmania5-http-post-scores,代码行数:21,代码来源:RageDisplay_D3D.cpp


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