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

Summary: SDL_RenderReadPixels() doesn't work with offscreen targets
Product: SDL Reporter: Andreas Falkenhahn <andreas>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.3   
Hardware: x86_64   
OS: Windows 7   
Attachments: Test case

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