I have a program in SDL, where the screen consists of several parts. Let's say the game and a menu in the bottom of the screen, to keep things simple. What is the best way to keep those two serated? So a bullet in the game doesn't go through the menu? The first solution I had in mind was to create two empthy surfaces, draw the menu and the current frame to them and then blit those surfaces to the screen. I asked about creating empthy surface before, but I can't figure it out (http://www.cplusplus.com/forum/general/9063/).
This is probably a commen problem, so I would think there is an easy solution available. but I can't find it. Thanks for any help.
The easiest way is to draw the playfield first, then draw the menu "on top", so if bullets or whatever go into menu space, the menu will simply be drawn over it.
Thanks Disch. The example was just to illustrate my point; this method wont do the trick because there are several part's in the screen that has movement in it. But your answer to my other question will solve that :)