PDA

View Full Version : wglUseFontOutlines and TextOut



gator
06-14-2005, 08:23 PM
I would like GDI text rendered by TextOut() to look exactly and to be placed exactly at the
same location like outlined text created with wglUseFontOutlines(). However, I'm having
a little problem with it. The onscreen font size and placement is off.

Any suggestions?

gator
06-15-2005, 09:11 AM
Q131024 - Drawing Three-Dimensional Text in OpenGL Appliations
http://support.microsoft.com/kb/q131024/

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.
Is a single-buffered window the same as an offscreen rendering suface?

Is it possible to use TextOut to render GDI text to an offscreen rendering suface,
and then copy the results back to a double-buffered window, and keep the text and its
anti-aliased edges intact, e.g. not blended with the background?

That is to say, I want to preserve the transparency of the text, so I can transfer it
from the offscreen rendering surface to the double-buffered window.