Skip to main content
gamedev.net
🔒 Locked

BackBuffer Scale

Started by michaelbeirne Apr 15, 2006 at 10:42 PM 1 replies 1k views
Original Post
michaelbeirne
michaelbeirne
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.
sirob
sirob
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.
blaze02
blaze02
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.