Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am starting to learn OpenGL with FreeGLUT using the Superbible and the knowledge i have from my elementary graphics to brush up on my skills.

To get more from this experience i want to integrate a GUI to overwrite the one FreeGLUT uses, now my question is this: is this thing possible and what library should i use?

Some characteristics for the library:

  • Open source
  • Multi-platform (Linux and Windows)
  • C/C++

If you have any other recommendations please feel free to post them along with your answers for my problem.

share|improve this question

closed as not constructive by Tetrad Apr 2 '13 at 23:04

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

OpenGL uses a GUI by default since when? :L – The Communist Duck Sep 6 '10 at 19:54
Meant to say the library i was using, aka FreeGLUT. – Cristina Sep 6 '10 at 20:00
Added bounty - additional requirement: must have cross-platform file io dialogs. – Jari Komppa Feb 18 '11 at 11:03
on sourceforge, tiny file dialogs has several modal function calls. it's a simple C C++ cross-platform file to add to your project. – elisa Feb 26 at 20:48

I haven't yet tried it myself, but this looks very interesting:


EDIT: Since you'll need a context to render to, I would recommend either SFML or SDL 1.3.

share|improve this answer
indeed it does look interesting – Will Feb 18 '11 at 15:08
I use libRocket and it is absolutely wonderful! Pains of HTML are present in the library too, but with some fooling around with it, you get around anything virtually :D – Grimshaw Feb 18 '11 at 22:18
Seems to have stalled (no updates for a couple of years). Also, browsing through the docs doesn't give a really good view of what's it actually like. The docs are generally way too low-level. – Jari Komppa Nov 29 '12 at 11:53
No official package for Fedora or Ubuntu either (as far as I can see). – ilent2 Apr 22 '14 at 13:21

Crazy Eddie's GUI (CEGUI) is popular, and you can either crib one of the existing renderer backends or write your own targeting whatever OpenGL-backed API you want. It is open source, multi-platform, and C++. However, it values consistency, which is not always a good UI principle for games, which may have dozens of custom controls used in exactly one place.

A recent popular pattern is immediate mode GUI (IMGUI), which is kind of "no GUI library". It has pluses and minuses - it's very straightforward, but can be tricky to optimize, and I've yet to see really good IMGUI models for advanced controls like combo boxes or tree views. Nor have I see a good implementation of an IMGUI windowing system (and I spend some time trying to write one, which I was never happy with) - it is excellent for simple HUD elements however, and simple to do one-off controls.

share|improve this answer
I had my first experience of IMGUI recently, and felt that it was a big backwards step. As you say, it's great for a simple HUD or a static toolbar, but pretty awful for anything dynamic, hostile to having artists or designers create layouts, and coerces you towards munging presentation and logic code together in one place. – Kylotan Feb 22 '11 at 16:57
-1. I get the feeling that CEGUI is popular only because it exists and people mention it as a default goto (like this). When I used it, I found it awkward and extremely clunky. – bobobobo Sep 8 '11 at 4:19
@bobobobo Agreed. It's popular because it exists. It is the "official" gui for ogre (whatever that means) but I find it quite cumbersome to code. Also, the RAD gui builder is way buggy (still in development). – cheshirekow Jul 12 '12 at 21:36

I recently stumbled across Gwen. It's a GUI library written by the author of Gary's Mod. It's MIT licensed as any good game library should be.
Gwen logo
The library has several things going for it.

  • Large widget set
    Gwen has been under development for a few years and it shows.
  • Easy backend renderer customization
    This is a big one. The library comes with an OpenGL renderer rebuilt. But making a renderer is simple enough that you'll likely want to build a renderer specific to your game's render system.
  • Less filling
    Gwen seems to be on the lighter side of game GUI's. No XML, no HTML renderer, just simple C++. Gwen doesn't ship with image loaders either. It expects the renderer backend to handle loading. I like this feature as it keeps the library small and my game's render system already manages textures.
  • Skinable
    Not the first thing in your milestones but eventually you'll need to customize your GUI to your game.
  • C++ skinning
    I'm not a web developer and find the html css centric GUIs difficult.
  • Input injection
    This is big for games. It's always a pain to use GUI systems that want to own the input polling.
  • cross-platform
    The library strives to be cross platform but they admit that you may find problems on less used platforms.
  • actively developed
    Further, it's much smaller than CEGUI or MyGUI so hacking on it or submitting patches is much more practical.

However, here are the cons for it:

  • There's not a single page of documentation. Not even a website anymore, just the github repo.
  • The packaged renderers lack portability, so you'll need to write your own in case you need it.
  • ???
share|improve this answer
Lacks documentation, not portable (yet), opengl back-end unfinished, etc. Couldn't figure from online materials whether it has file io dialogs (or dialogs at all, for that matter). – Jari Komppa Feb 24 '11 at 5:59
I agree the documentation is lacking. The core library is cross-platform. However the renderer and input systems are lacking for other platforms. For me that's not an issue as I built a renderer tailored to me render system. – deft_code Feb 24 '11 at 20:58
Not having xaml/html/css is not a plus that's for sure. That's what these things were made for and they do it much better than C++ can. – user441521 Apr 1 '15 at 16:44

