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

Author Topic: Streaming to texture  (Read 2338 times)

0 Members and 1 Guest are viewing this topic.

ronag

  • Newbie
  • *
  • Posts: 24
    • View Profile
Streaming to texture
« on: September 02, 2010, 10:44:13 pm »
How would i efficiently stream data to a texture using SFML?

When using pure opengl i would usually have 2 PBOs where i write to one from memory while the other is rendered. Not sure how well this maps to SFML?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Streaming to texture
« Reply #1 on: September 03, 2010, 08:39:22 am »
In SFML 1, Image::LoadFromPixels is optimized for this kind of usage.
In SFML 2, there is a new Image::UpdatePixels function which is even more optimized.

This will never be as optimized as using "double-buffering" with PBOs, but it's enough to display a full-screen video at 30 fps, for example.
Laurent Gomila - SFML developer

ronag

  • Newbie
  • *
  • Posts: 24
    • View Profile
Streaming to texture
« Reply #2 on: September 03, 2010, 09:04:32 am »
Quote from: "Laurent"
In SFML 1, Image::LoadFromPixels is optimized for this kind of usage.
In SFML 2, there is a new Image::UpdatePixels function which is even more optimized.

This will never be as optimized as using "double-buffering" with PBOs, but it's enough to display a full-screen video at 30 fps, for example.


Should be good enough. Thank you.