PDA

View Full Version : QGLWidget renderText problem



mbjerkne
7th April 2006, 17:18
I am trying to show the frame rate for my gl widget with renderText. I am getting the following error, and haven't been able to find any posts about the problem.

error:
QGLContext::generateFontDisplayLists: Could not generate display lists for font 'Times'

Note:
I get this error with any font I try to use. I get it when I don't specify a font and I get it when I try to specify different fonts. Here is my code in paintGL()



void GLPanel::paintGL()
{
.....
.....
// Drawing code emitted

double dElapsed = time->elapsed();
time->restart();

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

m_dFrameTimes += dElapsed/1000.0;

if ( ++m_nFrames == FRAME_RATE_CALC )
{
m_dFrameRate = FRAME_RATE_CALC/m_dFrameTimes;

m_nFrames = 0;
m_dFrameTimes = 0.0;
}

if ( m_bShowInfo )
{
glPushMatrix();
qglColor(QColor(0,0,0));
glTranslated(0.0,0.0,0.0);
renderText(10.0,10.0,0.0,QString("%1").arg(m_dFrameRate,0,'f',2),QFont("Times",10,QFont::Bold));
glPopMatrix();
}

glFlush();
}

jh
7th April 2006, 22:35
i have the same problem. it's strange since the text is rendered
to the screen. any hints someone?

regards,
jh