opengl text output

hello,

can someone tell me how I can write text to my mfc-opengl window ? Is there an opengl command to do this ?

the best approach I have found is to draw textured quads with letters.

Haven’t found yet how the OGL font facility works

hm, thats a complex way for such a simple thing.

OpenGL ist graphics api not a typewriter…

In a Win32 enviroment, you can use wglUseFontBitmap() or wglUseFontOutline() for create display lists with Windows fonts.

CFont font;
int fontDL;
char* text = “Hello World!”;

font.CreatePointFont(120,“Arial”,clientDC);
SelectObject(clientDC->GetSafeHdc(),font);
wglUseFontBitmaps(clientDC->GetSafeHdc(),0,255,fontDL);
glRasterPos2f(x,y);
glListBase(fontDL);
glCallLists(strlen(text),GL_UNSIGNED_BYTE,text);

This code write “Hello World!” in (x,y) using Arial 12.

[This message has been edited by Boresight (edited 09-17-2001).]

thanx boresight, exactly what i needed !