PDA

View Full Version : DirectX LostDevice ID3DXFont?



lordzero
03-10-2007, 04:25 PM
Hello

Using ID3DXFont to draw a simple text in the screen when i press the return key "enter" i put this code:

if (ssAlt in Shift) and (Key=VK_RETURN) then
begin

SwitchFullScreenWindowed();

end;

and when i switch the window mode for windowed or fullscreen the renderization disappear...

when i free the font first.... reset the device and recreate the font its works....

but dont have a other way to do it?

Greets

chronozphere
03-10-2007, 04:51 PM
AFAIK there is no other way to do it :)

What's wrong with the 'destroy.. reset.. recreate' method? When you change your displaymode from fullscreen to windowed, windows GDI takes control of all video-memory. Therefore it erases all data it doesn't know... your textures, meshes font's etc... just to free mem for windows tasks. That 's why you need to re-create your resources every time.

You said it worked for you, so i would use that method, instead of wondering whether there is another way to do it. ;)

Greets Chronozphere.