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 depended code, but now i stuck with question which library for creating OpenGL and input handle use.

Just a quick googling get me 3 candidates:

1) Freeglut - rewrited and free good old GLUT.
2) SDL - most well know one lib, used in many games.
3) GLFW - some kind of new, but simple and functional.

I just quite new to PC develop and don't see any significant differences beetweem them. Can you help me which one to choose? I clearly need just core mouse/keyboard input and creating of OpenGL context, also i will use GLEW to get to modern OpenGL with easy.

  • 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\$ – Sean Middleditch Jul 19 '12 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 Jul 19 '12 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\$ – deceleratedcaviar Jul 19 '12 at 8:56

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.

  • 7
    \$\begingroup\$ But the OP is asking about Freeglut not GLUT !!! \$\endgroup\$ – user3473 Jan 22 '15 at 10:15
  • \$\begingroup\$ @user3473 "FreeGLUT is an open source alternative to the OpenGL Utility Toolkit (GLUT) library." \$\endgroup\$ – YoYoYonnY Mar 21 '16 at 18:50
  • \$\begingroup\$ @YoYoYonnY So are GLFW and SDL, hence this question. \$\endgroup\$ – Dan Apr 9 '16 at 4:32
  • \$\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\$ – YoYoYonnY Apr 9 '16 at 11:38
  • \$\begingroup\$ @YoYoYonnY You can do things with FreeGLUT that you can't do with GLUT. My point still stands. \$\endgroup\$ – Dan Apr 9 '16 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy