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 - SDL_UpdateTexture or SDL_RenderCopy is malfunctioning
Summary: SDL_UpdateTexture or SDL_RenderCopy is malfunctioning
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: render (show other bugs)
Version: 2.0.0
Hardware: x86 Windows 7
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-11 10:34 UTC by Tom
Modified: 2013-07-12 05:39 UTC (History)
0 users

See Also:


Attachments
Test case (1.45 KB, text/plain)
2013-07-11 10:34 UTC, Tom
Details

Note You need to log in before you can comment on or make changes to this bug.
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. :)