PDA

View Full Version : wglUseFontOutlines



pieromatty91
10-05-2015, 01:21 AM
I try to use this function but the result is a black screen

I post the code


GLYPHMETRICSFLOAT agmf[256];

HFONT font;
GLuint base = glGenLists(256);
font = CreateFont(24, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_TT_PRECIS,
CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, FF_DONTCARE | DEFAULT_PITCH, L"Comic Sans MS");

SelectObject(m_hDC, font);


BOOL fail = wglUseFontOutlines(m_hDC, 0, 255, base, 0.0f, 0.1f, WGL_FONT_POLYGONS, agmf);
if (!fail)
{
MessageBox::Show("Error!");
}

// Set up transformation to draw the string
glLoadIdentity();
glColor3f(1.0, 1.0, 1.0);
glTranslatef(0.0f, 0.0f, -5.0f);
glScalef(2.0f, 2.0f, 2.0f);
// Display a string
glListBase(base); // Indicates the start of display lists for the glyphs
// Draw the characters in a string
glCallLists(24, GL_UNSIGNED_BYTE, "Hello Windows OpenGL World.");


Why ? Anyone can help me?