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 - clarify SDL_LockTexture() description
Summary: clarify SDL_LockTexture() description
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: website (show other bugs)
Version: HG 2.1
Hardware: All All
: P2 enhancement
Assignee: Jen Spradlin
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-10 14:22 UTC by Stas Sergeev
Modified: 2017-08-12 01:06 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 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!