View Full Version : OpenGL functions in QGraphicsItem::paint
Lendrick
20th June 2010, 17:06
Greets!
I read recently that it's possible to use OpenGL functions inside a QGraphicsItem's paint function, provided that you're working with an opengl surface. Is this something that's actually supported and will continue to work?
JohannesMunk
21st June 2010, 17:30
Hi!
void CGL3dProjectedItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
painter->beginNativePainting();
... do your native gl... stuff
painter->endNativePainting();
}
These two functions begin/endNativePainting() were introduced recently in 4.6 just for the purpose of making intermixing safer.
http://labs.trolltech.com/blogs/2010/01/06/qt-graphics-and-performance-opengl/ see section mixing..
The QtOpenGL bindings are just a convenience-wrapper. For more advanced stuff it is expected to use opengl directly.
Joh
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.