Results 1 to 2 of 2

Thread: QGLWidget renderText problem

  1. #1
    Join Date
    Jan 2006
    Location
    Minnesota
    Posts
    14
    Qt products
    Qt4
    Platforms
    Windows

    Default QGLWidget renderText problem

    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()

    Qt Code:
    1. void GLPanel::paintGL()
    2. {
    3. .....
    4. .....
    5. // Drawing code emitted
    6.  
    7. double dElapsed = time->elapsed();
    8. time->restart();
    9.  
    10. glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    11.  
    12. m_dFrameTimes += dElapsed/1000.0;
    13.  
    14. if ( ++m_nFrames == FRAME_RATE_CALC )
    15. {
    16. m_dFrameRate = FRAME_RATE_CALC/m_dFrameTimes;
    17.  
    18. m_nFrames = 0;
    19. m_dFrameTimes = 0.0;
    20. }
    21.  
    22. if ( m_bShowInfo )
    23. {
    24. glPushMatrix();
    25. qglColor(QColor(0,0,0));
    26. glTranslated(0.0,0.0,0.0);
    27. renderText(10.0,10.0,0.0,QString("%1").arg(m_dFrameRate,0,'f',2),QFont("Times",10,QFont::Bold));
    28. glPopMatrix();
    29. }
    30.  
    31. glFlush();
    32. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    84
    Thanks
    7
    Thanked 2 Times in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGLWidget renderText problem

    i have the same problem. it's strange since the text is rendered
    to the screen. any hints someone?

    regards,
    jh

Similar Threads

  1. Replies: 4
    Last Post: 7th May 2008, 00:01
  2. QGLWidget resize problem.
    By anderl in forum Qt Programming
    Replies: 2
    Last Post: 22nd January 2008, 08:57
  3. QGLWidget renderText rotation
    By ToddAtWSU in forum Qt Programming
    Replies: 4
    Last Post: 19th September 2007, 20:52
  4. why linking problem with QGLWidget???
    By Shuchi Agrawal in forum Newbie
    Replies: 17
    Last Post: 16th March 2007, 10:45
  5. Problem combining QWorkspace & QGLWidget
    By Nb2Qt in forum Qt Programming
    Replies: 1
    Last Post: 18th December 2006, 21:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.