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 - Error calling SDL_RenderReadPixels() with format=0
Summary: Error calling SDL_RenderReadPixels() with format=0
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-07 08:17 UTC by Marco Schulze
Modified: 2011-03-10 01:05 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.