本文整理汇总了C++中LPDIRECT3D8::GetAdapterIdentifier方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECT3D8::GetAdapterIdentifier方法的具体用法?C++ LPDIRECT3D8::GetAdapterIdentifier怎么用?C++ LPDIRECT3D8::GetAdapterIdentifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPDIRECT3D8
的用法示例。
在下文中一共展示了LPDIRECT3D8::GetAdapterIdentifier方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetVideoMode
CString RageDisplay_D3D::Init( VideoModeParams p )
{
GraphicsWindow::Initialize();
LOG->Trace( "RageDisplay_D3D::RageDisplay_D3D()" );
LOG->MapLog("renderer", "Current renderer: Direct3D");
typedef IDirect3D8 * (WINAPI * Direct3DCreate8_t) (UINT SDKVersion);
Direct3DCreate8_t pDirect3DCreate8;
#if defined(XBOX)
pDirect3DCreate8 = Direct3DCreate8;
#else
g_D3D8_Module = LoadLibrary("D3D8.dll");
if(!g_D3D8_Module)
return D3D_NOT_INSTALLED;
pDirect3DCreate8 = (Direct3DCreate8_t) GetProcAddress(g_D3D8_Module, "Direct3DCreate8");
if(!pDirect3DCreate8)
{
LOG->Trace( "Direct3DCreate8 not found" );
return D3D_NOT_INSTALLED;
}
#endif
g_pd3d = pDirect3DCreate8( D3D_SDK_VERSION );
if(!g_pd3d)
{
LOG->Trace( "Direct3DCreate8 failed" );
return D3D_NOT_INSTALLED;
}
if( FAILED( g_pd3d->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &g_DeviceCaps) ) )
return
"Your system is reporting that Direct3D hardware acceleration is not available. "
"Please obtain an updated driver from your video card manufacturer.\n\n";
D3DADAPTER_IDENTIFIER8 identifier;
g_pd3d->GetAdapterIdentifier( D3DADAPTER_DEFAULT, 0, &identifier );
LOG->Trace(
"Driver: %s\n"
"Description: %s\n"
"Max texture size: %d\n"
"Alpha in palette: %s\n",
identifier.Driver,
identifier.Description,
g_DeviceCaps.MaxTextureWidth,
(g_DeviceCaps.TextureCaps & D3DPTEXTURECAPS_ALPHAPALETTE) ? "yes" : "no" );
LOG->Trace( "This display adaptor supports the following modes:" );
D3DDISPLAYMODE mode;
for( UINT u=0; u<g_pd3d->GetAdapterModeCount(D3DADAPTER_DEFAULT); u++ )
if( SUCCEEDED( g_pd3d->EnumAdapterModes( D3DADAPTER_DEFAULT, u, &mode ) ) )
LOG->Trace( " %ux%u %uHz, format %d", mode.Width, mode.Height, mode.RefreshRate, mode.Format );
g_PaletteIndex.clear();
for( int i = 0; i < 256; ++i )
g_PaletteIndex.push_back(i);
// Save the original desktop format.
g_pd3d->GetAdapterDisplayMode( D3DADAPTER_DEFAULT, &g_DesktopMode );
/* Up until now, all we've done is set up g_pd3d and do some queries. Now,
* actually initialize the window. Do this after as many error conditions
* as possible, because if we have to shut it down again we'll flash a window
* briefly. */
bool bIgnore = false;
return SetVideoMode( p, bIgnore );
}