1

Me and my friends are working on a game project, and we seem to have hit a wall. We have a system, which takes the SDL RGB surface from a namespace in different header file. We blit it to the screen, (SDL_SetVideoMode), then we blit one more from another namespace header file and we blit the second on the same screen. It overwrites the screen and we can't see the first one surface..

Any ideas how to blit two surfaces to screen one on another?

Wes
  • 4,781
  • 7
  • 44
  • 53
Rokas
  • 1,712
  • 2
  • 18
  • 35
  • 1
    I don't quite understand. Is your second surface smaller, or has transparency or something? You want the first one to show through underneath? Can we see some code? – BoBTFish Feb 17 '12 at 15:22
  • Well, I have one bigger surface, and secound smaller, and I want to show that smaller surface on bigger one. – Rokas Feb 17 '12 at 15:31

2 Answers2

1

It seems your draw order is messed up.

Remember, SDL has no Z-order so to achieve the illusion of one object on another, you must draw the one to be below first. Just like if you were painting a picture in real life.

ssell
  • 6,429
  • 2
  • 34
  • 49
0

It looks like your surface loses transparency, when blitted into another surface. The pixels in srcrect loses transparency, And therefore you cannot see behind the surface. Sadly I can't understand why it happens. Good luck with it btw.

HitWRight
  • 121
  • 8