Lets start out with a short seven second clip. This clips shows what comes up when the game if first started, a main menu...
What this shows it the main menu of my game engine. The main menu has one main class that handles the selection of the user. The user can either select "Start Game" or "Quit", the class that handles this logic is a MainMenuScreen class. This class it self just holds what is going to be drawn when the "Draw" method is called, and and "Update" method that handles when the up or down button is pressed, and by highlighting the currently active option.
The main menu screen is handled by a "ScreenManager" class that will run trough each class in the "ScreenManager" screen list in the order they were added, calling the update and draw of each saved screen in the list of screens to be drawn. To make my game engine very modular I made it so any logic can be set in a screen, so my main menu screen actually only stores and shows the menu selection items, the background is actually another screen, that draws the background and the logos of the third party tools I use, and the main engine logo.
When the user makes a selection the menu will load a new screen into a "to be added" list, which is a temporary list that holds a reference screens to added. When the screen manager finds the screen has a "to-be-loaded" list above 0 counted in its list, it will clear the current screen list and fill it up with the screens from the "to-be-loaded" list, then clears the "to-be-loaded" list.
If you were to start the game right now the program would stop responding right now, while the next screen is loaded, if the screen has a bit to load. The screen to be loaded by starting the game is the "GameScreen" this screen would load everything the screen has in it like; terrain, static and dynamic models, and so on. This is mainly because its all done on a single core, and done in one frame, so the game engine is not progressing forward, this could easily be fixed by making a new "LoadingScreen" that creates a new thread that shows some fancy loading screen, and loads the other screen on the main thread, but that is on my to-do list.
More to Come, CA.