Stuck on balls bouncing off walls

The Partridge Family were neither partridges nor a family. Discuss.
albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Stuck on balls bouncing off walls

Post by albinopapa » May 8th, 2017, 2:13 am

Yeah, between the : and {} is called the initializer list and when you construct an object, such as a RectF, the memory that is allocated for the object is filled immediately with that data before the function body {} of the constructor is even called, so it's more efficient if you can get away with it.

I might have mentioned all this on the thread I posted, but there are instances where you won't be able to use the initializer list.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

migueltherat
Posts: 5
Joined: April 22nd, 2017, 1:42 am

Re: Stuck on balls bouncing off walls

Post by migueltherat » May 8th, 2017, 5:08 am

I think you did mention it on the other thread, but it helps to have it worded again. Thanks. I guess earlier I had been under the impression that you only did that colon thing on the very first constructor for a class.

Post Reply