Jump to content
  • Advertisement
Sign in to follow this  
blaze02

fullscreen swapping

This topic is 4467 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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. :)

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!