Skip to content

How to take a screenshot of the screen? #28

@akicho8

Description

@akicho8

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions