GLFont::GLFont(HDC deviceContext, const char* name, int size, int weight, bool italic, bool underline, bool strikeout)
{
m_deviceContext = deviceContext;
HFONT font;
HFONT oldfont;
m_baseList = glGenLists(96);
DWORD isItalic = FALSE;
DWORD isUnderline = FALSE;
DWORD isStrikeout = FALSE;
if (italic) isItalic = TRUE;
if (underline) isUnderline = TRUE;
if (strikeout) isStrikeout = TRUE;
font = CreateFont(-size, 0,
0,
0, weight,
isItalic,
isUnderline,
isStrikeout,
ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY,
FF_DONTCARE|DEFAULT_PITCH,
name);
oldfont = (HFONT)SelectObject(deviceContext, font);
wglUseFontBitmaps(deviceContext, 32, 96, m_baseList);
SelectObject(deviceContext, oldfont);
DeleteObject(font);
}
GLFont::~GLFont()
{
glDeleteLists(m_baseList, 96);
}
void GLFont::print(const char* fmt, ...)
{
char text[256];
va_list ap;
if (fmt == NULL)
return;
va_start(ap, fmt);
vsprintf_s(text, 256, fmt, ap);
va_end(ap);
glPushAttrib(GL_LIST_BIT);
glListBase(m_baseList - 32);
glCallLists(strlen(text), GL_UNSIGNED_BYTE, text);
glPopAttrib();
}
my question is when i have underline = true. the whole word isnt underlined, but only the individual charachters are. Is tehre a way to have a continious underline?











