What I'm trying to do is sort of recreate the begginning of a pokemon game, but I don't seem to know how to load the different events. Does anyone have any idea ? They both load at the same time btw, and not just one at a time.

You're calling SDL_Flip(screen) in between of Polling events, which is bad, Whenever there is an event like moving mouse, It will flip the screen, You would get weird results.Instead you could use an enumeration and traverse using that.

The problem here is that when the gender selection completes, your code allows for the pokemon selection to run "immediately". What I mean here is that despite the delay call, the same event is consumed twice, once by the Gender instance and once by the PokemonChoice. To avoid this, you need to structure your code such that each event causes only one sequence of actions.

JustinDaniel's code is one way of doing this. Another is to have a boolean indicating which is active that persists between calls:

Note that in the above code it is impossible for the same event to be processed by both instances. JustinDaniel's approach is more general and will be easier to manage when more states are added.

Fundamentally your problem is unrelated to flipping the screen while processing events. That said, I think you need to make an architectural decision on what style of game you are going to write. If the game is event driven, then you should use a blocking event loop and ensure your game can handle SDL_VIDEOEXPOSE events or similar. Alternatively, write your game as a simulation loop and simply re-draw the screen every frame. The latter is usually easier to write, although wouldn't be a good idea if you were targeting battery powered devices, such as smart phones.

Either way, I would advise against using long SDL_Delays to implement timing based systems. Instead, your code should use SDL_Timers or calls to SDL_GetTicks() with periodic polling. This keeps your user interface nice and responsive. When you call SDL_Delay(), you lose the ability to respond to events in that time. When the user interface becomes unresponsive, users frequently start clicking wildly, and will eventually hit the "close" button. When you application wakes up, it tries to process all these events out of context, and usually ends up doing a bunch of stuff that the user didn't really intend you to do.

It is a state machine. The different states are represented by different enumeration values. The active state is stored by the value of "current", and transitions are signalled by changing the value of "current" to the desired next state.

Is there any specific part you are having trouble understanding? Perhaps you haven't encountered enumerations yet, or the switch statement? Or is it some broader concept?

One problem is that the enumeration names are colliding with your class name. You can disambiguate using the "class" keyword, but instead you might consider changing the enumeration names - e.g. GenderState or GENDER.

Note that the if(Gender) test in your program was supposed to be a piece of psuedo code indicating that when the change from the Gender screen to the Pokemon screen is made.

Here is your first post rewritten as a state machine (with many other things too):

Because the enumeration is small, I've used if statements instead of switches so you can concentrate on the idea and not the implementation. You can change it to a switch statement later.

The above shows you how you might implement a timed transition between the two states without compromising your application's ability to respond to events. It also checks for more errors, and prints messages allowing you to diagnose these errors if they occur. It shows how to avoid using global variables to implement your program by passing parameters to the functions that need information.