Sorry for the late reply, but you may want to take a look at an OpenGL UI framework called GG. GG was developed as part of the FreeOrion project and is included in their SVN repository (and their downloadable SDK). It seems pretty capable. I've included a screenshot below; you can click the image to view the full version.

Screenshot of FreeOrion's GG-based UI

share|improve this answer
It looks like GG is moved to a separate project gigi on sourceforge. – deft_code Oct 11 '10 at 19:46
Wouldn't surprise me. They intentionally kept it decoupled from FreeOrion. – Mike Strobel Oct 13 '10 at 17:45
I just spent an entire evening on it and it really, really needs a CMake file. I like the look and feel, I don't like that it uses Boost. – knight666 Feb 19 '11 at 0:33
GG can be found here: – Byte56 Apr 2 '13 at 21:43
Good luck getting that to build under windows. – David Lively Mar 22 '14 at 20:21

MyGUI is a rather good solution for both DirectX and OpenGL.

share|improve this answer

Have a look at AntTweakBar, it's being used by Cinder. There is also a new GUI library developed for Cinder in the works: SimpleGUI.

If you want to go HTML+CSS there is Awesomium (used by Wolfire Games in their Overgrowth game) and a free alternative called Berkelium.

share|improve this answer
AntTweakBar is awesome, but rather limited. It's great for what it's designed for - tweaking values and extremely simple integration - but not useful as a generic UI toolkit. – Jari Komppa Feb 20 '11 at 18:13

I've been fiddling with both QuickGUI and MyGUI. They're both Ogre GUI libraries that recent dropped the ogre requirement. I don't have too much experience with either yet, but it looks like I'll be sticking with QuickGUI, as it is much smaller and simpler.

I'm not sure if the QuickGUI wiki has been updated yet to point to the newest Ogre-free version. Here is the latest release.

There repo has seen a few cross-platform updates, so you'll be better off using the svn directly.

Username: Anonymous
Password: QuickGUI

Lastly here is the brief wiki on how to add diferent rendering backends.

MyGUI seems to have more features at the cost of getting bloated. And honestly if simplicity isn't a requirement CEGUI blows MyGUI out of the water.

share|improve this answer
I tried MyGUI and it's indeed extremely bloated, don't really recommend it if you want to save up space. Still fiddling to get QuickGUI to work. – Cristina Oct 11 '10 at 18:41
I have tried both, used CEGUI for the longest time but it was absolutely horrendous not to mention extremely slow with lots of text. I switched to MyGUI recently, and it has been working out nicely. Their layout and skin editors are very very neat. I am not sure about the bloat, I think CEGUI is vastly bloated in comparison. Some of the practices in MyGUI are weird (for example, += operator for assigning delegates, and casting is done in a weird fashion as well - the authors are actively developing it and listening to suggestions which is great) but overall I prefer it over CEGUI. – Samaursa Feb 23 '11 at 7:11
@Samaursa += operator means you can add more than one delegate. – Ocelot Aug 19 '15 at 16:49

I would recommend QT, as it's cross platform, C++ and you can get an Open Source version of it with the LGPL license. It's also easy to use and have a lot of pre-made components you can use.

share|improve this answer
Don't think that is an OpenGL based UI. – DeadMG Feb 18 '11 at 15:42
It doesn't say it should be OpenGL based, or am I misunderstanding the question completely? I read it as he wan't something to take over for freeGLUT, which QT is more than capable of. – martiert Feb 18 '11 at 15:52
I'd second this! I use qt and it has almost everything one needs when they are starting. Over the years it has become very stable, with a good support. They also have a framework for games called gluon. – brainydexter Feb 18 '11 at 16:22
The problem with QT and frameworks in general is they control the main loop. That is usually does not lend itself well games. – deft_code Feb 18 '11 at 19:07
If the UI isn't OpenGL, then I recommend getting rid of the main loop, using event based UI and events and timers for the game + graphics. Anyway, I've used QT and I do not recommend it. – Danny Varod Feb 23 '11 at 19:24

The creators may shoot me for saying so, but I found GLFW to be just awesome at creating cross-platform GUI frameworks. The GLFW development folks go on and on about GLFW does not handle GUI. It does however do a nice, simple, clean and totally portable job of handling graphics, events and mouse/keyboard/joystick tasks.

The nice thing about GLFW for me is that it is fairly small, requires no system specific code, no GLUT and is well maintained. Has been stable for use on OpenGL 4.1 projects so far. Compared to something like SDL I love the tiny overhead and it was easy as pie to write GUI handler classes.

Alternatively, take a look at FLTK. It can be used for all sorts of things and re-purposed very simply. It is used really for application building but is perfectly capable of handling 3D objects and is built on OpenGL. Very small, well supported and while I don't see many people making custom interfaces on the game design level, there are some that seem to work great.

share|improve this answer

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