BackBuffer Scale

Started by
1 comment, last by blaze02 18 years ago
Can someone tell me how to resize the backbuffer to the size of a resizable window? Is this possible without resetting the device and if not, whats the cost of resetting the d3ddevice? Thank you.
Advertisement
Resizing the actual buffer at runtime is not recommended. It would require reallocation of memory, which is pretty slow. Resetting the device would likely slow the application down a bit, so I'd say it wouldn't provide smooth resizing.

If you're looking for smooth resizes, I'd recommend you create a buffer big enough for the window's max size, and only use a portion of it when rendering. This would waste a bit of memory, but would provide smooth rendering through resizing.

The Present call can accept two RECTs for the source and destination areas. These can be used to only use a portion of the backbuffer.

Hope this helps.
Sirob Yes.» - status: Work-O-Rama.
Thats typically why games do not allow you to resize. I would recommend not allowing resizing at all. However, you should allow the player to fullscreen. In which case, you would need to recreate the device and textures. In this case, a gross slow-down (2-3 seconds, depending on how many/much textures you need to reload) is fine.
-------Harmotion - Free 1v1 top-down shooter!Double Jump StudiosBlog

This topic is closed to new replies.

Advertisement