Good question.
Maybe I don't understand how threads work but here is what I understand needs to happen...
For the progress bar:
Code:
// level load
- (void) loadLevel
{
// do some stuff
// update percentDone
// do more stuff
// update percentDone
}
// render
- (void) render
{
// figure out the bar length
barLength = barLength * percentDone;
// render the bar
renderBar();
}
So the problem here is the core of the progress bar update is done in the render loop...I don't know that a thread that is created would be able to access the render loop since it is setup and called from the grand daddy game loop. Know what I mean?
Is it possible to render stuff in a separate thread? I don't know how to do that...
What's nice about what i'm doing now...well not that nice because it doesn't work...but I can let my main game loop go rendering the frames as it does and when I spawn off the thread to do the loading work it doesn't have to worry about being involved with the renderer...