Quick question. (I was not able to find documentation about this anywhere)
When you do this:
Texture2D t1;
t1 = content.Load<Texture2D>("some texture");
Texture2D t2;
t2 = t1;
Does it creates a reference or actually copies the texture?
I would like to know it so I can take it into account when implementing related stuff.
Texture2D is a class. Hence, assignment will create a copy of the reference - t1 and t2 will have referential equality, ie Object.ReferenceEquals(t1, t2)
will be true.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With