We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2685 - SDL_RenderReadPixels() doesn't work with offscreen targets
Summary: SDL_RenderReadPixels() doesn't work with offscreen targets
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.3
Hardware: x86_64 Windows 7
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-15 11:20 UTC by Andreas Falkenhahn
Modified: 2014-08-17 21:45 UTC (History)
0 users

See Also:


Attachments
Test case (1.51 KB, text/plain)
2014-08-15 11:20 UTC, Andreas Falkenhahn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Falkenhahn 2014-08-15 11:20:08 UTC
Created attachment 1814 [details]
Test case

SDL_RenderReadPixels() doesn't seem to work when trying to read pixels from a texture that has been created using SDL_TEXTUREACCESS_TARGET and has been selected as the render target using SDL_SetRenderTarget().

I am attaching a small program that demonstrates the issue. I get the following result here:

READ PIXEL RETURN: 0 --- COLOR CHECK: ff000000

But it should be:

READ PIXEL RETURN: 0 --- COLOR CHECK: ffff0000

Tested with SDL 2.0.3 on Windows 7.
Comment 1 Sam Lantinga 2014-08-17 21:45:37 UTC
Fixed, thanks for the great test case!
https://hg.libsdl.org/SDL/rev/7cafa57c23ec