From e9afc98da1f8615607961345de8cdd666342523c Mon Sep 17 00:00:00 2001 From: spacy51 Date: Sat, 1 Dec 2007 21:22:02 +0000 Subject: [PATCH] optimized font treatment on device reset --- src/win32/Direct3D.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/win32/Direct3D.cpp b/src/win32/Direct3D.cpp index 2bc04a40..e89f6850 100644 --- a/src/win32/Direct3D.cpp +++ b/src/win32/Direct3D.cpp @@ -734,7 +734,10 @@ bool Direct3DDisplay::resetDevice() if( !pDevice ) return false; HRESULT hr; - destroyFont(); + if( pFont ) { + // prepares font for rest + pFont->OnLostDevice(); + } destroyTexture(); prepareDisplayMode(); @@ -751,7 +754,10 @@ bool Direct3DDisplay::resetDevice() return false; } - createFont(); + if( pFont ) { + // re-aquires font resources + pFont->OnResetDevice(); + } createTexture(); setOption( _T("d3dFilter"), theApp.d3dFilter ); failed = false;