SFML community forums
Help => General => Topic started by: asdatapel on July 03, 2013, 07:34:22 pm
-
Im using Opengl with SFML and im trying to map a texture, but its coming out flipped. In order to get the texture to appear the 'proper' OpenGL way (with the origin at the bottom left), I have to flip the sf::Image horizontally and then vertically. Is this the right way, or am I doing it wrong?
Ive looked around for answer to this but i cant find one. I found this:
http://en.sfml-dev.org/forums/index.php?topic=1273.0
but it doesnt seem to have a solution.
-
Why don't you flip your texture coordinates instead?
-
what do you mean?
-
You define texture coordinates, right? So you can change these values (swap top and bottom coordinates) instead of flipping the whole texture.
-
Gotcha, but that is knid of annoying though, because then you have to do it for every single coordinate
-
Write a function that does it for you.
-
And? You already define all the texture coordinates in your code, right? So there's no extra work, just swap the values for top and bottom coordinates.