Splash screen and loading

How I can implement a splash image with a progress bar while I actually load textures/meshes in background?



I usually (in C++) display a textured quad in ortho mode, use a smaller texture for the progress bar and force the screen update between each progressbar changes.




I've written something to do this with GameStates.  Essentially what I do is have a custom game state that is in charge of loading and I give it several tasks to complete (various loading aspects) and it accomplishes one task per update and then changes the percent complete to reflect that.  Once everything is loaded it transitions to the gamestate I want to start the game in.  This is all part of an extension I've written to GameState that also encapsulates fade-in/fade-out between states as well.  I'll probably be releasing this pretty soon for anyone that wants to use it.



darkfrog

Sure, get to it.


but i think it is not possible without changing the LoadingGameState, i have to get rid of the progress bar etc which are private, i had to create a new class to get the splash screen that i want..

@wakaoz: maybe you are using the same state object, either you have to create a new TransitionGameState or reset the progress value, i guess..

Threading might be your issue…



Make sure you are doing loading models and such outside of the openGL thread, otherwise it can hog it which leaves no time for rendering.

can i make a splash screen at the beginning of the game, using TransitionGameState but without progress bar? just an image and then fade out…

Sure, get to it. :o



Man this is an old post…

may i know how its done? currently im putting all the states inside opengl thread :stuck_out_tongue: … one of them is main menu … i wan all the things(models) to be loaded only when player has chosen his character … so the creating and loading are done in main menu state … means they are done in opengl thread rite ? so how can i do all the loading like what you mentioned? thankz …  :expressionless:

Take a look at some of the tests, specifically the testGameStates and also look at StandardGame.