Re: How to do Blitters in Cocoa
Re: How to do Blitters in Cocoa
- Subject: Re: How to do Blitters in Cocoa
- From: "Alastair J.Houghton" <email@hidden>
- Date: Fri, 17 Oct 2003 22:49:09 +0100
On Friday, October 17, 2003, at 09:37 pm, Lee A Morgan wrote:
Hi all I posted this to the mac-games-dev list and didn't get much
help so I figured its pretty close to general app direct pixel access.
What's the "proper" way to do a custom blit in Cocoa (that is not
using QuickDraw, OpenGL or Quartz).
If you want to take-over the entire display, you could do worse than
the CGDirectDisplay API, documented in
http://developer.apple.com/technotes/tn/tn2007.html
You might also try the Quartz 2D APIs, in particular
CGBitmapContextGetData()
looks like it might be of use. (You can get a Quartz CGContextRef by
doing [[NSGraphicsContext currentContext] graphicsPort] with the
appropriate view locked.)
Another approach you could take is to use the ordinary Quartz/Cocoa
image drawing APIs, but disable antialiasing, reduce the interpolation
quality and experiment with the number of bytes per line in your
images; I suspect Apple have gone to some lengths to optimise Quartz'
blitting, so it wouldn't surprise me if it is actually fast enough to
do what you want, provided your images are in the right format and it
doesn't have to scale them or antialias them.
Or, alternatively, just stick with what you know and use Carbon.
It might not be a bad idea to post this question on the Omni Group
macosx-dev list, given that they develop games software as well and are
likely to know exactly which techniques will be best for whatever you
want to do.
Kind regards,
Alastair.
_______________________________________________
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.