• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Fastest way of drawing to a view?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Fastest way of drawing to a view?
      • From: "M. Uli Kusterer" <email@hidden>
  • Prev by Date: Re: Error -10827 from Launch Services
  • Next by Date: Re: Need more NSLeftMouseDragged events
  • Previous by thread: Re: Error -10827 from Launch Services
  • Next by thread: Re: Fastest way of drawing to a view?
  • Index(es):
    • Date
    • Thread