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.
Stuck on balls bouncing off walls
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Stuck on balls bouncing off walls
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
-
- Posts: 5
- Joined: April 22nd, 2017, 1:42 am
Re: Stuck on balls bouncing off walls
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.