本文整理汇总了C++中CDXUTDialog::Refresh方法的典型用法代码示例。如果您正苦于以下问题:C++ CDXUTDialog::Refresh方法的具体用法?C++ CDXUTDialog::Refresh怎么用?C++ CDXUTDialog::Refresh使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDXUTDialog
的用法示例。
在下文中一共展示了CDXUTDialog::Refresh方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnResetDevice
//--------------------------------------------------------------------------------------
// This callback function will be called immediately after the Direct3D device has been
// reset, which will happen after a lost device scenario. This is the best location to
// create D3DPOOL_DEFAULT resources since these resources need to be reloaded whenever
// the device is lost. Resources created here should be released in the OnLostDevice
// callback.
//--------------------------------------------------------------------------------------
HRESULT CALLBACK OnResetDevice( IDirect3DDevice9* pd3dDevice,
const D3DSURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext )
{
HRESULT hr;
V_RETURN( g_DialogResourceManager.OnD3D9ResetDevice() );
V_RETURN( g_SettingsDlg.OnD3D9ResetDevice() );
if( g_pFont )
V_RETURN( g_pFont->OnResetDevice() );
if( g_pEffect )
V_RETURN( g_pEffect->OnResetDevice() );
// Store the correct technique handles for each material
for( UINT i = 0; i < g_MeshLoader.GetNumMaterials(); i++ )
{
Material* pMaterial = g_MeshLoader.GetMaterial( i );
const char* strTechnique = NULL;
if( pMaterial->pTexture && pMaterial->bSpecular )
strTechnique = "TexturedSpecular";
else if( pMaterial->pTexture && !pMaterial->bSpecular )
strTechnique = "TexturedNoSpecular";
else if( !pMaterial->pTexture && pMaterial->bSpecular )
strTechnique = "Specular";
else if( !pMaterial->pTexture && !pMaterial->bSpecular )
strTechnique = "NoSpecular";
pMaterial->hTechnique = g_pEffect->GetTechniqueByName( strTechnique );
}
// Create a sprite to help batch calls when drawing many lines of text
V_RETURN( D3DXCreateSprite( pd3dDevice, &g_pTextSprite ) );
// Setup the camera's projection parameters
float fAspectRatio = pBackBufferSurfaceDesc->Width / ( FLOAT )pBackBufferSurfaceDesc->Height;
g_Camera.SetProjParams( D3DX_PI / 4, fAspectRatio, 0.1f, 1000.0f );
g_Camera.SetWindow( pBackBufferSurfaceDesc->Width, pBackBufferSurfaceDesc->Height );
g_HUD.SetLocation( pBackBufferSurfaceDesc->Width - 170, 0 );
g_HUD.SetSize( 170, 170 );
g_HUD.Refresh();
g_SampleUI.SetLocation( pBackBufferSurfaceDesc->Width - 170, pBackBufferSurfaceDesc->Height - 350 );
g_SampleUI.SetSize( 170, 300 );
g_SampleUI.Refresh();
return S_OK;
}