mono/MonoGame — pull request #446 by marshallward (2012-05-03 12:21:14+00:00)
Title: SetRenderTarget saves Viewport when switching from Back Buffer

If `SetRenderTarget` was called in `GraphicsDevice`, it would overwrite `Viewport` (even if nothing was drawn). After switching back to the Back Buffer, it did not restore the original Viewport. This gave the impression that everything was drawn relative to a bottom-right origin (as in OpenGL) on a window resize, which differs from XNA output.

This patch re-enables the `savedViewport` variable (previously removed) and the behaviour now matches XNA (and the `develop` branch) during window `OnResize` events.

---

Comments in the code suggest that there might have been broader plans for `renderTarget` management, so this might not be the preferred solution.