Jump to content
  • Advertisement
Sign in to follow this  


This topic is 4735 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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);


Would this work?

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!