Original Post
Hiya, I've recently decided to get back into working with DirectX, using the latest Managed DirectX 9. I have a question that's more general in nature, though. Most game books I've seen show the "main" game loop something like this: main() { init() while(!done) { handle_user_input() update_world() render_world() } free_resources() } A while back, I wrote a 2D game of pong that started by going into full-screen and giving you a simple menu, with a rotating arrow graphic next to the selected item (using arrow keys to move up/down and enter to select.) The way I did it was to use lots of switch statements like this: switch(m_state) { case TITLE_SCREEN: handle_title_screen(); break; case SHOW_CREDITS: handle_show_credits(); break; case START_GAME: handle_start_game(); break; case PLAY_GAME: handle_play_game(); break; case END_LEVEL: handle_end_level(); break; case NEW_LEVEL: handle_new_level(); break; case END_GAME: handle_end_game(); break; } My question is how do people normally go about putting in all the extra stuff a game usually has, like title screen, demo mode, etc? Am I going about it in a "sane" manner? Thanks for any input! // CHRIS EDIT: fixed typo