SDL Splash Screens

Started by
1 comment, last by Goran Milovanovic 11 years, 10 months ago
Hi,

I have an SDL game with a splash screen on right now, but for my splash screen I have created a new SDL_Event and a while loop for the splash screen separate to that of the game loop. I was just wondering if there is an easier way of creating the splash screen as right now the game requires two presses of Escape of the X button to quit out (Which I am guessing is because of the loop not properly closing?)

Thanks
Chris
Advertisement
It is hard to say why it is happening without seeing the code, but the core problem is that when you detect such a "exit event", you must not only close the splash screen but you must ensure that the rest of the application isn't started. A simple way would be to return from main(), if your splash screen event loop is in main() (obviously you'll need to run any necessary cleanup code).

If your splash screen is in a function or class, you need a way to return the fact that it was closed, rather than completing.
Do you have a state machine of some sort?

The splash screen can be nothing more than the initial state.

+---------------------------------------------------------------------+

| Game Dev video tutorials -> http://www.youtube.com/goranmilovano | +---------------------------------------------------------------------+

This topic is closed to new replies.

Advertisement