Slashdot Mirror


OpenGL Widget Set Recommendations?

rrwood asks: "I'm starting work on what is more or less an open-source 3D modeling application, and I'd like to make it as cross-platform as possible (Linux, FreeBSD, Windows, MacOS, etc.). OpenGL takes care of the 3D rendering I'm going to need, but I also need some sort of widget set, and I'm looking for advice as to what to use in that regard. I've done my Google homework and have come up with the following, but would like feedback from anyone who has already used any of these, or has recommendations about anything I may have missed. Yes, I know about Blender, and be reassured I am not planning on reinventing that wheel, okay? :-) So, here's what I've found so far. As I said, if anyone can add to this list or share his/her experiences actually working with any of these, that would be greatly appreciated."

"GLUI provides a flexible windowing system and a rich selection of widgets (buttons, checkboxes, radio button sets, spinners, text boxes, arcballs, dividers, packing panels, packing columns, etc.). GLUI's design is very straightforward, and the docs and examples are extremely well done. GLUI is highly portable, since it depends only on OpenGL and Glut.

GLOW is 'a cross-platform object-oriented framework for building interactive applications using OpenGL or similar APIs such as Mesa.' GLOW is basically an elegant C++ wrapper around Glut, providing push buttons, check boxes, radio buttons, scroll bars, sliders, text fields, menus, etc. This is a really nice description of GLOW, including comparisons to GLUI and MUI.

Speaking of MUI, Steve Baker's advice is basically 'just don't.' Instead, Steve recommends PUI, which he wrote. :) Actually, he speaks very highly of GLUI, and does a nice job of pointing out the subtle differences between GLUI and PUI.

PUI is part of PLIB, a rich and vibrant set of libraries for cross-platform game development. This is a wonderful intro to PUI. Go read it right now. Really. PUI itself does all the sorts of stuff I'm looking for, and perhaps more. It looks to be very stable and mature, too.

LibUFO is a C++ widget set for OpenGL, currently in alpha. Features include pluggable look and feel, theme support, and layout manager support. LibUFO can be used with GLUT, SDL or any native GL context, so it is highly portable, too. Except for the fact that this is only alpha code at this point, it looks quite nice.

FOX is a C++ toolkit for developing cross-platform GUI apps. It seems like a fairly standard C++ framework, with built-in OpenGL widgets, too. By all accounts, FOX is quite mature and stable, with a fairly active developer base. FOX supports many OSes, but not, unfortunately, the Mac. And yes, I could easily hack out Mac support myself, but I don't want to do that-- I want to write my app.

FLTK is another cross-platform C++ GUI toolkit with OpenGL support. The advantage of FLTK over FOX is that FLTK supports MacOS X (not 9.x and earlier-- too bad).

DirectFB is a library built on top of a framebuffer device such as the Linux framebuffer or SDL. There seems to be some 3D support in there via DirectFBGL, though the docs say that there is no hardware acceleration support (i.e. Mesa vs OpenGL). The thing that makes DirectFB particularly attractive is the fact that Gtk/Gdk has been ported to it.

SDL and ParaGUI are also an attractive option. SDL is insanely portable, and ParaGUI is a wonderful GUI/widget toolkit that runs on top of SDL. You really need to see the ParaGUI demos running to appreciate how slick it is. The screenshots are nice and all, but they don't do it justice. As well, ParaGUI is really slick in its support for themes, XML, and Python.

PicoGUI was a recent SlashDotting victim. As mentioned at that time, PicoGUI is actually a sophisticated client-server framework, capable of running in a wide variety of environments, including on top of OpenGL. There is plenty of info at the PicoGUI FAQ, including a few comments that suggest it would be a perfectly reasonable choice for what I'm looking at doing. Given the scope of what PicoGUI is trying to achieve, I'm a little nervous that it might be overkill for what I want to do.

Fresco is another client-server framework which some may have previously known as Berlin. Fresco seems very cool, but again, I suspect it is overkill for what I'm doing.

The GUI Toolkit/Framework Page is also an excellent resource for cross-platform development of all stripes.

And the OpenGL Toolkit FAQ is also an excellent resource with special emphasis on OpenGL."

