I am trying to learn OpenGL, and I just found out that GLUT is obsolete. I already know SDL, and it seems it is a good alternative. Should I use SDL to develop games with OpenGL, or are there any better alternatives. I am new to game development, so I don't know much about the state of the art.


I just found out that GLUT is obsolete.

That's what happens when you accept the first answer you come across; you get bad information. GLUT 3.7 shouldn't be used, but FreeGLUT is completely backwards compatible with it.

However, your question goes elsewhere. For making an actual game, GLUT of * form is inappropriate. It doesn't give you control of the main loop, and you really need that in a game (FreeGLUT does have a way to control the main loop, but it's still odd). GLUT is for writing graphics demos. That's very important when testing new graphical effects, so it should be there in your toolbox when needed. But your main game code should never use it.

GLFW is a game-centric lightweight alternative to GLUT. It provides basic support for things beyond creating an OpenGL window. It lets you get input, load images as textures, and a couple of other things.

SDL, SFML, and Allegro 5 are all multimedia toolkits. They can create OpenGL windows, but they do a lot more than that. They provide full support for input, audio, and various other stuff you need to make a game. If you're making a game, any of these are a good starting point. I personally like Allegro 5, but that's just my bias towards good documentation and a clean API.

  • 1
    \$\begingroup\$ What does the AAA titles(both pc only and multi-platform) uses? Do they use these(GLFW, Allegro) that you've mentioned, for handling opengl window? or they write their own 'everything' from the scratch? \$\endgroup\$ – Quazi Irfan Feb 10 '12 at 17:45
  • \$\begingroup\$ @iamcreasy: "AAA titles" (I really hate that term) don't use any of these. In general, they don't use anything open-source. They could, but if they're going to use a library, they'd much rather use a library that is supported. There are some exceptions like ODL or Bullet. But those are exceptions rather than the rule. \$\endgroup\$ – Nicol Bolas Feb 10 '12 at 17:55
  • \$\begingroup\$ Since when does GLFW 'load images as textures'? Definitely isn't in the feature list; nor any functions that remotely serve that purpose in my glfw header. \$\endgroup\$ – deceleratedcaviar Feb 10 '12 at 18:05
  • 1
    \$\begingroup\$ The other big downside to GLUT is that its input model isn't particularly well-suited to games; there's no way to get raw keycodes or to get press/release events on the modifier keys themselves (e.g. using ctrl as a fire button), nor is there a way to get the underlying GL context (which is necessary to enable vsync on X11, for example). \$\endgroup\$ – fluffy Feb 10 '12 at 18:56
  • 1
    \$\begingroup\$ @NicolBolas ah, I forgot about 2.7, they [threads, images] have been declared 'out of context' for the GLFW 3.0 release. \$\endgroup\$ – deceleratedcaviar Feb 10 '12 at 21:38

You can find alternative to GLUT on this page:


To that i would also add SFML:



If your goal is to develop a game,

It depends on whether you want your game to be cross-platform or not. For portable (Windows, Mac, Linux) games SDL seems to be the only choice.

If you only target Windows and/or XBox, there are much better alternatives, e. g. XNA which frees you from writing a lot of code manually.

If your goal is to learn OpenGL,

Just program in raw OpenGL, but be prepared to face a lot of unintuitive concepts, math and huge manuals.

  • \$\begingroup\$ As Takumi said, there's also SFML as a portable library. Better than SDL imho (it's more up-to-date.) \$\endgroup\$ – kaoD Feb 10 '12 at 15:26
  • 8
    \$\begingroup\$ -1: "For portable (Windows, Mac, Linux) games SDL seems to be the only choice." This is not even remotely true. SFML and Allegro 5 both exist as perfectly valid alternatives, and both have wider platform bases. \$\endgroup\$ – Nicol Bolas Feb 10 '12 at 16:22

GLUT is an API as well as a library. The original library is indeed obsolete. The API is a different thing, it was pretty good to begin, it just needs revisions for overcoming limitations and addressing new needs. The primary current implementation is FreeGLUT, which is supported and not obsolete. That means that a good alternative to GLUT (as in the library GLUT) is GLUT (as in FreeGLUT).

The problem noted above with "control of the main loop" is incorrect. With newer GLUT versions you can have better control over your game loop (if that is important to you). The limitation was fixed by glutMainLoopEvent(). This and other limitations are addressed here:


  • \$\begingroup\$ "With newer GLUT versions you can have better control over your game loop (if that is important to you)." It's a game, so yes, that's important to you. Also, glutMainLoopEvent is hardly a good way to go about managing the main loop. It still uses an event-driven model for feeding you data, rather than a polling model where you get the data you want when you want it. \$\endgroup\$ – Nicol Bolas Apr 1 '13 at 10:39
  • \$\begingroup\$ I must argue that the event driven model is more efficient than polling, unless you are polling into data stored from the events (which is just fine). Polling system resources should be done carefully. \$\endgroup\$ – Ingemar Ragnemalm Jul 30 '17 at 12:58

Qt does support OpenGL. Take a look to Open Inventor and consider if make it sense for you to go straight to an higher level 3D API.


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.