The information in this article applies to:
SUMMARY
GDI operations, such as TextOut, can be performed on an OpenGL window only
if the window is single-buffered. The Windows NT implementation of OpenGL
does not support GDI graphics in a double-buffered window. Therefore, you
cannot use GDI functions to draw text in a double-buffered window, for
example. To draw text in a double-buffered window, an application can use
the wglUseFontBitmaps and wglUseFontOutlines functions to create display
lists for characters in a font, and then draw the characters in the font
with the glCallLists function.
MORE INFORMATIONThe following file is available for download from the Microsoft
Download Center. Click the file name below to download the file: Glfont.exeFor more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address http://www.microsoft.com/downloads/search.aspand then click How to use the Microsoft Download Center. To specify the TrueType font for which you want wglUseFontOutlines to create display lists, you must first create the desired logical font by using CreateFont or CreateFontIndirect. Then, you must select the HFONT created into a screen device context (HDC) with SelectObject, and send the HDC to the wglUseFontOutlines function. Each character is mapped in the x and y directions in the display lists. You need to specify the depth in the negative z direction in the extrusion parameter of wglUseFontOutlines. You can also specify whether you want the 3-D glyphs to be created with line segments or polygons. To instruct wglUseFontOutlines to create the 3-D glyphs with lines segments, specify WGL_FONT_LINES in the format parameter. To create them with polygons, specify WGL_FONT_POLYGONS. Here is an example showing how to create a set of display lists to draw the characters of the Arial TrueType font as a set of polygons:
To display these 3-D characters in a string, use the following code:
Additional query words: graphics kbfile
Keywords : kbfile kbNTOS350 kbNTOS351 kbNTOS400 kbWinOS2000 kbSDKWin32 kbWinOS95 kbWinOS98 |
Last Reviewed: December 20, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |