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 1162

Summary: Error calling SDL_RenderReadPixels() with format=0
Product: SDL Reporter: Marco Schulze <marco.c.schulze>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: x86_64   
OS: Linux   

Description Marco Schulze 2011-03-07 08:17:16 UTC
Contrary to the documentation, SDL_RenderReadPixels() fails if called with format=0. Tested with the OpenGL backend.
Comment 1 Sam Lantinga 2011-03-07 10:55:05 UTC
That's because you pass in a void* pointer and a pitch value, but the API doesn't know what pixel format you're expecting.

What is your expected behavior?
Comment 2 Sam Lantinga 2011-03-07 10:56:00 UTC
Oh, of course, 0 uses the format of the rendering target.

Is there actually any way to tell what that is?
Comment 3 Sam Lantinga 2011-03-07 10:58:57 UTC
Sorry, it's Monday.

/reboot

Okay... I see the problem.  Thanks!
Comment 4 Sam Lantinga 2011-03-10 01:05:55 UTC
This is fixed, thanks!
http://hg.libsdl.org/SDL/rev/46bd121b04a2

Please let me know if you have any troubles.