15 of 154 comments (clear)

  1. Additional requirement - Widgets on textures! by kbonin · · Score: 4, Interesting

    I'd throw out an additional requirement for an ideal OpenGL GUI library, one that's lead me to start developing my own (It'll be open source when done.)

    It'd be nice if a cross-platform widget/GUI library existed that would allow me to place the GUI's into the environment, by rendering to textures or virtual GUI planes, instead of just as yet another 2d desktop library. Its not TOO much additional work if done from the beginning...

    Think of the fun you could have w/ full GUI support in the environment. A 3d embeddable Gecko control, anyone? :) (Wish that code was cleaner...)

  2. Portability by cbv · · Score: 4, Informative

    For your GUI, take a look at GNUstep. It supports Linux, the BSDs, Solaris and Windows and is (pretty much) compatible with Cocoa.

    For your 3D graphic stuff, take a look at the GNU 3DKit.

  3. wxWindows, FLTK by g4dget · · Score: 4, Interesting
    If your needs are modest, you might want to use FLTK. It's simple and you can link with it statically. If you need a full-blown widget set, wxWindows is a good choice. Both of them let you embed OpenGL windows inside the GUI. They are not implemented using OpenGL as the graphics layer, however: they use whatever native GUI there is and embedd OpenGL windows.

    I would recommend against using widget sets with OpenGL as a graphics layer unless you really need it: OpenGL is less than ideal for that purpose.

    1. Re:wxWindows, FLTK by ikoleverhate · · Score: 4, Interesting

      Worth pointing out that FLTK not only lets you have OpenGL windows inside it's windows, but that ALL it's widgets' draw functions can contain OpenGL code (whether a specific OpenGL widget or not). This means you can have lit and textured buttons for example, and have the mouse pointer as a light source. ;)

      I'm not sure if any of the others do the same as I have never used them.

    2. Re:wxWindows, FLTK by JFMulder · · Score: 3, Insightful

      I guess it would have to do with the fact that 99% of the time you work in double buffering mode. So a click on a button in the interface will mean you'll have to do an entire redraw of the window, and that is really slow. You have do redrawyour whole desktop, than flip buffers. One cool hack tought would be to always write your UI modifications on the front buffer, but it would be hell to keep track of everything that is under the pop ups. OS widgets are fast : the changes when you interact with a widget are local and don't demand a whole screen redraw, since they work in single buffer environment.

  4. Re:WxWindows by watzinaneihm · · Score: 4, Informative

    Be careful about threading in wxWindows. About 6 months back I had to write a program using wxWindows and the threading gave me some problems.Most of those libraries are being improved AFAIK
    Also worry about memory leaks. I am not sure If the code I wrote was leaking it or whether it was wxWindows, but hte programs did leak gallons of memory.
    Not that I am an authority on wxWindows, or that it is a bad library, just a warning. Maybe some other readers have had experiences?

    --
    .ACMD setaloiv siht gnidaeR
  5. Qt by Sesse · · Score: 3, Informative

    You definitely forgot Qt. The only downside is that it's commercial on Win32 (unless you're running MSVC6), apart from that it does its job very well, and has a very reasonable OpenGL widget.

    As for wxWindows (which others have suggested), I tried it some time ago and I think it truly sucked. Hopefully it has improved since then :-)

    /* Steinar */

    --
    (This comment is of course GPLed.)
    1. Re:Qt by Dominic_Mazzoni · · Score: 3, Informative

      As for wxWindows (which others have suggested), I tried it some time ago and I think it truly sucked. Hopefully it has improved since then :-)

      How long ago did you try wxWindows? If it was before 2.0, I can forgive you, but especially since version 2.2, wxWindows completely rocks.

      wxWindows provides native widgets on more platforms than any other toolkit (Windows, Mac OS 9, Mac OS X, Unix/GTK, plus wxUniversal which gives you themable widgets based on extremely low-level interfaces such as pure X11 or a PDA's framebuffer).

      It's closely modeled after the most widely-used GUI toolkit in existence (MFC) yet it deviates from the MFC model when necessary to make it more consistent, more flexible, or easier to use. What this means is that it's reasonably easy for anyone to pick up, but doubly easy for anyone who's used another modern C++ GUI toolkit like MFC, PowerPlant, or Qt.

      wxWindows has more utility classes than just about any other toolkit I've seen, too: check out their list of classes. One thing I love about wxWindows is that it goes beyond the least common denominator, and in fact makes it easy to take advantage of platform-specific features when you want to: for example setting the X Display of a window you pop up in X11, changing the Taskbar icon of a window in Windows, or setting the type/creator of a file on the Mac. Oh yes, and it has a perfectly decent OpenGL widget, too.

      wxWindows is also not limited to C++ - it works well from Python, too...

      Finally, the wxWindows developer and user communities are very helpful.

  6. Cross platform widgets are BAD by JFMulder · · Score: 5, Interesting

    Of course, from a technological angle, cross-platform widgets (we'll call them CPW from now on) are an elegant solution. Design your UI once, and you're done. This seem like A Good Thing.

    The problem with CPW is that it gives more time to the user to adapt to your widgets. Of course, one can argue that once you can use the widgets in one environment, you can use them everywhere. That is true. The problem is that not all your users are as good with computers as you are, and it may put an extra strain on the user to learn between the basics of your system and the host OS. How do you drag and drop? How do you move around windows? What happens when you double click on the top? Does it maximise? Does it roll up just to show the title bar?

    Take a clue from the major players in the industry. From what I've heard, Adobe updated PhotoShop to give it the Mac OS X look and feel by using it's native widgets. Many companies are now making wrappers around existing library calls, instead of making widgets. That way you have a unified API for all your supported platforms to design your UI on, but also have the advantage of keeping the usual behaviour and look and feel of an application.


    Sadly, I don't know of any public library that accomplishes this. But I'm sure that if you looked around enough, you should be able to find a few.


    Good luck!
    1. Re:Cross platform widgets are BAD by Hanji · · Score: 4, Informative

      wxWindows
      It does exactly what you describe. It provides a single API, that, when linked with the appropriate platform's libs, creates the GUI using that platforms GUI.

      --
      A Minesweeper clone that doesn't suck
  7. Togl (also check out ayam3d) by BLAG-blast · · Score: 3, Interesting
    Hey,

    You might want to take a look at Togl

    It's a Tcl/Tk widget, it's pretty friendly and cross platform. There are a couple of 3D modellers using Togl. One of them is called Ayam3d (it's kind of like Maya but not, it's also open source). AC3D is the other modeller I know using Togl, and it's shareware.

    --
    M0571y H@rml355.
  8. I'm confused. by NFW · · Score: 3, Insightful

    Do you want a GUI toolkit that will let you put windows and dialog boxes and such inside your GL render context, or... Do you want a GUI toolkit that will draw windows and dialog boxes and such on the destop, and which includes support for windows that host GL render contexts?

    --
    Build stuff. Stuff that walks, stuff that rolls, whatever.
  9. Use GTK+ 2.x by MrMeanie · · Score: 3, Informative

    I have done some OpenGL work with GTK+.
    GTK+ does not support OpenGL out of the box, so to speak, but you can get a package called gtkglarea which adds an OpenGL widget.
    If you use GTK+ v1.2, then gtkglarea v1.2.x packages are easy to find and come with many distros (e.g. Redhat).
    However, I would recommend that you use GTK+ 2.x, since you are coding a new application, and GTK+ 2.x is much improved. There is no *official* version of gtkglarea for GTK+ 2.0 though. HOWEVER, you can get gtkglarea v1.99.0. Look on developer.gnome.org. I think.

    Links:
    Gnome ftp site
    Gnome ftp mirror

    GTK+'s main advantages are its maturity, its solid design, and its comprehensive selection of widgets. If your application is going to reach an appreciable size, then you will want a good widget set like GTK+.

    As a C++ programmer, I find GTK+'s reliance on vanilla C to be a little irritating, however, you can gtk GTK-- which is a C++ wrapper for it. I prefer to use GTK+ directly though, so I interface my C++ code with GTK+ by using static member functions for callbacks.

    Hope that helps


    Mr. Meanie

  10. I use Qt and the QGLWidget by MrDog · · Score: 3, Informative

    For my scientific visualization project, I use Qt and its QGLWidget for OpenGL vis. It features nice communication to other widgets, easy mouse event interception, and you can share display lists across multiple views. If you intend your app to be free, then they cost you nothing. I have used wxWindows and GTK before, and Qt is vastly superior in my opinion.

  11. Java AWT or Swing and Java 3D. by Randolpho · · Score: 3, Interesting

    No mentions of this combination yet, so I thought I'd drop one. If you want cross-platform compatibility, Java is the best way to go. Java 3d has a really good OGL set up as a Scene Graph API. Mix in AWT or Swing, and you've essentially got yourself an entire cross-platform system already set up.

    --
    "Times have not become more violent. They have just become more televised."
    -Marilyn Manson