Sign in to follow this  
Plotnus

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

Recommended Posts

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?

Edited by Plotnus

Share this post


Link to post
Share on other sites

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.

Edited by ajm113

Share this post


Link to post
Share on other sites

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).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this