Flip sprites using SDL_RenderGeometry

I’m adopting awesome SDL_RenderGeometry to render my sprites. When I want to flip horizontally/vertically, my method is switching texture coordinates of top-left and bottom-right of sprite’s rectangle. Everything works fine, until I’m trying to test software renderer (using SDL_RENDERER_SOFTWARE), apparently nothing is drawn at all. Is this a bug or misuse?

I think this should work. Can you open an issue on

with a test-case

Issue has been created.

SDL_RenderGeometry’s software backend failed to render when texture coordinates are reversed · Issue #5768 · libsdl-org/SDL (github.com)

Thanks ! I’ve fixed the issue.

when the software render tries to reinterpret a SDL_Rect from 2 Triangles, if possible, it didn’t handle vertical / horizontal flips.
Please give a try.

1 Like