Original Post
Hi. I can't see my text when printing (with wglUseFontBitmaps, i think the picture freeze (not the loop) when i tried with wglUseFontOutlines). Here's my code: Idle loop: Text::Text(): Text::render(str,...): Text::create(): Before the text drawing, i rendered a rectangle so i guess the rendering contex is fine, isnt it? (However, i cant see it if i draw the text!) What am I missing here? (in both Outlines and Bitmaps, its the same code. the only difference is that this i have to uncomment and this to comment for Outlines instead of Bitmaps). thanks, pex.
// Device d=init(win); Text text;
d.color(RGB(100,0,0));
//d.scale(V(1,1,0));
//d.vertex(V(0,0,-6));
glRasterPos2f(0,0);
text.render("Time");
d.swap();
logfont.lfHeight = -12; // setup font characteristics
logfont.lfWidth = 0;
logfont.lfEscapement = 0;
logfont.lfOrientation = 0;
logfont.lfWeight = FW_NORMAL;
logfont.lfItalic = FALSE;
logfont.lfUnderline = TRUE;
logfont.lfStrikeOut = FALSE;
logfont.lfCharSet = ANSI_CHARSET;
logfont.lfOutPrecision = OUT_DEFAULT_PRECIS;
logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
logfont.lfQuality = PROOF_QUALITY;
logfont.lfPitchAndFamily = FF_DONTCARE|DEFAULT_PITCH;
strcpy(logfont.lfFaceName,"Courier New");
list=0;
created=0;
va_list ap;
va_start(ap,str);
vsprintf(str,str,ap);
va_end(ap);
if (!created)
create();
glPushAttrib(GL_LIST_BIT);
glListBase(list);
glCallLists(strlen(str),GL_UNSIGNED_BYTE,str);
glPopAttrib();
this->str = str;
//if (!list&&!glIsList(list)) puts("NOT A LIST!"); // Printed if not commented!
HFONT h=CreateFontIndirect(&logfont);
SelectObject(wglGetCurrentDC(),h);
list=glGenLists(256);
//wglUseFontOutlines(wglGetCurrentDC(),0,256,list,0.0f,0.1f,WGL_FONT_POLYGONS,gmf);
wglUseFontBitmaps(wglGetCurrentDC(),0,256,list);
created=1;