Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Writing text field with OpenGL.

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2002
    Location
    Israel
    Posts
    18

    Writing text field with OpenGL.

    Hi.

    I have to implement a text field, including writing into it in variant fonts, how can I do it with OpenGL?
    ** It must support Windows, Linux, and Mac.

    Thanks Itzik.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,704

    Re: Writing text field with OpenGL.

    The native font systems of Win32 and MacOS are far beyond those of OpenGL, and X has some font capabilities too. Thus, I'd suggest you render into an offscreen buffer using each native API on each platform, and then upload as a texture for display.

    Implementing the same application-level interface using different code for different platforms is very common in portable programs.

    If you want a solution that doesn't use any native facilities, look into the FreeType library; let that render into an offscreen bitmap and upload as texture. However, that way, the user won't necessarily get the same set of fonts as (s)he is used to on their machine.
    "If you can't afford to do something right,
    you'd better make sure you can afford to do it wrong!"

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2002
    Location
    Israel
    Posts
    18

    Re: Writing text field with OpenGL.

    Do you know about any code sample implement the solution you suggested?

    Thanks.

    Originally posted by jwatte:
    The native font systems of Win32 and MacOS are far beyond those of OpenGL, and X has some font capabilities too. Thus, I'd suggest you render into an offscreen buffer using each native API on each platform, and then upload as a texture for display.

    Implementing the same application-level interface using different code for different platforms is very common in portable programs.

    If you want a solution that doesn't use any native facilities, look into the FreeType library; let that render into an offscreen bitmap and upload as texture. However, that way, the user won't necessarily get the same set of fonts as (s)he is used to on their machine.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •