Re: QGLWidget renderText()
Can we see your code related to renderText()?
Re: QGLWidget renderText()
Code:
for( int i = 0 ; i < (xMax - xMin) / xStepSize ; i++ )
{
//point = some number discovered higher up
//xMin = the value of the first number to be printed next to the gridline
//xStepSize = the distance to the next grid line.
renderText
( (xMin
+ i
* xStepSize,
0.01,
QString::number( point
[i
] ) );
}
I just run this through a for-loop while updating the int variable point. The numbers display in the correct place, its just the movement is jerky everytime a grid line/number approaches the right edge and only a portion of the text from renderText( ) displays. Hope this helps! Thanks!
Re: QGLWidget renderText()
[QUOTE=ToddAtWSU]
Code:
for( int i = 0 ; i < (xMax - xMin) / xStepSize ; i++ )
{
renderText
( (xMin
+ i
* xStepSize,
0.01,
QString::number( point
[i
] ) );
}
BTW, your renderText has mismatching brackets.
I have a doubt regarding your problem.
There are 2 signatures in renderText() available in Qt.
Code:
renderText
( int x,
int y,
const QString & str,
const QFont & fnt
= QFont(),
int listBase
= 2000 )renderText
( double x,
double y,
double z,
const QString & str,
const QFont & fnt
= QFont(),
int listBase
= 2000 )
It seems like you have been using the first signature ( the one with int x and int y)...
I feel that you intended to use the second signature because you are using 0.01 as your Y value.
But to your original problem of slow translation I can't find any good reason why your text slows your translations so much. It doesn't do the same with me. If you figure out a solution on your own, please post it.
Re: QGLWidget renderText()
Thanks...I did not notice the first signature for renderText was using 2 ints. I just saw it only had an x and y coordinate so I used that since my z=0. But I will change that to see if it helps at all. If I do find a solution I will definately post it. But I might try to go another route and just create a QLabel and update it's text to match my grids. Thanks!
Re: QGLWidget renderText()
I am still having problems with the text slowing up my moving of the graph. Has anyone else run into this problem? Thanks!
Re: QGLWidget renderText()
Check the version of the Nvidia drivers being used. I had some trouble with using the newest drivers and OpenGL, and had to switch to the legacy drivers.
Re: QGLWidget renderText()
Hello !
I have a problem with this method, on a Win32 system : my strings aren't displayed, and I grab this warning message :
warning : QGLContext::generateFontDisplayLists: Could not generate display lists for font 'Arial'
This message is always thrown, for any font I can specify...
Worse, the Qt example Sample Buffers that uses renderText(), works correctly... and I don't do anything specific
in my OpenGL code..
I have no problem at all with Linux / X11.
Any idea, or anyone experienced this ?
Thanks,
Guilugi.
Re: QGLWidget renderText()
Thanks Rayven that worked!