Fastest way of drawing to a view?
Fastest way of drawing to a view?
- Subject: Fastest way of drawing to a view?
- From: Jonathan del Strother <email@hidden>
- Date: Mon, 12 Jan 2004 17:22:56 +0000
I'm doing a kinda flocking simulation, which involves drawing several
(say, 500) creatures on screen. The creatures currently consist of a
small box a couple of pixels wide, and a line poking out, indicating
their direction of travel...
What's the fastest way of drawing this?
My current method something like this.:
Get the context.
Fill it with white.
for each creature
{
set the line color
create and stroke a box for the creature's body
create and stroke a line representing direction of travel
}
flush the context.
This is all done using the Quartz 2d functions (eg CGContextAddRect,
CGContextBeginPage,
and so on).
Does anyone have any general tips to speed this up, or expensive
function calls that I should avoid?
Thanks,
Jon
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.