View Full Version : How to show Text on OpenGL window?

03-25-2001, 03:21 PM
Dear All:

I have an OpenGL application, and
I use the "CSplitterWnd m_wndSplitter"
and "m_wndSplitter.CreateStatic(this, 2, 2)"
to split the OpenGL window into 4 sub windows.
How can show the "Text" on the Upper-Left of
all 4 sub windows? (Such that each window has
something like "TOP", "LEFT", "RIGHT"...)
Can I use the "TextOut" command?
Also, in which message hander should I
put the commands (in OnPaint? Or OnDraw()?)

03-26-2001, 05:12 AM
If you've passed the DC to opengl, then output functions like textout will not work, which should be no surprise.

The easiest way I've seen to do simple text output is by using wglUseFontBitmaps, and the MSDN has an easy-to-understand sample using that function. You should also go to nehe's site and read his tutorials on the subject as well.