hi, I have an old problem with render pixmap; after gen pixmap called, my textures are destroyed and I can't understand why.
//inside a member of mainForm class
qp = myWidget1->renderPixmap(800, 600, FALSE);
qi=qp.convertToImage();
qi = qi.smoothScale(500,500);
qi.save(base_file+".png","PNG");
//inside a member of mainForm class
QPixmap qp
qp = myWidget1->renderPixmap(800, 600, FALSE);
qi=qp.convertToImage();
qi = qi.smoothScale(500,500);
qi.save(base_file+".png","PNG");
To copy to clipboard, switch view to plain text mode
I know render pixmap do this: create a new contextGL call initializeGL(), resizeGL() an PaintGL(); after, it restore the previous context; but the previuos context is broken..also pixmap doesn't appear realistic: some textures are broken; but the texture broken on the final image image.jpg) and image on widgetGL aren't the same...
I tried to do:
myWidget1->initializeGL();
myWidget1->resizeGL(myWidget1->width(), myWidget1->height());
myWidget1->paintGL();
myWidget1->initializeGL();
myWidget1->resizeGL(myWidget1->width(), myWidget1->height());
myWidget1->paintGL();
To copy to clipboard, switch view to plain text mode
I thought this can see to me if some error in contextGL; but these 3 instrucion don't change the image in QGLWIdget....
After this, if I put a new texture on my image (ie on one object, so that call every gl function that initialize texttures), the prevoius context is restored and every textures are in the right place)
Help me, please; thanks
Bookmarks