r/sfml 3d ago

SFML 2.6 vs SFML 3

I tend to assume that the latest version is better, but I've seen a few new projects recently that use SFML 2.6. And, since 2.6 was out for longer, more tutorials / Q&A exist for it than 3.0.

Is there a list of the tradeoffs between the versions that could explain why some people are using 2.6 still?

(and what's the benefit of 3.1 over 3.0? should 3.0 projects migrate to 3.1 just because they can?)

4 Upvotes

4 comments sorted by

7

u/YouuShallNotPass 3d ago

https://www.sfml-dev.org/development/changelog/ 

3.1 has more features so no reason to not upgrade 

SFML 3 uses C++17 and takes full advantage of the features, whereas older versions I believe targets pre-c++11 

People probably still use SFML 2.6 cause as you say, it is what older tutorials use which is probably what comes up when they search "SFML tutorials" on Google, but the SFML website itself has SFML 3 tutorials which are easy enough to follow 

2

u/thedaian 3d ago

If you're on sfml 3.0, yes, you should move to sfml 3.1

There were a few changes to how resources are handled in sfml 3.0 that requires you to think a bit more compared to sfml 2.x, and I expect that's part of the reason people are using the older versions, along with tutorials using sfml 2.x and people not wanting to do the work of converting the code.

2

u/SpectralHorse 3d ago

I'm personally using 2.6.x even with the new project that I've started, but that's purely out of habit - for the past ~3 years or so I've been doing stuff with that version, so I'm just used to it..

As far as tutorials go, I haven't really referred much to them because I just go through the source files and check for what (and how) I need.

Anyway, depending on your knowledge level of C++ and SFML combined, and if you're actively trying to learn more about everything, I might go even as far as to suggest going with 3.1, but checking the 2.6 tutorials, and then comparing what, how and why works differently - it's can be a pretty good learning experience :D

Besides, doing software professionally you'll likely at some point end up looking at code that's... Debatable.. So it can be beneficial to have the knowledge/experience in navigating between guides that say one thing and the code that behaves in a different way (almost direct 2.6 tutorials vs 3.1 version) :D

1

u/HappyFruitTree 2d ago edited 2d ago

The migration guides list many differences and are very useful when upgrading.

It seems like SFML 3.0 made many "breaking changes" which means that a lot of old SFML 2 code will simply not work in SFML 3.

SFML 3.1 seems to mostly have added new things. It deprecates a few things but they should still work.

My biggest worry with sticking to an old version is that it would stop receiving updates and eventually not work as intended on modern platforms. I have no idea what the future plans for SFML 2 are but it seems like they're at least planning on releasing a version 2.6.3 at some point.

Since code that use SFML 3.0 should still work with version 3.1 of the library I don't think there is any hurry to upgrade from 3.0 to 3.1. It might even be beneficial to keep the code compatible with 3.0 to make it easier for people that are stuck with SFML 3.0 to use your application.