Lisp HUG Maillist Archive

OpenGL text on the Macintosh

Does anyone know how to draw text in OpenGL on the Macintosh?  The 
icosahedron example draws text in Windows but not on the Macintosh.

I've found some Cocoa example code that writes glyphs to an NSImage 
and stores the images as an OpenGL bitmap.  I'm looking into doing 
something similar from LispWorks so that I can use glCallLists to 
display text to an opengl-pane.  I would appreciate any pointers.

I'm running into a problem using Objective-C global variables that 
are used as keys to NSDictionary for specifying font attributes.  If 
anyone knows how to access Objective-C global variables from 
LispWorks, let me know.

Thanks in advance!

-Jeremy


Re: OpenGL text on the Macintosh

I've half-ported some code over from a tutorial on drawing stroke fonts 
in C++ in openGL.  It's very limited in that it draws lines for each 
character, but depending on what you are trying to do, it might work for 
you.  The stroke definitions were pulled from the glut stroke fonts, so 
they don't look too bad.  let me know and I'll send you the code. 

Andrew Shilliday

Jeremy Jones wrote:

> Does anyone know how to draw text in OpenGL on the Macintosh?  The 
> icosahedron example draws text in Windows but not on the Macintosh.
>
> I've found some Cocoa example code that writes glyphs to an NSImage 
> and stores the images as an OpenGL bitmap.  I'm looking into doing 
> something similar from LispWorks so that I can use glCallLists to 
> display text to an opengl-pane.  I would appreciate any pointers.
>
> I'm running into a problem using Objective-C global variables that are 
> used as keys to NSDictionary for specifying font attributes.  If 
> anyone knows how to access Objective-C global variables from 
> LispWorks, let me know.
>
> Thanks in advance!
>
> -Jeremy
>
>


Updated at: 2020-12-10 08:57 UTC