ruby-sdl2
ruby-sdl2 copied to clipboard
How to take a screenshot of the screen?
Thank you for creating a convenient library.
I am looking for a way to take a screenshot while displaying a screen in Ruby/SDL2, but I don't know how to create the surface to pass to save_bmp.
This article uses SDL_RenderReadPixels to transfer from renderer to surface.
https://gigi.nullneuron.net/gigilabs/saving-screenshots-in-sdl2/
However, I cannot find a place where SDL_RenderReadPixels is being executed in the C code of Ruby/SDL2.
Any advice would be appreciated.
Hello,
As you say, SDL_RenderReadPixels is not supported now in Ruby/SDL2. I will try this when I have time.