It won't freeze as long as you let the application process its events from time to time. Make a single shot at a time instead of trying to make all at once in one long loop.
It's still called a game loop.-it's not a game but i think you know that
But why all the time?-why draw all the time : because, as you said : "updateGL has to be called in the main thread"If nothing changes, what's the point of redrawing the screen? If the content is already stale, drop the frame and continue calculations, no need to redraw the display again.
You surely have some function that changes the position of the camera that you call periodically - that's the "game loop". To have a steady movement it is important that you call the loop in regular intervals, otherwise your animation will get messed up. So call the loop every 40ms or so to get 25 frames per second, recalculate the position there, call updateGL if you want to redraw the display and make a shot. After you do that, return the flow to the event loop and let the timer timeout again 40ms-<time you spent on calculations/redrawing/snapshotting> later. All that in one thread and in one function call. If your computer cannot keep up, slow down the loop (have less fps but increase the step to compensate the animation).
Bookmarks