Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XNA Content.Load() Memory Usage

In XNA, when calling Content.Load() to load in a resource, if you load the same resource into multiple objects (i.e. the texture for a projectile of which there can be many) are you getting a copy for each object, or is the system just internally referencing the same memory for each one?

I was realizing that having a separate Texture2D object in each item may be a memory issue down the line.

like image 707
Adam Haile Avatar asked Aug 19 '10 18:08

Adam Haile


1 Answers

The ContentManager will cache the object and return the reference to that object when you try to load it again.

like image 190
Marcus Johnson Avatar answered Nov 10 '22 20:11

Marcus Johnson