SDL / GLFW:: What are some reasons to select one over the other?

Started by
1 comment, last by _Silence_ 7 years, 8 months ago

SDL and GLFW. Different solutions to different problems.

Here are some key differences I found that can help.

SDL

-Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.

GLFW

GLFW is a small C library that lets you create and manage windows, OpenGL and OpenGL ES contexts and Vulkan surfaces, enumerate monitors and video modes as well as handle inputs such as keyboard, mouse, joystick, clipboard and time.

My Take:
SDL is more or less a complete platform independence layer. For example it has subsystems for timers, threading, file abstraction, platform and CPU information, and power management. GLFW is focused only on OpenGL contexts, windows and input.

The difference is really summed up in this answer to an FAQ from GLFW, "Why yet another OpenGL library?" "S
DL is too large for some people and has never had OpenGL as its main focus. We therefore believe that there is room for a lightweight, modern library for managing OpenGL contexts, windows and input."



From here, given your goals and constraints I think an appropriate selection can be made.

Are there any other considerations & differences that can help one make a decision?

Advertisement

Are there any other considerations & differences that can help one make a decision?

Sounds like you already covered every inch of what needs to be known making a choice. :wink: Not sure why you started this thread to be honest. Unless I missed the point.

Check out my open source code projects/libraries! My Homepage You may learn something.

Also, from glfw main page:


Support for multiple windows, multiple monitors, high-DPI and gamma ramps

Community-maintained bindings for many different languages

Open Source with an OSI-certified license allowing commercial use

This might be important too.

And even if SDL does not target OpenGL, it can be a good choice to start a game (no harm to add audio for example).

This topic is closed to new replies.

Advertisement