Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML 2.0 PostFX?  (Read 2556 times)

0 Members and 1 Guest are viewing this topic.

pighead10

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • Hog Pog
SFML 2.0 PostFX?
« 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?
Immortui - Zombie puzzle game: http://immortui.hogpog.co.uk

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML 2.0 PostFX?
« Reply #1 on: December 30, 2011, 08:02:36 am »
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
Laurent Gomila - SFML developer

pighead10

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • Hog Pog
SFML 2.0 PostFX?
« Reply #2 on: December 30, 2011, 02:43:00 pm »
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?
Immortui - Zombie puzzle game: http://immortui.hogpog.co.uk

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
SFML 2.0 PostFX?
« Reply #3 on: December 30, 2011, 04:32:38 pm »
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)".

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML 2.0 PostFX?
« Reply #4 on: December 30, 2011, 06:08:39 pm »
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).
Laurent Gomila - SFML developer

 

anything