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

Author Topic: Preferred (fastest) method of getting an Image onto a RenderWindow?  (Read 1116 times)

0 Members and 1 Guest are viewing this topic.

Tumlee

  • Newbie
  • *
  • Posts: 1
    • View Profile
Hello, I am giving a SFML a test run to in preparation for migrating from using SDL for my games. Right now I am getting myself familiar with all the classes and functions. Something that is crucial thing I took advantage of in SDL was being able to directly modify the pixels on the screen as well as on sprites that would be drawn to the screen almost immediately (An example where I use this is for drawing an image with a "TV static" effect, or a sky full of stars that constantly shift hue in the background)

It appears that the only class where this is possible in SFML is the sf::Image class, which apparently can't be drawn directly to an sf::RenderWindow. So would I have to copy it to an sf::Texture first, or would that be too slow to do rapidly? Is there a better method I'm not thinking of?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Preferred (fastest) method of getting an Image onto a RenderWindow?
« Reply #1 on: April 23, 2012, 10:28:22 pm »
You'll have to forget this way of doing things -- was good in the 90s but now this is not how things work anymore.

For example, the effects that you describe are typically implemented using shaders that run directly on the graphics card.
Laurent Gomila - SFML developer

 

anything