How do I stop stretching during window re-size in XNA?

Posted by Bradley Uffner on Game Development See other posts from Game Development or by Bradley Uffner
Published on 2012-10-26T18:29:40Z Indexed on 2012/10/26 23:19 UTC
Read the original article Hit count: 278

Filed under:
|
|

In my windowed mode XNA game when the user resizes the window the game stops updating the window and the last frame drawn is stretched and distorted until the user releases the mouse and the resize completes.

Is there any way to have the game continue to run "normally", updating frames and redrawing the screen, during the resize event?

I realize that keeping the render loop going while resizing may not be possible or recommended due do hardware managed resources getting continually created and destroyed, but is there any way to stop the ugly stretching? Ideally by leaving the existing frame unscaled in the top left, or with a black screen if that isn't possible.

© Game Development or respective owner

Related posts about XNA

Related posts about xna-4.0