| Summary: | Corrupted output when copying from a Surface to a Texture | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Maury Markowitz <maury.markowitz> |
| Component: | *don't know* | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | sdlbug |
| Version: | 2.0.3 | ||
| Hardware: | x86_64 | ||
| OS: | Mac OS X 10.8 | ||
| Attachments: | Problems blitting in SAIS | ||
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! No response, hopefully this is fixed. |
Created attachment 1740 [details] 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.