SFML community forums
Help => Graphics => Topic started by: Heryon on April 25, 2017, 09:09:42 pm
-
Hi, I'm using shaders in my app, and as setParameter is deprecated, I must use setUniform, but I don't know how to convert a sf::Vector2f into a Glsl::Vec2.
-
Both sf::Vector2f and sf::Glsl::Vec2 are typedefs of sf::Vector2<float>.
You should be able to provide a sf::Vector2f as the parameter for setUniform.
setUniform's overloads support all the types provided by SFML:
[...]
sf::Vector2f (GLSL type vec2)
(from https://www.sfml-dev.org/tutorials/2.4/graphics-shader.php#passing-variables-to-a-shader)
-
Ok thank you.