Pausing

Started by
0 comments, last by RanBlade 18 years, 6 months ago
Hi all! I have a question... See, I made this pong clone in SDL. But i'm gonna add a pause menu with, well nothing but continue and exit. However, how would I save the actual screen? Maybe something like this?

SDL_Surface *Screen; // My screen

void myPauseFunction()
{
    SDL_Surface *Temp = SDL_DisplayFormat(Screen);

    SDL_FillRect(...Screen...); // I forgot the actual parameter for now :(

    // Draw the pause menu to the screen

    Screen = SDL_DisplayFormat(Temp);

    SDL_FreeSurface(Temp);
}


Would this work?
-----------------------------....::::DRAGON BALL Z::::....C<<"+"<<"+"; // Go C++ !!!-----------------------------
Advertisement
If you hit continue just redraw everything to the screen... like your paddles probably have x/y coords they are at just redraw them at those coords your ball has a x/y redraw it there nad redraw your background....from what i get from SDL doc SDL_DisplayFormat only does the one surface... and as far I know each object ussally has its own surface... so it wouldnt effect say the ball surface.. unless iam wrong but i dont think iam.

Eric Ranaldi a.k.a RanBlade


[size=1]"Passion is what drives you to stay up until 4am fixing that bug that hardly anyone would notice...


[size=1]Passion is where great games come from, if you dont live and breathe games you shouldn't be in the games industry."


[size=2]- Dave Pottinger, Ensemble Studios



[size=1][GameDev][C++ Page][Unity Game Engine][Panda3D Game Engine][NeHe Productions][Drunken Hyena][MSDN][Beej's Guide to Network Programming]


[size=1][FreedBSD][My Site][Gamasutra][Khan Acadamey]

This topic is closed to new replies.

Advertisement