RivieraKid

If i do this

model1 = content.Load<Model>( "myModel" ); 

model2 = content.Load<Model>( "myModel" );

do model1 and model2 hold the same reference

if not, does the data inside them (the vertices and index buffers) hold the same reference

Thank You



Re: XNA Framework Question about content pipeline

Joel Martinez

Yes, they are the same reference ... the content manager notes that it already loaded myModel the second time you request it and simply gives you the same object again :-)

Incidentally, if you have more than one content manager, the default behavior is that requesting the same asset from two different managers will result in the asset being loaded into memory twice. I've got a sample on my website that shows how to get content managers that will share references between them so that only one copy of a given asset will be loaded:
http://codecube.net/item.asp cc_ItemID=343

Please note that I haven't had a chance to update the sample to v1, so you'll simply have to remove and reference the xna .dlls and it will work :-)