views:

401

answers:

1

I would like to use CGRectMake to feed a rect structure to an image (image drawInRect:rect). Problem is, the position and the size of this rect will dynamically changed. Is there a performance hit for calling CGRectMake every "game loop frame"?

Thanks!

+3  A: 

If you look at the definition of CGRectMake (Control Click on the function name in Xcode and choose "Jump to definition"), you will see that it is an inlined function.
Therefore you will not loose any performance if you change all fields of the struct.
If you modify just some fields, I would do that "by hand".

weichsel
very interesting and very helpful that 'jump to definition' !thanks!
Edward An