0

how would i go about capturing my computer's screen with SDL? is this possible with SDL? i wanted to try something like applying a surface to the main renderer (if that makes any sense either) and then call:

SDL_SaveBMP(back_buffer, "screen.png");

how would i do what i want to do if it is possible? has anyone done this before?

genpfault
  • 49,394
  • 10
  • 79
  • 128
evolon696
  • 259
  • 1
  • 4
  • 13

2 Answers2

2

This cannot be done. What you are describing is a platform dependent operation which is not implemented by SDL.

Tim Cooper
  • 151,519
  • 37
  • 317
  • 271
0

I hope this helps: Try to create a new surface by combining all the surfaces you want to render into one( by using getpixel() and putpixel() functions -you man need to make them yourself- ), then SDL_SaveBMP( newsurface,"name.bmp") ( I personally don't know if SaveBMP can save .png files )

Mihai
  • 157
  • 1
  • 5
  • 13