本文整理汇总了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;
}
示例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 );
}
示例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 );
}