Original Post
Could someone give me an example of games main loop... where the logig is updated and thing drawn. How do join it with state based game logic.
GameMain()
{
switch (GameState)
GS_MENU: MenuLoop;
GS_MAIN: GameLoop;
GS_IDLE: IdleLoop;
}
MenuLoop()
{
UpdateMenu;
DrawMenu;
}
GameLoop()
{
UpdateGameLogic();
DrawStuff();
}
IdleLoop()
{
PlayDemo();
}
this is how currently have thought doing it. How you do it?
Pekka H
http://koti.mbnet.fi/pekkath/