DirectX fast switch between Fullscreen-Windowed mode

Started by
1 comment, last by sirob 18 years ago
Hi guys! I'm just done searching this site, and still have a question. There is a way to fast switch between fullscreen and windowed mode? What I mean: currently my app when switching to fullscreen or windowed mode it releases all textures etc. and recreating it back after device is restored. But there is a lot of textures are loaded, so it takes too long time, and QA says that we need to decrease this time. I've saw the game, when you can switch between fullscreen and windwed and it was done less than a second. My app is using directx 7. Please, help!
Advertisement
In DirectX 7 it's not possible.

All resources in the default memory pool have to be released and re-created when the device is reset - which you need to do to change screen modes.
If you were using DX8 or 9, then you could put most things into the managed pool, which doesn't need to have resources released before resetting the device. Unfortunately, the managed pool doesn't exist on DX7.
A possibility I see for improving loading time would be to reduce the calculations that need to be done in order to reload everything when you reset.

For example, if you're using a heightmap terrain, you could save your generated buffers in system memory, after loading the heightmap. In case you need to reset, you wouldn't need to perform any calculations again, you'd only need to upload the already computed data from system memory to GPU memory. Not fast, but at least faster.
This method could be applied to many situations.

You could even take this further and save a copy of textures in their GPU memory format. Doing this, which might be a bit difficult, would save you some loading time on these resources, hopefully reducing reset time.

In a way, this is like writing code to create managed-pool resources, with lesser functionality. Not perfect, but surely might help :).

Hope this helps.
Sirob Yes.» - status: Work-O-Rama.

This topic is closed to new replies.

Advertisement