Problem with renderText function in QGLWidget class
-
wrote on 5 May 2011, 14:52 last edited by
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?
-
wrote on 5 May 2011, 16:57 last edited by
QGLWidget::renderText is buggy and considered obsolete. Use overpainting as its documentation suggests.
-
wrote on 5 May 2011, 23:31 last edited by
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 -
wrote on 6 May 2011, 07:18 last edited by
Thanks Guys, i think i will better use bitmap procedure. renderText is too hard to handle and its rotation is another headache.
Anyways do you guys have any idea about implementing Drag and Drop feature in openGL application.
Thanks & Regards
durgeshK
2/4