3 ms·
How does GLFW compare to SFML? Edit: upon initial inspection it appears SFML is similar to SDL, which provides support for other features such has networking,
by iamcreasy 8y ago
How does GLFW compare to SFML?
Edit: upon initial inspection it appears SFML is similar to SDL, which provides support for other features such has networking, audio etc.
- floatboth 8y agoSFML is much "fatter", it handles graphics and even audio and networking.
- klodolph 8y agoGLFW, SDL, and SFML are on a scale from "lightweight" to "heavyweight". SFML is, by far, the largest, heaviest, and most opinionated of the three. GLFW is not much more than platform abstraction for multimedia (windows, input, OpenGL/Vulkan context creation, timing). Notably it is missing any kind of audio support, but you probably want to ues FMOD, Wwise, or iirKlang anyway. SDL is all of that, plus various utilities for porting and some platform abstractions that are no longer needed. For example, logging, assertions, blitting, endian conversion, file abstraction, threads and atomics. There are a few associated helper libraries designed to work with SDL, like SDL_image, SDL_ttf, and SDL_mixer. These are optional. SFML is all of that, plus the interface is written in C++, there's all sorts of things like sprite drawing, texture loading, and audio systems mixed in, plus a bunch of extra random functionality like HTTP clients, OpenGL wrappers, etc. SDL is the oldest of the three. My perspective is that if you look at SDL and think, "Wow, this does a lot of stuff that is kind of weird and old, maybe I don't need all of that", then you would invent GLFW. If you looked at SDL and thought, "I want something bigger, more, more, more, with a C++ interface, consume the world!" Then you would invent SFML. I have some strong opinions here, which are probably coming across. I see developers who say, "I want to make games, that means low-level, so I'm going to learn Win32," and I try to prevent them from wasting time learning APIs, steering them towards one of these libraries. On the other hand, I think SFML is a big mess that tries to do everything, and it's a lesson in why it's easy to make bad C++ APIs. I mean, jeez, it has "class RectangleShape" which inherits from "Shape" which inherits from "Drawable". It makes me want to puke.
- iamcreasy 8y agoThank you. How about SDL 2.0? It was a major rewrite - is it modern enough?
- BubRoss 8y agoI can't agree more, especially with the last part of inheritance nonsense.
- westmeal 8y agoPersonally I like SFML because you can just slap it into a quick project and get things rolling quickly but I agree with it trying to handle too much. I suppose the main reasoning was that it was intended for creating video games. At least you can pick and choose different headers ¯\_(ツ)_/¯