GLFW VS SDL

Compare GLFW vs SDL and see what are their differences.

GLFW

A multi-platform library for OpenGL, OpenGL ES, Vulkan, window and input (by glfw)

SDL

Simple Directmedia Layer (by libsdl-org)
Our great sponsors
  • Nanos - Run Linux Software Faster and Safer than Linux with Unikernels
  • Scout APM - A developer's best friend. Try free for 14-days
  • SaaSHub - Software Alternatives and Reviews
GLFW SDL
28 43
8,189 1,951
2.0% 11.0%
8.8 9.9
3 days ago 2 days ago
C C
zlib License zlib License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

GLFW

Posts with mentions or reviews of GLFW. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-09-13.
  • [Handmade Network] How to write better (game) libraries
    Even if someone wants to use VS2008 for game development, it only took me a Google search to find https://github.com/glfw/glfw/blob/master/deps/vs2008/stdint.h which doesn't have any dependencies and a very permissive licence.
  • how do i include glfw in my code to make a window?
    reddit.com/r/vscode | 2021-08-31
  • LibOS – Cross-platform OS features in C++
    reddit.com/r/cpp | 2021-08-23
    You seem to have had a similar impetus as I had 20 years ago when I created GLFW (though with a slightly different focus).
  • Is there a way to get japanese text input in raylib?
    reddit.com/r/raylib | 2021-08-23
    Thanks for the detailed explanation. I'm afraid I didn't considered that use case for raylib and it would require some investigation to implement it... but raylib uses internally GLFW for desktop platforms and I've seen there is a related issue: https://github.com/glfw/glfw/issues/41 About IME support by the browser, it should be investigated. Feel free to open an issue on raylib GitHub for further investigation!
  • Massive trouble with GLFW header inclusion. Can someone help?
    Looking at the actual code of the .h file, it looks pretty empty, and like it needs some extra files perhaps. For instance, functions are just filled with comments with some random explanations, so they are basically 1 line, which probably does nothing. Here you can take a look yourself on github.
  • Hey, I want start
    I would suggest using GLFW and Glad with C++ and use LearnOpenGL as a refrence
  • Compiling in MacOS M1 Chip (arm64)
    reddit.com/r/raylib | 2021-07-22
    Now I read the logs and it seems the issue is with GLFW. I've found this: https://github.com/glfw/glfw/issues/1805
  • Opengl(glfw) gears on termux x11 NO ROOT!!
    reddit.com/r/termux | 2021-07-19
    Clone the glfw repositiory - git clone https://github.com/glfw/glfw.git
  • 3D Visualization with C++
    Use https://www.glfw.org/ to get a window with an OpenGL context.
  • A better way of running Minecraft Without XWayland. Because I REALLY had nothing better to do with my life.
    https://github.com/glfw/glfw/pull/1725 (which is where I got some patches from) says there wasn't much upstream interest on merging the patches. But https://github.com/glfw/glfw/pull/1711 (the fix for the freezing issue) might be a good candidate for merging, though I don't know how GLFW people work, so I cannot comment on if it is properly upstreamable or not.

SDL

Posts with mentions or reviews of SDL. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-10-16.
  • Asking for advice on programming games without an engine
    reddit.com/r/gamedev | 2021-10-16
    Sounds to me that you want something like SDL with OpenGL.
  • Any alternatives to the SC for Gyro control?
    also 8BitDo: doesn't upgrade either Mac or DInput mode in order to do both like how Flydigi Vader 2 does.
  • Investigating the 'Patching' Process
    dev.to | 2021-09-27
    Let's see, for example, this PR regarding some triangle rendering feature. I have chosen this PR since it is the one that is the most commented on, which helps to understand how a PR might go in this project.
  • https://np.reddit.com/r/vulkan/comments/pwnrju/im_trying_to_make_sense_of_this_validation_error/hej6ekz/
    vkb::InstanceBuilder builder(vkGetInstanceProcAddr); // TODO: Get project name from cmake variable builder.set_app_name("prototype") .require_api_version(1, 1, 0) .use_default_debug_messenger(); #ifdef __APPLE__ // TODO: remove VK_MVK_macos_surface after this issue is fixed // https://github.com/libsdl-org/SDL/issues/3906 builder.enable_extension("VK_MVK_macos_surface") .enable_extension(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); #endif if (ENVIRONMENT == Environment::development) { builder.set_app_name("prototype") .request_validation_layers(true) .set_debug_callback(debugCallback); // TODO: Enable better debug messages // .add_validation_feature_enable(VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT) // .add_validation_feature_enable(VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT) } vkb::Instance vkbInstance = builder.build().value(); instance = vkbInstance.instance; debugMessenger = vkbInstance.debug_messenger; vkb::PhysicalDeviceSelector selector{vkbInstance}; vkb::PhysicalDevice physicalDevice = selector.set_minimum_version(1, 1).set_surface(surface).select().value(); vkb::DeviceBuilder deviceBuilder{physicalDevice}; vkb::Device vkbDevice = deviceBuilder.build().value(); device = vkbDevice.device; chosenGPU = physicalDevice.physical_device; graphicsQueue = vkbDevice.get_queue(vkb::QueueType::graphics).value(); graphicsQueueFamily = vkbDevice.get_queue_index(vkb::QueueType::graphics).value(); VmaAllocatorCreateInfo allocatorInfo = {}; allocatorInfo.physicalDevice = chosenGPU; allocatorInfo.device = device; allocatorInfo.instance = instance; vmaCreateAllocator(&allocatorInfo, &allocator);
  • I'm trying to make sense of this validation error message I only get on windows
    reddit.com/r/vulkan | 2021-09-27
    // TODO: remove VK_MVK_macos_surface after this issue is fixed // https://github.com/libsdl-org/SDL/issues/3906 builder.enable_extension("VK_MVK_macos_surface") .enable_extension(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
  • SDL Keypress resulting in Segfault
    The reason I included the archive links is because libsdl.org seems to be down at the moment.
  • I wish I knew about this feature months ago...
    reddit.com/r/sdl | 2021-09-09
  • AM2R @ Raspberry Pi - Take 4
    reddit.com/r/AM2R | 2021-09-02
    Now, we'll need to source the latest SDL source tarball. You can find it [here](https://github.com/libsdl-org/SDL), but you can source the latest as of this writing with the command below. Run cd, and then run:
  • (When) will xdg-decoration become stable?
    reddit.com/r/wayland | 2021-08-17
    if the applications you’re thinking of is using SDL, then this will get fixed soon (depending on the update speed of your distribution): https://github.com/libsdl-org/SDL/pull/4068
  • Release of SDL 2.0.16

What are some alternatives?

When comparing GLFW and SDL you can also consider the following projects:

bgfx - Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.

Skia - Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.

OpenSceneGraph - OpenSceneGraph git repository

Ogre 3D - scene-oriented, flexible 3D engine (C++, Python, C#, Java)

glad - Multi-Language Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specs.

Open-Source Vulkan C++ API - Open-Source Vulkan C++ API

magnum - Lightweight and modular C++11 graphics middleware for games and data visualization

Allegro - The official Allegro 5 git repository. Pull requests welcome!

cdecrypt - Decrypt Wii U NUS content β€” Forked from: https://code.google.com/archive/p/cdecrypt/

Phaser - Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.

Irrlicht - An automatically updated mirror of the Irrlicht SVN repository on sourceforge

glbinding - A C++ binding for the OpenGL API, generated using the gl.xml specification.