views:

6924

answers:

8

It must come with source. I've looked at these which look semi-promising:

glgooey, guichan, and cegui. I've come across others that look more Windows-y than game-y, but that's not the direction I am looking to go in.

I would like some simple functionality of typical controls (lists, dropdown box, etc.) but with support for graphical widgets that you would normally find in game frontends. Mouse clicking, dragging, dropping, etc. and sound effect hooks would be nice. (These libs often leave hooks for the external system to tell it when/where mouse events are occurring.)

It would get rendered on top of what my own 3D engine is rendering for the game, so it must be able to play nicely with rendering code outside of the lib.

The best criteria is whether or not a reasonable 2D game could be implemented just with the GUI library and minimal glue code. (By glue code, I mean init code, hooking up the mouse, and game logic.) I am creating a 3D game, but this criteria gives a pretty solid idea of what level of interactivity I would like in the GUI.

+4  A: 

We are using CEGUI, but I can't say I'm all that impressed. It's so complex that it is difficult to debug, even for simple things.

If you're willing to pay for a GUI library I've heard good things about Scaleform. It runs on most platforms and is an accelerated runtime for Flash that you can embed in your 3D engine. I haven't actually used it yet, but I intend to evaluate it as a CEGUI replacement.

Joe Ludwig
A: 

I've used pyOpenGL, which works for wherever python works and wherever the pyOpenGL bindings have been ported to.

Claudiu
Not a GUI library
Stefan Monov
oops, didn't read the qwuestion
Claudiu
+1  A: 

As of one of the latest versions, QT can do OpenGL widgets almost seamlessly the same why it does normal widgets.
Check out this article:
The sources are available directly from here:
svn://labs.trolltech.com/svn/graphics/dojo/modelviewer

Ofcourse QT is released as open source and it also has quite an extensive support for 2D drawing using QPainter, which can also paint on OpenGL.

shoosh
A: 

If Python is an acceptable language, PyGame sounds like a good fit. As the name suggests, it was made for game development.

Oddthinking
is it so much a GUI library?
gatoatigrado
What's your definition of GUI library?It supports displays and fonts and rectangles and shape-drawing and sprites and other graphics concepts. It supports mouse and keyboard events, and other inputs. So, yes, it is a GUI library.Hmmmm.. perhaps it doesn't have enough support for drop-down menus and list boxes and the like, though. Is that your concern?
Oddthinking
Yes, widgets make it usable for GUIs as I think of them (I think the author was referring to form GUIs), and perhaps more centrally, a GUI library usually has layout routines, to e.g. fit everything nicely when the window, resolution, etc. changes.
gatoatigrado
+2  A: 

I used GLui for this little demo:

HexPlanet

It works well for little interfaces but I wouldn't recommend it for a large game.

Shy's suggestion about Qt is very good. It would be perfect for a game editor but it may be difficult to style it for an in-game gui, and it's still kind of experimental.

I'd recommend looking into RBG Gui which is a similar to CeGUI. It's very nice looking, and has a full widget set. However, the sample implementation is build on OGRE, you'd have to write a pure OpenGL backend, but that doesn't look to hard because the underlying support code is separated out and written with this kind of thing in mind, most of the gui system is render-system agnostic.

A: 

How about:

http://glfw.sourceforge.net

Hmm, it looks like it's just a GLUT replacement, not an actual GUI library.
Jim Buck
Not a GUI library.
Nick
A: 

Supposedly Scaleform now includes a complete UI framework named Scaleform CLIK, which can be used for both game and 3d application UI development. They even provide a sample App Kit that shows how to use CLIK for OpenGL and D3D desktop apps.

Having the UI layer based in Flash with direct binding from C++ is super powerful, as it allows your artists to create beautifully animated Flash UI while your programmers handle layout and data population. You can even add 3D animation effects and tilting to the UI if you use the Scaleform/Flash solution.

Good luck!

max
+2  A: 

I second Qt as recommended in another answer. You can use a combination of QWidget, QGraphicItem, QGLWidget, QTimeLine, the QtAnimation framework, and QStyle, depending on the specific things you need. For example, if all you need is a plain setup/launch UI that's not integrated with the game content, you can get away with simple QWidget+CSS programming. Otherwise you may wish to integrate fancy QGraphicItems into your QGLWidget, and animate UI transitions with QTimeLine or QtAnimation.

Stefan Monov