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 3553

Summary: clarify SDL_LockTexture() description
Product: SDL Reporter: Stas Sergeev <stsp2>
Component: websiteAssignee: Jen Spradlin <jspradlin>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: enhancement    
Priority: P2    
Version: HG 2.1   
Hardware: All   
OS: All   

Description Stas Sergeev 2017-01-10 14:22:14 UTC
SDL_LockTexture() can be passed the rectangle to lock,
instead of the entire texture. It is however unclear from
the description how the memory pointed to by the 'pixels'
pointer will then be organized. Will it still be the memory
of the entire texture, with the "permission" for user to
only write to the specified rectangle, or will it be the
smaller buffer representing just the rectangle itself?

It would be nice to update the documentation to describe
that. Also I wonder if passing the rect is a desirable
thing to do, or is it slow and should be avoided?
Comment 1 Sam Lantinga 2017-08-11 18:00:42 UTC
It's the smaller buffer representing just the rectangle itself, and you should be sure to respect the pitch parameter.

That's what the documentation says:
*  \param pixels    This is filled in with a pointer to the locked pixels, appropriately offset by the locked area.

Do you have any suggestions on how to word that so it's more clear?
Comment 2 Stas Sergeev 2017-08-11 21:22:53 UTC
Thanks, it now does indeed look pretty clear.
Either I missed something, or maybe the text
was different back when I opened this ticket...
Comment 3 Sam Lantinga 2017-08-12 01:06:15 UTC
Okay, thanks for confirming!