Re: NSQuickDrawView opacity troubles
Re: NSQuickDrawView opacity troubles
- Subject: Re: NSQuickDrawView opacity troubles
- From: Scott Thompson <email@hidden>
- Date: Mon, 5 Apr 2004 21:42:47 -0500
Is there a more efficient way to draw a GWorld into a view other than
NSQuickDrawView?
You can create a CGBitmapImageRef that shares memory with the GWorld
and then you can use CGDrawImage to blit the image into the CG context
of the view. You may be able to do a similar technique with NSImage
but I've never gotten the colors to map out quite right
The absolute most efficient way, however, would be to use an OpenGL
view (maybe NSOpenGLView) and use some fancy QuickTime techniques to
map the GWorld memory into an OpenGL texture. Then draw the bitmap
using a polygon with the created texture. The advantage is that
(depending on how you set up the OpenGL texture) the video card can
directly pull the pixels it needs out of memory and you end up
unloading a lot of the blitting overhead onto the Graphics Coprocessor.
There was a WWDC session on the technique in 2003 and the code for that
technique is given at:
<
http://developer.apple.com/samplecode/OpenGL_Image/OpenGL_Image.html>
Scott
_______________________________________________
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.