Sign in to follow this  

progress bar and different functions?

This topic is 1417 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

This might sound 'stupid',  but I'm thinking about a way how I can update a progress bar when loading 3d models and textures (in my engine).

The problem is that my loading function for meshes and textures is a member of a different class then my renderer. I thought about splitting the loading function up into for example 5 iterations and then update the progress, but if for example I have 1 big mesh which takes long to load and 10 others which are loaded quite fast, the progress bar seems useless.

 

How would you handle this?

 

My goal is that I print for example a '*' or a '.' in my console (d3dxfont) each 3 seconds, parallel when my loading function for the 3d scene is executed

(Ps.; I'm not using multithreading, other then 'automatically')

Edited by cozzie

Share this post


Link to post
Share on other sites

You basically have two options:

 

1) Make the loading methods "callback" periodically during their operation

2) Load in a worker thread and have it signal the main thread at different points

 

There's no magic way around this.

Share this post


Link to post
Share on other sites
You could also have the main thread poll the progress from the worker thread. That is, the worker thread keeps track of it's progress in a variable, and the main thread occasionally queries it.

Share this post


Link to post
Share on other sites
Sign in to follow this