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 1586 - SDL_LockTexture has inconsistent behaviour with different render drivers
Summary: SDL_LockTexture has inconsistent behaviour with different render drivers
Status: RESOLVED WONTFIX
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: All All
: P2 major
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-27 04:38 UTC by Pallav Nawani
Modified: 2012-09-28 03:30 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 Pallav Nawani 2012-08-27 04:38:05 UTC
Under OpenGL, SDL_LockTexture () provides access to potentially random data from system RAM. Under Direct3D, SDL_LockTexture() does actually provide access to Texture Data.

In particular this sequence will completely clobber the texture data under OpenGL:

SDL_LockTexture();
SDL_UnlockTexture();

While it will work fine under Direct3D.

This bug just caused me 3 wasted days >/
Comment 1 Sam Lantinga 2012-09-28 03:30:40 UTC
This is an intentional optimization to make streaming textures as fast as possible.
The documentation on the wiki has been clarified:
http://wiki.libsdl.org/moin.cgi/SDL_LockTexture

Thanks!