hi.
What I wanted to know was, is there any difference between update() and updateGL()..? i mean i tried calling both of them in my code,and both of them were executing the paintGL() function...
Printable View
hi.
What I wanted to know was, is there any difference between update() and updateGL()..? i mean i tried calling both of them in my code,and both of them were executing the paintGL() function...
I think update() for QGLWidget is calling updateGL() (or the other way round), so you can use either of them.
soo... if u can call a QGLWidget with a simple update() then what's the point in having an updateGL()...?? :confused:
Code:
{ if (updatesEnabled()) { glDraw(); updateOverlayGL(); } }
Do you see the difference?
updateGL() should be at least as fast, if not faster than update() since it bypasses the QWidget paint system with clipping, region updating and what have you.
A quick dump of the call stack (on windows) shows that update() has the following calling order:
whereas updateGL() gets down to business faster:Code:
> gltest.exe!GLWidget::paintGL() Line 18 C++ ... QtGuid4.dll!QWidgetPrivate::drawWidget(QPaintDevice * pdev=0x0012feb8, const QRegion & rgn={...}, const QPoint & offset={...}, int flags=3) Line 1212 + 0xd bytes C++ QtGuid4.dll!QETWidget::translatePaintEvent(const tagMSG & msg={...}) Line 3111 + 0x2b bytes C++ ...
(I left out the Signal/Slot messaging calls in both examples)
@ wysota
errrr....no.... i can see an updateGL() function but no update()...!! :p
@ spud
the code didn't make that much sense to me but i think i got what it basically meant...!! thanks...
oh..!! had completely forgotten it...!! anyways thanx mate...!!