| Summary: | SDL_UpdateTexture from a surface has different content than the creation from the same surface | ||
|---|---|---|---|
| Product: | SDL | Reporter: | axel mattauch <axel.mattauch> |
| Component: | render | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 2.0.5 | ||
| Hardware: | x86_64 | ||
| OS: | Windows 8 | ||
| Attachments: | Very small test program (#100 lines) | ||
This bug is in close relation with #3680. This 3648 shows only that a texture created by SDL_CreateTextureFromSurface from a give surface is modified by SDL_UpdateTexture, even if the given surface is not changed. #3680 shows precisely the problem (and the RGBA --> ARGB tournaround) (In reply to axel mattauch from comment #1) > This bug is in close relation with #3680. > This 3648 shows only that a texture created by SDL_CreateTextureFromSurface > from a give surface is modified by SDL_UpdateTexture, even if the given > surface is not changed. > #3680 shows precisely the problem (and the RGBA --> ARGB tournaround) Thus, this topic is closed. (see #3680) |
Created attachment 2732 [details] Very small test program (#100 lines) Hello! I have created a surface through psurface = SDL_CreateRGBSurfaceWithFormat and filled the psurface surface with some color (SDL_FillRect) Then I created a texture from this surface ptexture = SDL_CreateTextureFromSurface(prenderer, psurface) The rendering (SDL_RenderCopy + SDL_RenderPresent) is OK: the screen displays effectively a surface of the color as defined by the SDL_FillRect. But in a second step, following immediately, I updated the same texture from the same surface by: SDL_UpdateTexture(ptexture, NULL, psurface->pixels, psurface->pitch) While no execution errors are occuring, the display after rendering (SDL_RenderCopy + SDL_RenderPresent) has a wrong color. As I simplified atmost the test sequence, I believe that the problem comes from the SDL_UpdateTexture call. Thanks for the help. Axel Mattauch