The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
'In Game Menu' problems
alastairl


Joined: 05 Jan 2014
Posts: 1
Unlike my main menu, the 'in game menu' background is an opaque freeze frame of the game just before the 'Esc' key is pressed.
So my question is: Is there any easy way to get a texture or surface from the renderer without changing the whole system?

The texture that I would get from the renderer would be used for the the opaque background to the menu.
hectorgrey


Joined: 24 Jan 2014
Posts: 1
Location: Aberystwyth
I can't know for sure, since I've never seen your code, but wouldn't you be able to pause the game (thus the majority will remain on the screen), then create a viewport in the middle? The background colour for the viewport could be cyan, which would make it transparent, and then load the menu options onto that viewport? Once you kill the viewport, the menu should disappear and then you unpause the game. Or, if you mean the menu itself should have a copy of what's on the screen, wouldn't SDL_RendererCopy() be able to do something similar?
Nathaniel J Fries


Joined: 30 Mar 2010
Posts: 444
on the frame immediately after the user tells the game to open the menu, draw the game to a render target the same size as the screen instead of directly to the screen.
or, simply redraw the game before the menu while preventing it from updating.