I have a custom QDeclarativeItem with a custom paint implementation. The paint implementation renders a 3d scene onto an FBO object. I’d like this 3d scene to be updated at fixed intervals as far as possible.
Sometimes I receive a bunch of paint events in rapid succession. Since I’m drawing in OpenGL and using the FullViewportUpdate mode, I think this is unavoidable. In this case I try to repaint the contents of the fbo without updating the underlying scene.
Sometimes I won’t receive events for longer than the desired interval.
Sometimes rendering the 3d scene will take longer than the desired interval.
I’m having trouble figuring out an elegant way of dealing with all these cases that doesn’t steadily increase the number of queued up events when my scene rendering slows down [which is what I think would happen if I just use a timer]. I’d appreciate any advice!
↧