fullscreen swapping

Started by
2 comments, last by Namethatnobodyelsetook 18 years ago
My current game can go from windowed to fullscreen and vice versa by completely releasing all textures and all d3d device/object pointers and reinitializing them. It takes about 3-4 seconds to completely reload all the rendering stuff. Is this how window-to-fullscreen is supposed to be handled? Is there a quicker way? To switch to fullscreen, the d3d device is created with windowed set to false and the size of the backbuffer is GetSystemMetrics with SM_CXSCREEN and SM_CYSCREEN. The backbuffer format is left at D3DFMT_UNKNOWN. Should I be doing more to swith to fullscreen mode and back?
-------Harmotion - Free 1v1 top-down shooter!Double Jump StudiosBlog
Advertisement
For faster way you should use D3DPOOL_MANAGED instead of D3DPOOL_DEFAULT, because then you don't have to release or restore anything, directx will handle it for you. For example, MANAGED flag will make a copy of a texture to memory (not in GPU), this means that it won't load it from disk and loading from disk is slower than copying from memory. Try it out first, for more information check SDK. :)
Sincerely,Arto RuotsalainenDawn Bringer 3D - Tips & Tricks
I am using d3dpool_managed for memory.

I still have to release all my textures, then release all my d3d stuff, then init. everything from scratch, don't I?
-------Harmotion - Free 1v1 top-down shooter!Double Jump StudiosBlog
No, anything in pool managed can be handled by D3D automatically, as D3D has a system memory copy of all these resources. Pool default objects, such as render targets, dynamic vertex buffers, etc must be destroyed and recreated, but regular textures and vertex data can safely be ignored during Reset.

This topic is closed to new replies.

Advertisement