Load Screen
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement