Re: XNA Framework When is LoadGraphicsContent(true) called?
Jon Watte
Yes, that is the way to do it. It is not necessarily inelegant (because you can hang other functionality on the TextureSupplier, if you want), but it is somewhat cumbersome. What's most annoying is that they could just have done this within the Texture2D implementation in XNA, so that device re-set and device re-creation didn't differ. As it is now, resets are handled by the runtime, but re-creates are handled by you.
In my non-managed code, I actually only create DEFAULT pool data, to save on system RAM, and then handle reset as a re-create. That leads to simpler code, and is robust even on drivers that have occasional bugs with reset.
What's even more annoying is that, when you assign textures to meshes, you assign Texture2D, not your TextureSupplier, so you also have to keep track of the relation of what meshes (or MeshSuppliers) use what textures (or TextureSuppliers).
It may be possible to go into the ContentManager and make it create your own Texturesubclass for Texture assets. You'd have to poke around among the type demarshallers to do that, though, and I don't think it exposes enough public/protected members to actually succed in that approach.