PDA

View Full Version : Trying to draw my QGLWidget in a QML file...only glClear works?



faenil
27th August 2011, 13:09
hi guys, I'm coding a 3d game, I have my working qglwidget, but now I want to embed it into a qml file, to add UI and stuff.

So I made a QDeclarativeItem, copied QGLWidget's paintGL() to paint(...) of the QDeclarativeItem...

then registered the item as a qml Type, and created a simple qml file with that object inside it...(also set a new QGLWidget as QDeclarativeView's viewport)
result:

the glClear which is at the beginning of the paint is called (the screen is cleared with the right color), but the rest of the things are not drawn.
At the end of the paint glGetError returns 0, so there are apparently no glErrors during the paint, but nothing is drawn...

What am I doing wrong?

Thanks in advance,
faenil

wysota
27th August 2011, 16:10
So I made a QDeclarativeItem, copied QGLWidget's paintGL() to paint(...) of the QDeclarativeItem...
You really did what you claim here? I'm asking because QGLWidget::paintGL() is empty... What did you really do?