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

Summary: SDL_LockTexture has inconsistent behaviour with different render drivers
Product: SDL Reporter: Pallav Nawani <pallavnawani>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED WONTFIX QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2    
Version: HG 2.0   
Hardware: All   
OS: All   

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!