SDL/examples/renderer/17-read-pixels
Ryan C. Gordon 54459def69 render: Remove the logical presentation render target.
Now we render directly to the window, scaling as appropriate. This fixes some
concerns the render target introduced, like the quality of the final scaled
output, how to step outside of the logical size temporarily to draw some
things sharply at the native resolution, and loss of sub-pixel precision.

Fixes #8736.
2024-09-25 16:26:36 -04:00
..
read-pixels.c render: Remove the logical presentation render target. 2024-09-25 16:26:36 -04:00
README.txt examples: Added renderer/17-read-pixels 2024-09-24 15:31:21 -04:00

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.