PDA

View Full Version : renderText



ToddAtWSU
21st August 2006, 22:21
I am trying to use QGLWidget::renderText( ) (http://doc.trolltech.com/4.1/qglwidget.html#renderText) to display text in my QGLWidgets. but everytime I try to make this call, I get an assertion error. I am using Solaris. It can draw my other OpenGL things correctly but with renderText it acts up. It appears renderText( ) is using a display list, is this correct? :confused: If so I am thinking it is not creating a valid display list thus causing the crash. So if anyone has any ideas how to fix this and if renderText( ) is using a display list, please let me know! Thanks!!!

Valheru
22nd August 2006, 09:26
I am trying to use QGLWidget::renderText( ) (http://doc.trolltech.com/4.1/qglwidget.html#renderText) to display text in my QGLWidgets. but everytime I try to make this call, I get an assertion error. I am using Solaris. It can draw my other OpenGL things correctly but with renderText it acts up. It appears renderText( ) is using a display list, is this correct? :confused: If so I am thinking it is not creating a valid display list thus causing the crash. So if anyone has any ideas how to fix this and if renderText( ) is using a display list, please let me know! Thanks!!!
Why do you think it is using a display list? As far as I can see, it just wants co-ordinates relative to the current projection and model matrix. So you can call it for every iteration that you use to draw a particular model, displaying text relative to it. I don't see any parameters thta would accept a display list - you jsut specify the co-ordinates and then the text you want displayed. And drawing will be done relative to the current projection and model matrices.

/edit : After doing some reading, it appears that renderText is 8-bit and can only use "OpenGL compatible fonts", whatever those may be. Try asking on the www.gamedev.net (http://www.gamedev.net) forums, lots of helpful knowledgeable people there.
renderText() appears to be slow and buggy on some OS/architechtures as well, this may be the cause of your problem.
renderText() does generate a display list, but it does this internally to render the text.

ToddAtWSU
24th August 2006, 13:29
We got the render text to work. Our problem is we have to design this in 8-bit color so we looked into setting up a QColorMap and once getting this set up, we were able to render the text on the screen. So thanks for your help and I am glad it was nothing else that was causing these problems.