From: Richard R. <sf...@ol...> - 2004-08-14 03:15:18
|
(Sorry, I cannot directly reply to John's message, but I've read it. (^&) You can implement custom fonts in WIN32 without breaking binary compatibility. What freeglut does (I have not checked old GLUT)---and what OpenGLUT does on WIN32 and UNIX_X11---is, schematically: real_pointer =3D translate_supplied_font (font); =2E..if the translation fails, then the font-related activity fails. GLUT (apparently), and freeglut on UNIX_X11, can just return the user-supplied {font} as the {real_pointer}. There is nothing stopping one from saying, schematically: real_pointer =3D translate_supplied_font (font); if (!real_pointer) real_pointer =3D font; I find that a bit icky, but from a pragmatic point of view it does let you get away with it. (The real names of variables and functions may have been changed to protect the innocent. (^&) The problems: Nigel has pointed out that doing it that way may not be friendly to other languages. (So you may have to use C or C++ or assembly in order to take advantage of this.) I'd add that some compilers, or compile-time options may also break attempts to use it, because the freeglut/OpenGLUT internal font structure may be padded or packed differently for speed vs. space. It also exhibits a UNIX-ish bias: The only way to generate the font structures (if you don't like a *lot* of typing; (^&) at this time is to use a tool. GLUT used and provided one. freeglut had another. I updated that tool substantially in OpenGLUT when fixing the missing glyphs for OpenGLUT. In all cases, the tools directly talk to X to render the fonts to bitmaps. You could, of course, adapt or recreate the tool for WIN32 or other systems. Finally, the structure is not a documented part of the API. I do not know if the freeglut version is binary-compatible with the old GLUT version, with any compiler options or targets. (Does anyone know?) --=20 "I probably don't know what I'm talking about." http://www.olib.org/~rkr/ |