[saco] Implement CDXUTDialogResourceManager::OnResetDevice()

This commit is contained in:
RD42 2024-05-15 22:21:07 +08:00
parent 422163126b
commit 31f6c23496
2 changed files with 23 additions and 0 deletions

View File

@ -19,6 +19,27 @@ CDXUTDialogResourceManager::CDXUTDialogResourceManager()
}
//--------------------------------------------------------------------------------------
HRESULT CDXUTDialogResourceManager::OnResetDevice()
{
HRESULT hr = S_OK;
for( int i=0; i < m_FontCache.GetSize(); i++ )
{
DXUTFontNode* pFontNode = m_FontCache.GetAt( i );
if( pFontNode->pFont )
pFontNode->pFont->OnResetDevice();
}
if( m_pSprite )
m_pSprite->OnResetDevice();
m_pd3dDevice->CreateStateBlock( D3DSBT_ALL, &m_pStateBlock );
return S_OK;
}
//--------------------------------------------------------------------------------------
void DXUTBlendColor::Init( D3DCOLOR defaultColor, D3DCOLOR disabledColor, D3DCOLOR hiddenColor )
{

View File

@ -63,6 +63,8 @@ class CDXUTDialogResourceManager
public:
CDXUTDialogResourceManager();
HRESULT OnResetDevice();
// Shared between all dialogs
IDirect3DStateBlock9* m_pStateBlock;
ID3DXSprite* m_pSprite; // Sprite used for drawing