Drawing and text in opengl, use mouse to draw lines
提示:画线并显示坐标
核心源码
procedure TForm1.MakeRasters(name: PChar; size: integer);
var
Font: HFONT;
begin
base := glGenLists(96);
Font := CreateFont(-size, 0, 0, 0, FW_LIGHT, 0, 0, 0, ANSI_CHARSET,
OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, FF_DONTCARE or
DEFAULT_PITCH, name);
SelectObject(glDC, Font);
wglUseFontBitmaps(glDC, 32, 96, base);
end;
procedure DeleteRasters;
begin
glDeleteLists(base, 96);
end;
procedure PrintText(text: Ansistring);
begin
if text = ‘’ then
exit;
glPushAttrib(GL_LIST_BIT);
glListBase(base - 32);
glCallLis