SFML community forums
Help => General => Topic started by: pighead10 on December 29, 2011, 10:18:59 pm
-
I am following the 1.6 tutorials using the 2.0 version of SFML, and I'm trying to use shaders. Instead of sf::PostFX which isn't there, I thought sf::Shader is the equivalent. Furthermore, I tried using the sf::Shader::SetTexture, which not only does not accept 'NULL' as its second argument so I don't know how to tell it to use the contents of the screen but half the functions in sf::Shader that are listed by visual studio don't seem to be in the documentation. sf::Shader::SetTexture isn't.
How can use the equivalent of postfx in 2.0?
-
The online documentation is complete and up-to-date, and it even says how to emulate the old sf::PostFx class.
http://www.sfml-dev.org/documentation/2.0/classsf_1_1Shader.php
-
Oh, I didn't see that :D
My compiler says sf::Shader::setTexture is a functiom, but I can't see it in the documentation?
-
Are your header up to date? I guess you'd like to use a texture in your shader, in which case you'll want to use "sf::Shader::SetParameter (const std::string &name, const Texture &texture)".
-
The API has changed last week (the function was indeed SetTexture before), so make sure that your headers are up-to-date if you use a recent revision, or, if you use an older revision, look at the documentation in headers directly rather than the online one (or generate it with CMake).