if it is a "black box" function that goes out to an Extern, and takes significant time during an OnUpdate cycle to the point where you'd need a loading bar and yet can't do an OnRender cycle, then you might have a problem. Otherwise, your processes should be split into smaller parts if you want to insert updates to your progress bar in between them. Note that how often you'll want to split the process and update the bar will make an impact on how much extra overhead you'll be introducing into the loading process.......
But seriously, other than I/O ops, I can't imagine very many cases where you'd want a loading bar which needs to be updated. You can display a "Please Wait" screen before explicitly calling your operations on the update loop before by having some sort of boolean switch to draw it on the next render cycle, and I believe you can force the next update cycle in the OnRender method once your "loadwhatevernext" switch is True. Before that point in the render cycle, display your "Please Wait" graphic. On the update cycle after that, do your intensive processes and flip the loading screen graphic switch back to False. To the program, it will appear to have rendered only 1 frame (1 update actually), but it should display for as long as is needed for the update cycle to complete.
|