Why you should stop using SDL and use GLFW.

James William Fletcher
2 min readSep 30, 2023

--

  1. Ryan Gordon
Ryan Gordon caught mid T-pose. NPC confirmed. Asset of Epic Games.

2. SDL2 still uses integers for mouse coordinates and time and stuff. :”( GLFW uses floats. (SDL3 is set to use floats)

4. If you are using OpenGL then GLFW will make your life a lot easier, you can mix functions from various OpenGL specs and it won’t complain.

3. Wayland? Well, they both have trouble with Wayland this might be more of a constant arms-race than a one is better than the other.

9. GLFW supports some really cool window decorations such as a transparent render background as shown in the screenshot below,
video here.

Snowball.mobi it’s novel little game.

6. The highly suspect 🤔 “Render API” or “SDL GPU API” that Ryan Gordon is working on for SDL3 funded by an Epic MegaGrant. The idea is that this API is a Vulkan wrapper to expose an OpenGL like API. I imagine this would be a future plan to phase out the OpenGL API all together. It could go really well if it can leverage gains from Vulkan that overshadow the performance of OpenGL.

I’m a big fan of SDL and have been since SDL 1.2, but as of right now GLFW is better if you are working with OpenGL. SDL2 is probably my first choice for a portable 2D graphics context. Do I think SDL3 and it’s Render API can take on GLFW? This remains to be seen, but I would not put money on it just yet. Unless you mean donations towards SDL_GPU then yes I would consider donating to the cause, it is a noble one. You can donate here and here.

Which will rain victorious in the battle of cross-platform development libraries? It could be a bumpy road ahead for the Simple DirectMedia Layer!

I do really like the sound of SDL_GPU though.

--

--