mono/MonoGame — pull request #631 by Aranda (2012-07-28 15:08:55+00:00)
Title: develop3d - Android reloads graphics assets when GL Context recreated

Notes:

- I've tried to reuse as much code as possible. XNB decompressing has been refactored so it can be used when loading and reloading assets.
- Support for reading into existing instances added to Texture2D, SpriteFont, Model ContentTypeReader classes. I've taken the view that we only need to update the graphics resources and discard anything else when an existingInstance is supplied.
- Effect does not get reloaded through the ContentManager. Instead it caches the glsl code and recompiles that. Only glsl support added for now
- Added triggering of DeviceReset events to allow other GPU assets to be reloaded or recreated. Not sure if it's the best spot to trigger from, but it seems as good as any given current state of things. Textures loaded with Texture2D.FromStream() should be reloaded using Texture2D.Reload() in this event
- No support added for setting the IsContentLost property on DynamicVertexBuffer, DynamicIndexBuffer or RenderTarget2D
- So far only tested on Novo Tornados7 (ICS) and Samsung Galaxy II (ICS).

Happy code review,
Aranda