Hello,
I've been using DrawingSurfaces for quite a long time, doing sometimes complex stuff, without asking myself too many questions: Just get the surface, draw onto it, then release it!
But I'm actually curious about scenarios where the surface has been released too early or too late. Do such scenarios exist? Is there such a thing as "releasing a surface too early" or "too late"?
For example, I've successfully managed to do this: 1. Get the drawingSurface of a sprite, 2. Draw things, 3. Draw that sprite into another DrawingSurface before releasing its surface. It works, apparently.
2. Also, out of curiosity: when you get the surface, does it copy stuff or does it just create a pointer to its data? Is GetDrawingSurface resources intensive?
I've been using DrawingSurfaces for quite a long time, doing sometimes complex stuff, without asking myself too many questions: Just get the surface, draw onto it, then release it!
But I'm actually curious about scenarios where the surface has been released too early or too late. Do such scenarios exist? Is there such a thing as "releasing a surface too early" or "too late"?
For example, I've successfully managed to do this: 1. Get the drawingSurface of a sprite, 2. Draw things, 3. Draw that sprite into another DrawingSurface before releasing its surface. It works, apparently.
2. Also, out of curiosity: when you get the surface, does it copy stuff or does it just create a pointer to its data? Is GetDrawingSurface resources intensive?