   [C++] How to code a load screen
  As some programs take some time to load I was wondering how would you codea loading screen into your program.Games and apps all have them and also have a indicator telling you how muchhas loaded so far.To sum it up how do I code a load screen in a program?   
  Depends how you have screens set-up in game, but effectively when you're in a loading section the "progress bar" typically simply represents how many of the loading tasks are completed, and jumps whenever it moves on too a new task.You can either simply block as it loads, which means your program would "stall" but is simpler, or have a separate loading thread which then loads the data and updates the percentages. This is...a bit more complex, but it looks neater and can stop "awesomegame2010 has encountered an error..." messages windows sometimes throws out when the window doesn't update for awhile (which in a single-threaded system with blocking loads, it wouldn't).Still, I'd recommend the single-threaded approach because multi-threading is a *insert series of swear words here* if you aren't prepared for it...   ;  1. Count the assets you're loading2. Every time you finish loading an asset:2.1. Increase the asset loaded counter2.2. Divide the total # of assets by the asset loaded counter, this gives you the loading progress in percent2.3. Display that percentage somehow   ;Quote:Original post by Konfusius1. Count the assets you're loading2. Every time you finish loading an asset:2.1. Increase the asset loaded counter2.2. Divide the total # of assets by the asset loaded counter, this gives you the loading progress in percent2.3. Display that percentage somehowOk I undesrstand now the loading bar fills up as percentages of the program are loadedBut how would you define loading?   ;Quote:Original post by xx6heartless6xxBut how would you define loading?Reading files from permanent storage into RAM, and other initialization activities such as compiling shaders and preparing runtime data structures.   