DirectX 10 video mode switching and performance

1.4k Views Asked by At

In a DirectX 10 application, does switching between fullscreen and windowed mode incur any sort of overhead like having to recreate textures and/or vertexbuffers?

In other words, can I build an application that is designed to do "a lot" of switching between windowed mode and fullscreen mode without having to suffer a performance hit when the switches occur?

2

There are 2 best solutions below

2
On

In DirectX10 there is DXGI. You use a swap chain. The buffer of the swap chain will need to be resized so there is some overhead (of course) but it is supposedly optimized. The thing I would be worried about is causing epileptic seizures on your users by switching view modes.

http://msdn.microsoft.com/en-us/library/bb205075(VS.85).aspx

0
On

In D3D10, you don't need to recreate your textures, buffers or any D3D resources on mode switch. One notable exception is swapchain backbuffer references need to be updated after ResizeBuffers call (which should be done for optimal fullscreen performance), but it's not that big of a deal in terms of performance.

Still, it doesn't mean mode change is cheap. Mode change operation itself is very expensive both for your app and the rest of the system (particularly, in Vista, DWM needs to be restarted). Win7 improved a lot, so I suggest you play with it and see if it meets your performance requirements, but don't expect instant transition.