Skip to content

DrawTexturePro draws nothing when destRec.width is negative #3128

Answered by Peter0x44
SpaceSoarer90 asked this question in Q&A
Discussion options

You must be logged in to vote

To flip a texture, you should pass a source rectangle with a negative width, not the dest rectangle.

See: https://github.com/raysan5/raylib/wiki/Frequently-Asked-Questions#how-can-i-draw-a-texture-flipped for how to do it properly
That is API misuse.

"H    to flip horizontally (change sign of stencil.width)",
"V    to flip vertically   (change sign of stencil.height)"

This is the correct thing to do, so I'm not sure why you aren't doing it.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SpaceSoarer90
Comment options

Answer selected by SpaceSoarer90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants