Ok, so, on my derived drawable class, I solved my flip operations this way:
- I remove (inverse operations) the origin and rotation transformations applied by the sf::Drawable class (note that I let position and scale unchanged)
- apply my flip (scale by -1 on x and/or y)
- apply the origin and rotation back again.
Note that I didn't changed order of any original operation, just added a negative factor in a different order than the scale relatively to origin and rotation.
This works great, drawables are now just equal to what they where before, except that they now have FlipX and FlipY methods, that truly flips them over their origin.
I think this is a very consistent/simple/clean concept and interface, don't you? I think flip shouldn't be limited to sprites, it should be provided for all drawable objects.
Also I think Sprite::Flip methods aren't that useful nor consistent, because it isn't a flip over their origin. The origin doesn't coincide with the same pixel anymore, and that's not concordant with the expected properties of the geometric flip operation.
The bad of my implementation is that it requires some extra matrices to be applied on the renderer.
Would you consider to change sf::Drawable (and sf::Matrix3), adding a myIsFlippedX and myIsFlippedY and inverting scale directly on the matrix, in an order that doesn't change anything of the current operations order? So that drawables become with a geometric flip operation. I think it would be of great use! Shouldn't be hard to do and keeps interface simple.
Oh, just if you find that scale by -1 has any problem (didn't find any yet, maybe you restricted it to avoid scale by zero?).