Sign in to follow this  
michaelbeirne

BackBuffer Scale

Recommended Posts

michaelbeirne    122
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.

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this