3
\$\begingroup\$

So I am trying to take a screenshot of the current situation during the PlayState of the game and when the player pauses the game I want the game to take a "screenshot" save it in memory and not as a file and use it as the background for the pause screen. Any ideas because I have no clue.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Any reason you don't just continue to render the game and the menu on top of it (while no longer updating the actual game data, e.g. input/timers/etc.)? \$\endgroup\$
    – Mario
    Commented Apr 11, 2014 at 6:45

1 Answer 1

2
\$\begingroup\$

Keep rendering the game. just pause the logic!

You can esily just attach a "pause" pass, that will render the framebuffer and then blur it or what not, and after that add some gui! should be really straight forward.

The only reason i can imagine why you would like to take a screenshot is to not use all the gpu power and reduce lag when you are pausing. Which is a valid point, but you should be fairly okay with just removing the cpu power being used. And for this approach, i would just ask for the last rendered frame buffer inside the game loop, and from there just do what ever i want with it. that should give you the desired effect.

\$\endgroup\$
2
  • \$\begingroup\$ Could you tell me how to blur the screen? \$\endgroup\$ Commented Apr 11, 2014 at 20:30
  • \$\begingroup\$ Well, basically you read pixels next to the original one and average that value out. if you google gaussian blur or something you will find a lot of examples out there. \$\endgroup\$
    – Tordin
    Commented Apr 14, 2014 at 6:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .