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

Author Topic: Displaying photos in SFML  (Read 1116 times)

0 Members and 1 Guest are viewing this topic.

Fafner

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Displaying photos in SFML
« on: November 26, 2013, 01:24:32 pm »
I'm currently writing a desktop touch screen program to display photographs, and what I want to know is what would be the best way, in terms of performance, to load the photos into textures. I know I'm going to be working with re-sized photos for display and those photos will probably held be on an LAN server. There will be about 30-100+ photos that are going to be scrolled through in each instance of the program. 

Would it be better to hold all these photos as sf::textures or sf::images. Or should I only load them as I'm scrolling though the photos. Or download the re-sized photos to the local machine then load from there.

I'm asking because this program has to work on fairly low end machines, likely without a dedicated video card.

Thanks in advance!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Displaying photos in SFML
« Reply #1 on: November 26, 2013, 01:39:41 pm »
It's impossible to answer this question. The bottleneck can be many different things: the drive loading time, the CPU decoding time, the LAN transfer time, etc.

You should implement the simplest strategy, and then do some tests/profiling to know how to optimize it.
Laurent Gomila - SFML developer

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Displaying photos in SFML
« Reply #2 on: November 26, 2013, 06:04:56 pm »
Would it be better to hold all these photos as sf::textures or sf::images.
In case the difference is not clear: sf::Image is a simple container that holds the image in RAM. On the contrary, sf::Texture loads the image to the graphics card memory (by using an intermediate sf::Image).

When you have determined the bottleneck, this might help you to optimize more specifically.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything