Problem with renderText function in QGLWidget class
-
I have sub classed QGLWidget in my application and have to annotate my 3D drawing with dimensions. For this i am trying to use renderText() in my application, but the problem i am facing here is that i am unable to render more than one text.
For example:
@QString text1 = "Tom n Jerry";
QString text2 = "Harry Potter";
renderText(1,1,1,text1);
renderText(1,0.5,1,text2);@When i run it, it just displays "Tom n Jerry", i.e., only the first text. Any solutions?
-
Another way is using a QPainter to draw to a texture which is displayed with quads. This is the approach I use in MIFit. You can see the code here:
http://gitorious.org/mifit/mifit/blobs/master/libs/opengl/Text.h
http://gitorious.org/mifit/mifit/blobs/master/libs/opengl/Text.cpp -