I need to port my game project from Android (written in C, OpenGL ES 2.0, thanks to NDK) to Windows and Linux platforms. Of course I will need to rewrite some platform dependent code, but for now I'm stuck with the question of which library to use for creating OpenGL context and handling input.

Just a quick googling gives me 3 candidates:

  1. FreeGLUT - rewritten and free good old GLUT.
  2. SDL - most well know one lib, used in many games.
  3. GLFW - some kind of newer library, but simple and functional.

I'm quite new to PC development and don't see any significant differences between them. Can you help me with the choice? I need only core mouse/keyboard input and creation of OpenGL context. I'll be using GLEW to load OpenGL functions.

  • 2
    \$\begingroup\$ The answer will be highly opinionated and is not really a good question for the SE format. That said, my highly opinionated answer -- having used all three for real projects, and a few others like SFML, GLUT, Qt, and hand-rolling a solution -- is that SDL gives a good mix of features, stability, and ease of use. I especially recommend the pre-release 2.0 versions (only available by checking out the Mercurial repo and building yourself, but that's quite easy). Second to that, SFML is pretty good. I found too many bugs in GLFW, GLUT is bad for games, and hand-rolling is lots of works. \$\endgroup\$ Commented Jul 19, 2012 at 7:35
  • \$\begingroup\$ I personally would recommend SDL because it handles all parts of a game from input to the graphics to the audio and input. However, it can be limiting, but since you're coming from an already developed game for a more limited platform, i think it would be a fine choice. \$\endgroup\$
    – CobaltHex
    Commented Jul 19, 2012 at 8:20
  • \$\begingroup\$ Yeah, its a poll. My vote is GLFW, simple, easy, never had any issues that weren't resolved. It is super light weight and easy to compile as well. \$\endgroup\$ Commented Jul 19, 2012 at 8:56
  • 1
    \$\begingroup\$ closed because it's off-topic??? I wonder, what is this site about??? \$\endgroup\$
    – user124631
    Commented Nov 24, 2020 at 5:11

1 Answer 1


GLFW is modern and has a very well defined scope. It's also under very active development.

SDL on the other side is rock solid and has a lot features in different scopes but is somewhat lacking in all of them (for example: SDL can do audio, but you might prefer using OpenAL because its far superior in that matter). It might be notable that SDL was ported to many different platforms, unlike GLFW which is only for desktop platforms (win/linux/mac).

GLUT, well, should be avoided. There simply isn't really anything about it what makes it good.

In my opinion as perfectionist GLFW is the better choice. Because it does exactly what one wants, nothing less nothing more. The very active development is also a good sign for long term projects because it usually means that bugs will be fixed, that new features will be added, it will keep up with newer standards and that it won't be abadoned anytime near. This isn't important for a quick port or a 6-month game, but for a engine or a library you want to reuse I would keep that in mind.

  • 10
    \$\begingroup\$ But the OP is asking about Freeglut not GLUT !!! \$\endgroup\$
    – user3473
    Commented Jan 22, 2015 at 10:15
  • 1
    \$\begingroup\$ @YoYoYonnY So are GLFW and SDL, hence this question. \$\endgroup\$
    – Dan
    Commented Apr 9, 2016 at 4:32
  • 1
    \$\begingroup\$ @Dan... no. GLFW and especially SDL are definitly not alternatives for GLUT, because you can do things with them that you can't with GLUT and vice versa. \$\endgroup\$
    – yyny
    Commented Apr 9, 2016 at 11:38
  • 1
    \$\begingroup\$ @YoYoYonnY You can do things with FreeGLUT that you can't do with GLUT. My point still stands. \$\endgroup\$
    – Dan
    Commented Apr 9, 2016 at 18:17
  • 2
    \$\begingroup\$ @YoYoYonnY Maybe it would be more clear if you just updated your answer to state whether or not FreeGLUT is worth pursuing. I don't think "FreeGLUT, well, should be avoided. There simply isn't really anything about it that makes it good" is an accurate statement, but maybe you could convince me otherwise with some good reasons not to use it (preferably, by editing your answer). \$\endgroup\$
    – Dan
    Commented Apr 9, 2016 at 19:59