Create a smooth loading bar for content packs
Hi, I have different sized content packs, an example pack would be:
10 images,
6 shaders,
6 audio files
3 xml docs.
each file size will be different and all files will need to be processed at some point during the load, ie, the shaders will be compiled and linked, textures loaded into memory etc.
So the question is, how can I "Calculate" / make a loading bar 0-100% that runs smooth whilst loading this?
An options might be to count the files up and divide by 100, then add a number for processing time, then in my loader function, increment this overtime? the only problem is, one image might take longer to load, so the loading bar would complete long before the image did.
How do people usually do this?
Thanks
|