Those few people, who’ve been reading my blog for the past nine or more years, may still vaguely remember all the SFML News posts, where I highlighted development changes and featured SFML games from the community. Given the passed time since my last post in 2014, I won’t be able to catch you up on all details and changes since then, but I try in this post to give a broad overview, so that future and more regular posts can address the latest developments.
At the end of 2014, we release SFML 2.2, then in the middle of 2015 we had SFML 2.3, 2.3.1, and 2.3.2 in fall of that year. Summer of 2016 brought us 2.4 with some fixes in 2.4.1 towards the end, and more adjustments with 2.4.2 in the beginning of 2017. We got SFML 2.5 out of the door in the middle of 2018 and published some fixes in fall. And then… no other releases, which means, SFML 2.6 has been in development for the past four and then some years.
But before we get to that topic, lets have a brief look at some of the exciting features introduced with SFML 2.3 up to 2.5:
- Strike-through text style (SFML 2.2)
- Added a new constructor to
sf::Colorthat takes an
- Added support for outlined text (SFML 2.4)
sf::VertexBufferclass (SFML 2.5)
- Request focus and check the focus status on a window (SFML 2.2)
- Added new events for handling high-precision scrolling (SFML 2.3)
- Added ability to grab cursor (SFML 2.4)
- Implemented Clipboard & system Cursor API (SFML 2.5)
- Allow for selecting the audio capture device (SFML 2.2)
- Switched from libsndfile to dedicated Vorbis, FLAC and OGG libraries (SFML 2.3)
- Implemented stereo audio recording (SFML 2.4)
- Added loop point support to
- Support for chunked HTTP transfers (SFML 2.2)
- Added optional argument on which address to bind (SFML 2.4)
- Add append/overwrite parameter to
fromUtfXconversion function for
sf::getNativeActivity()for Android (SFML 2.4)
For the list I only picked one feature per module and version, but there’s much more, see the full change log here.
Where is SFML 2.6?
There were two factors influencing the delay of SFML 2.6:
- It was decided that SFML 2.6 would be the last 2.x release
- I wanted to make sure, to include the Scancode feature in SFML 2.x and not push it back further
The good news at this point is, that earlier today, the Scancode feature was finally merged! So the next release is getting very close. The feature was really rather complex, as there is little documentation on how Scancodes work for either of the three main platforms. The theory behind it seems simple:
- When a key is pressed or released, a code of the physical key is sent out
- Take the hardware code and use it in SFML
Except, no OS hands you the hardware codes directly, instead you get some form of translated code, which various special cases for special keys. On top of that, we made it additionally challenging, by wanting to have a sort of conversion between Scancodes and Keycodes, and also a text representation, which again OS APIs aren’t handling in a straight-forward manner, nor do they cover all the cases.
SFML 3 is Happening
As the need and/or wish of users to get support for C++11 up to C++17 in SFML increased more and more, it was decided to start the work on SFML 3 in parallel. As our well-known community member Vittorio Romeo was eager to get started, we added him to the SFML Team, branched off SFML 2.6 into the
2.6.x branch and kicked-off SFML 3 on the
The master branch has received over 300 new commits towards SFML 3 since, in large part thanks to Chris Thrasher, who we added to the SFML Team shortly after as well!
As defined in the SFML Roadmap, the primary goal of SFML 3 is the introduction and support of C++17, as well as the removal of deprecated APIs. Secondary, are breaking API changes, which we couldn’t do before or had to compromise in SFML 2. Only as a tertiary priority, do we want to look at additional features, again here prioritize stuff that can have an influence on changing the existing API, as any non-breaking additions, can be implemented later with a minor version. That’s the plan, but we’re also flexible, especially if someone is championing a new feature from start to finish, we can’t really ignore those contributions.
I believe there’s still quite a bit of work remaining for SFML 3 and invite anyone to contribute to the project: https://github.com/SFML/SFML
Testing, Building & Checking
The testing foundation was introduced for SFML 2.6, but has really been taking off on the
master branch for SFML 3. Having enabled support for graphical tests, meaning where a component requires OpenGL calls to succeed, we’ll be able to push this topic much further.
Expanding our Continuous Integration pipeline with GitHub Actions, we’re currently sitting at 76 different checks/builds for every push or merge. Our own build servers with native support for Debian, FreeBSD, macOS Intel, macOS M1, Windows, and Rasperry Pi, as well as cross-compilation for Android and iOS, we can cover a lot of ground, but adding in the flexibility of GitHub Actions, has really unleashed a lot of possibilities.
Not all checks are library builds, but there’s also runs for clang-tidy and clang-format, with a lot of code clean-up already applied and still on-going.
Again a bit thank you to Thrasher for spearheading most of these quality enhancements!
It’s amazing, seeing a lot of new contributors join the project, even just for small things, which allows others to focus on bigger topics. Alone in the past two years (2021 & 2022), we’ve merged commits of over 30 different users! Thank you to everyone!
The forum is the optimal place for longer discussions and decision threads, as they are permanently and independently stored and made available for indexing, which isn’t always as easy for GitHub or chat applications. Speaking of which, there’s a very active and friendly community on Discord, which is also one of the main ad-hoc discussion places for maintainers and contributors.
I think there’s already enough content in this post, so I won’t be presenting some of the newer SFML games published, but here are a few links, in case you want to keep an eye on them yourself: