[saco] Implement CDXUTDialogResourceManager::OnDestroyDevice()

This commit is contained in:
RD42 2024-05-15 22:24:47 +08:00
parent d639d50d1e
commit 38a476378e
2 changed files with 26 additions and 0 deletions

View File

@ -59,6 +59,31 @@ void CDXUTDialogResourceManager::OnLostDevice()
}
//--------------------------------------------------------------------------------------
void CDXUTDialogResourceManager::OnDestroyDevice()
{
int i=0;
//m_pd3dDevice = NULL;
// Release the resources but don't clear the cache, as these will need to be
// recreated if the device is recreated
for( i=0; i < m_FontCache.GetSize(); i++ )
{
DXUTFontNode* pFontNode = m_FontCache.GetAt( i );
SAFE_RELEASE( pFontNode->pFont );
}
for( i=0; i < m_TextureCache.GetSize(); i++ )
{
DXUTTextureNode* pTextureNode = m_TextureCache.GetAt( i );
SAFE_RELEASE( pTextureNode->pTexture );
}
SAFE_RELEASE( m_pSprite );
}
//--------------------------------------------------------------------------------------
void DXUTBlendColor::Init( D3DCOLOR defaultColor, D3DCOLOR disabledColor, D3DCOLOR hiddenColor )
{

View File

@ -65,6 +65,7 @@ public:
HRESULT OnResetDevice();
void OnLostDevice();
void OnDestroyDevice();
// Shared between all dialogs
IDirect3DStateBlock9* m_pStateBlock;