Program delays before displaying (SDL)

I don't know whats going on here but the delay seems to happen before the display even though it comes after. I do see it flash up after the delay.

1
2
3
4
5
6
7
8
9
10
void Player::upon_death()
{

    apply_surface(0,0,dead,screen);
    //SDL_BlitSurface( dead, NULL, screen, NULL ); <-- just tested with this but still failed
    SDL_Delay(1000); //  <----- This is happening before the lines above ???
    collision_box.x = PLAYER_START_X;
    collision_box.y = PLAYER_START_Y;
    lives--;
}


I know I don't have to it like this but I'm just a bit confused to why it does this.
The changes made to the screen surface will not be visible until you call SDL_Flip (or SDL_UpdateRect(s)).
Ahh.. makes perfect sence lol, thanks
Topic archived. No new replies allowed.