PDA

View Full Version : How to display Chinese?



helen1024
05-11-2004, 06:58 PM
It can't surport Chinese!
I want to show Chinese with OpenGL.

thanks!

SirKnight
05-11-2004, 08:08 PM
Search these boards. This has been discussed to death in the past.

-SirKnight

jwatte
05-12-2004, 04:25 PM
This just isn't OpenGL related.

Here's how you do it:

1) create an offscreen bitmap using whatever your native OS is (say, a DIBsection using GDI on Windows)

2) load the font you want (say, using CreateFontEx() on Windows, or libttf on UNIX)

3) draw the characters into the bitmap using the appropriate API of your host system. Don't forget GdiFlush() if you're on Windows.

4) upload the bits of the bitmap to GL as a texture, and display that texture on suitable geometry.