Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrupted output when copying from a Surface to a Texture #1555

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

Corrupted output when copying from a Surface to a Texture #1555

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 2.0.3
Reported for operating system, platform: Mac OS X 10.8, x86_64

Comments on the original bug report:

On 2014-07-07 20:11:38 +0000, Maury Markowitz wrote:

Created attachment 1740
Problems blitting in SAIS

I am porting an SDL game 1.x to 2.x on the Mac. I have most of the game ported and operating properly, but rendering is not working.

The game used a single 8-bit Surface to render into. It filled a number of malloc'ed uint8 buffers with data from picture files, then blitted them into the Surface, and then Flipped. So I did this:

sdltxtr = SDL_CreateTexture(sdlrend,
SDL_PIXELFORMAT_ARGB8888,
SDL_TEXTUREACCESS_STREAMING,
640, 480);
sdlsurf = SDL_CreateRGBSurface(0, 640, 480, 8, 0,0,0,0);

Then I let the code bit into the Surface as normal, and then do this:

SDL_UpdateTexture(sdltxtr, NULL, sdlsurf->pixels, 640 * sizeof (uint8));
SDL_RenderClear(sdlrend);
SDL_RenderCopy(sdlrend, sdltxtr, NULL, NULL);
SDL_RenderPresent(sdlrend);

This causes bad output - garbage from the background basically. You can't see it in the image, but I can see the actual "sprites" (some of which are the whole screen) in the display rotating like an analog TV with bad vertical hold. Code is PD, so I'm happy to upload.

On 2014-07-08 04:14:37 +0000, Sam Lantinga wrote:

Did you verify that there are no SDL errors along the way? Can you attach a link to a complete example showing the problem?

Thanks!

On 2017-08-14 06:12:02 +0000, Sam Lantinga wrote:

No response, hopefully this is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant