You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sdl/examples/renderer/17-read-pixels
Ryan C. Gordon 90efb63e52
examples: Improve webpage generation in various ways, add thumbnails, etc.
3 months ago
..
README.txt examples: Added renderer/17-read-pixels 5 months ago
onmouseover.webp examples: Improve webpage generation in various ways, add thumbnails, etc. 3 months ago
read-pixels.c examples now using SDL_ALPHA_OPAQUE(_FLOAT) for opaque alpha value 4 months ago
thumbnail.png examples: Improve webpage generation in various ways, add thumbnails, etc. 3 months ago

README.txt

This example creates an SDL window and renderer, and draws a
rotating texture to it, reads back the rendered pixels, converts them to
black and white, and then draws the converted image to a corner of the
screen.

This isn't necessarily an efficient thing to do--in real life one might
want to do this sort of thing with a render target--but it's just a visual
example of how to use SDL_RenderReadPixels().

A better, but less visual, use of SDL_RenderReadPixels() is to make
screenshots: you grab the current contents of the screen, and save the pixels
as a bitmap file or whatever.