1
\$\begingroup\$

I am using SFML library in my 2D game.

The Texture Class has a method to load an image from file:

Texture.loadFromFile("image.*")

Which file extension should I use to achieve best performance?

\$\endgroup\$
4
\$\begingroup\$

Original texture format does not affect in game performance

There may be a small loading time difference, but that is likely dependent on what system you are running on.

Use what ever texture format you and your artists are comfortable with. I would personally use png because it is losslessly compressed.

Don't fret over a few milliseconds on texture loading, you are likely to save more time by using your own sprite sheets.

If you really want to figure it out, profile all the different image loading techniques.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.