Re: Rasterizing an NSString to a bitmap
Re: Rasterizing an NSString to a bitmap
- Subject: Re: Rasterizing an NSString to a bitmap
- From: Public Look <email@hidden>
- Date: Fri, 11 Jun 2004 19:03:36 -0400
I have been waiting for someone to point the following out and if
someone has, I missed it:
You can draw Cocoa strings and in fact anything else that Quartz can
render into an Open GL texture and then you have access to the GL
texture data through GL calls. In fact, GL will even convert the data
to whatever buffer format you specify.
The following includes sample code to convert the contents of any
NSView into a texture:
from
http://developer.apple.com/qa/qa2001/qa1325.html
"How do I create an OpenGL texture from an NSView? A: Virtually any
NSView or subclass thereof can be used as a texture in OpenGL. The
basic process involves using an NSBitmapImageRep to store the NSView's
image data in a format that can be readily used as texture data by
OpenGL... "
There is also the following if strings are the only Quartz graphics of
interest:
From
http://developer.apple.com/samplecode/Custom_Cocoa_OpenGL/
Custom_Cocoa_OpenGL.html
"Also included is the same stringtexture class as Cocoa OpenGL has,
showing how to use an NSImage to write a stirng into and then texture
from for high quality font rendering."
_______________________________________________
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.