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 1057

Summary: SDL_UpdateTexture broken on iPhone
Product: SDL Reporter: Pavel Kanzelsberger <kanzels>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: blocker    
Priority: P2 CC: kanzels
Version: HG 2.0   
Hardware: iPhone/iPod touch   
OS: iOS 3   

Description Pavel Kanzelsberger 2010-09-21 12:16:34 UTC
SDL_UpdateTexture seems to work fine with OpenGL renderer on MacOSX, however when I run the very same code on iPhone using OpenGL ES, SDL_UpdateTexture seems to be broken. In fact it won't update the requested area of texture from surface but rather fill with some random pixels. It won't produce any crashes so I'm not able to post any more information from debugger...
Comment 1 Nathaniel J Fries 2011-01-07 22:02:57 UTC
looking at the "SetupTextureUpdate" functions for the two different renderers, I see that the GLES one binds the texture inside the function; the GL one does it after the glEnable call in SDL_UpdateTexture. Both call glPixelStorei. Perhaps glPixelStorei needs to be called BEFORE glEnable (glPixelStorei is called in both versions of SetupTextureUpdate)

I've never used glPixelStorei personally, so I don't know. It's just a difference noted between something that works and something that doesn't.
Comment 2 Sam Lantinga 2011-02-16 03:57:05 UTC
Can you retest with the latest snapshot?  The OpenGL/ES* renderers have gotten a bunch of love (and maybe bugs!) lately. :)
http://www.libsdl.org/tmp/SDL-1.3.zip

Thanks!