- procedure MakeRasterFont(var TextSystem : TTextSystem);
- var fnt : HFONT;
- begin
- TextSystem.Font.ID := glGenLists (128); // generate 128 display lists
- fnt := CreateFont(TextSystem.Font.Height, TextSystem.Font.Width,0,0, FW_NORMAL, 0, 0, 0, OEM_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY , FF_DONTCARE + DEFAULT_PITCH, Pchar(TextSystem.Font.Name));
- SelectObject(h_DC, fnt);
- wglUseFontBitmaps(h_DC, 0, 127, TextSystem.Font.ID);
- end;
- procedure PrintChar(TextChar : TTextChar; Font : TTextFont);
- var
- S : string;
- begin
- if not TextChar.Draw then
- exit;
- glLoadIdentity;
- with TextChar do
- begin
- glColor4f(Colour.X,Colour.Y,Colour.Z,Alpha);
- glRasterPos2f(Position.X, SCREEN_HEIGHT-Position.Y); // Set the position for the text to be rendered
- glPushAttrib (GL_LIST_BIT);
- glListBase(Font.ID);
- S := Charactor;
- glCallLists(length(S), GL_UNSIGNED_BYTE, PChar(S));
- glPopAttrib();
- end;
- end;