Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
General
»
Flipped Textures
Print
Pages: [
1
]
Author
Topic: Flipped Textures (Read 2472 times)
0 Members and 1 Guest are viewing this topic.
asdatapel
Jr. Member
Posts: 76
Flipped Textures
«
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.
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: Flipped Textures
«
Reply #1 on:
July 03, 2013, 08:08:33 pm »
Why don't you flip your texture coordinates instead?
Logged
Laurent Gomila - SFML developer
asdatapel
Jr. Member
Posts: 76
Re: Flipped Textures
«
Reply #2 on:
July 03, 2013, 08:56:11 pm »
what do you mean?
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: Flipped Textures
«
Reply #3 on:
July 03, 2013, 08:58:29 pm »
You define texture coordinates, right? So you can change these values (swap top and bottom coordinates) instead of flipping the whole texture.
Logged
Laurent Gomila - SFML developer
asdatapel
Jr. Member
Posts: 76
Re: Flipped Textures
«
Reply #4 on:
July 04, 2013, 10:45:28 pm »
Gotcha, but that is knid of annoying though, because then you have to do it for every single coordinate
Logged
Nexus
SFML Team
Hero Member
Posts: 6287
Thor Developer
Re: Flipped Textures
«
Reply #5 on:
July 04, 2013, 10:46:48 pm »
Write a function that does it for you.
Logged
Zloxx II
: action platformer
Thor Library
: particle systems, animations, dot products, ...
SFML Game Development
:
Laurent
Administrator
Hero Member
Posts: 32498
Re: Flipped Textures
«
Reply #6 on:
July 05, 2013, 07:58:58 am »
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.
Logged
Laurent Gomila - SFML developer
Print
Pages: [
1
]
SFML community forums
»
Help
»
General
»
Flipped Textures