Hi all,
I ran into a funny problem today... using visual studio 2010, I did this:
Quad& aQuad=aSprite1.GetTextureQuad();
printf("Quad Center: %f,%f",aQuad.Center().mX,aQuad.Center().mY);
//
// Re-use the reference...
//
aQuad=aSprite2.GetTextureQuad();
printf("Quad Center (2): %f,%f",aQuad.Center().mX,aQuad.Center().mY);
....and I get the same value for both printfs-- the value that came from aSprite2. It's like it completely discarded the referenced data to aSprite1.
If I change it to this:
Quad& aQuad=aSprite1.GetTextureQuad();
printf("Quad Center: %f,%f",aQuad.Center().mX,aQuad.Center().mY);
//
// Use a whole new reference!
//
Quad& aQuad2=aSprite2.GetTextureQuad();
printf("Quad Center (2): %f,%f",aQuad2.Center().mX,aQuad2.Center().mY);
...Then it works as expecting, printing out two different center points for two different quads.
So my question is, am I running into a compiler bug here, or is this a known shortcoming of references that I've just never heard of until this point?
Thanks!