Content Loader

Dec 30, 2013 at 9:37 PM
Are there any plans to bring the content loader from XNA forward? The reason why I ask is that FxFactory caches effects and textures, but not mesh geometry. If support was added for models, I would definitely use it strategically.
Coordinator
Dec 30, 2013 at 10:08 PM
To instance models, you would use multiple Model class instance but they would reference the same ModelMesh instances. That's why Model's 'meshes' is a list vector if std::shared_ptr<ModelMesh>. If you make a copy of the Model class, it won't 'deep-copy' the geometry data...
Dec 30, 2013 at 10:57 PM
Hey Chuck. Thank you again for your insight. My use case is that I want to keep the model (and mesh) content cached in memory for subsequent retrieval based on filename -- returning a reference to an object is a capability the XNA content loader provided. I think it is trivial to add a static dictionary which uses a filename as a key to return a reference to a model. I think my question is more along the lines of, will this capability be supported in DirectXTK to provide feature parity with XNA? Am I thinking too much like a C# programmer?
Coordinator
Dec 31, 2013 at 12:37 AM
Maintaining your own cache of Model instances seems like the best approach... Caching policies can vary pretty widely, and I try not to impose too much policy in the way DirectXTK is written. All the texture cache (and for DGSL, pixel shader caching) is done in the IEffectFactory interface precisely so you can implement your own caching policy if desired.
Marked as answer by walbourn on 12/30/2013 at 5:37 PM