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 1957

Summary: SDL_UpdateTexture or SDL_RenderCopy is malfunctioning
Product: SDL Reporter: Tom <tm1rbrt>
Component: renderAssignee: Sam Lantinga <slouken>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.0   
Hardware: x86   
OS: Windows 7   
Attachments: Test case

Description Tom 2013-07-11 10:34:26 UTC
Created attachment 1219 [details]
Test case

I built SDL2 from the release candidate source on the website with the latest version of mingw.

SDL_RenderCopy seems to draw only the first line of the texture and stretch it over the rest of the window/render-surface.

I have also tried with an explicit SDL_Rect rather than NULL (passed to UpdateTexture and RenderCopy) but get the same result.
Comment 1 Sam Lantinga 2013-07-12 00:59:26 UTC
I'm pretty sure you meant to use a non-zero pitch for SDL_UpdateTexture().

What happens if you change that line to this?
SDL_UpdateTexture(tex, NULL, (void*) buf, 640*4);
Comment 2 Tom 2013-07-12 05:16:47 UTC
Yup that works. Sorry! I though pitch was a border between rows or something. Should have read the docs a little more carefully.
Comment 3 Sam Lantinga 2013-07-12 05:39:34 UTC
Great, I'm glad you figured it out. :)