Those tutorials have everything you need to do pausing and resuming
in your playstate where you handle events
CODE
void PlayState::HandleEvents(Game* game)
{
SDL_Event event;
if (SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_QUIT:
game->Quit();
break;
}
add some code that pushes your pause state onto the stack, this is not the same as changing the state as it can be removed using the PopState() function.
for example
CODE
case SDL_KEYDOWN:
switch (event.key.keysym.sym) {
case SDLK_ESCAPE:
game->PushState(PauseState::Instance());
break;
You will have to create a pause state of course, this could be an image saying paused, in this pause state you can create a place in the handle events that pops the current state, this removes it from the stack then the state the game was previously in will resume.
CODE
case SDL_KEYDOWN:
switch(event.key.keysym.sym) {
case SDLK_ESCAPE:
game->PopState();
break;
}
That is all you need, you can make your pause state as complicated as you like.
Does that make sense?