Advertisement

Load Screen

Started by March 20, 2000 08:51 PM
1 comment, last by Suryc 24 years, 5 months ago
Anyone have any suggestions on how I can pause my game to load other things like more graphics or a new map. I basicly want something like this: int PASCAL WinMain(blah blah blah) { createwindow(); load startup stuff(); while(1) { checkformessages() if(isAppActive) { if(isMenuActive) domenu() if(isGameActive) -----> LoadMapOnce() <---- I want to pause here dogame() } else waitmessage() } } I can do LoadMapOnce before the while statment but if I do it in the while statement it shuts down the program.
"We will all descend into an oblivious amorphous continuum of homogeniality."
All you have to do (or, what I would do) is set up a game state in the main loop that will display a screen. You can have some sort of global pointer to the screen to display or something, so that you can display any screen. Then all you would do is set the global pointer, for example:

screenDisplay = mapLoadScreen;

where mapLoadScreen is a picture and screenDisplay is a pointer to a picture, or a surface.

Then you would code your state like this

case GAME_STATE_DISPLAYSCREEN:
{
DrawPicture(screenDisplay);
} break;

or something like that.

I hope this help!

------------------------------
Jonathan Little
invader@hushmail.com
http://www.crosswinds.net/~uselessknowledge
Advertisement
Actually my problem isnt trying to display a load screen but loading large amounts of game data once I have entered the while loop. It seems if it takes to long to load the program just shuts down.
"We will all descend into an oblivious amorphous continuum of homogeniality."

This topic is closed to new replies.

Advertisement