Welcome to Luigi

New: Screenshots!

Luigi is a platform-independent native-D OpenGL-based GUI drawing library. Use it for drawing GUIs on top of your OpenGL window.

Luigi stresses ease of use over completeness. For instance there are no fancy list widgets or movable windows, and the widgets provided are fairly basic (Button, Checkbox, Slider, RadioButtons, TextField, etc). But adding a basic gui requires just a few lines of code. The use of Signals and Slots and D's features like delegates also make it easy to connect GUI actions to application behavior.

Other goals are flexibility and extensibility, which are achieved through use of abstract interfaces for key components of the system. The main interfaces are:

  • InputAdapter - abstracts the services provided by a windowing toolkit (e.g. GLFW, GLD, SDL, GLUT, Win32, wxD, etc. Adapters for the first three have been implemented.)
  • Theme - encapsulates all item drawing operations
  • Arranger - abstracts the arrangement of Widgets in the GUI (called Layout in other toolkits).
  • Font - abstracts the essential functionality required to render glyphs on the screen

Related Tools: In the C++ world Luigi is similar in purpose to GLUI, PUI, GlGooey, and CEGUI.


Luigi is still alpha, but if all you need is a few buttons or a slider, then it should be OK already.


API documentation generated from the source using DDoc can be browsed here.


Beta (widget set is limited, but ready to use)

Currently using Derelict for GL libraries. Would like to figure out some way to leave the choice of GL wrapper up to the user.

Currently have three concrete InputAdaptor implementations. They allow Luigi to be used with GLFW, GLD, or SDL. There are two Themes implemented, and you can see some screenshots of those.


I'd like to have a good data-target mechanism in place. Something that very easily lets you tie the value of a variable in your program to a value in the GUI. I think this is going to require a gui update mechanism, like the "update events" in wxWidgets and FOX. These get sent out either at idle time (wxWidgets), or upon user request (FOX). The idea is that each widget examines its state when it gets such a message, and if say the data value it's watching has changed, it updates itself accordingly. For the other direction, GUI affecting program variable, the signal and slot mechansim will do the trick.

Another thing that needs dealing with is idle-timers or time events.

Also double clicks are currently missing. That should be easy to add.

Of course I'd like more widgets and themes too, but each one takes a significant amount of time. Basically all the machinery needed to go to town writing new widgets and themes seems to be in place now. My priority for new widgets is: numeric spinner, dropdown listbox, radiobuttons, rollout (collapsible) panel, then maybe a 3D rotation ball like in GLUI.

Would like to make buttons able to show an image in addition to text. I'm thinking to do this by some sort of "drawable" interface. That is, make it so a button can have any "drawable" attached. This would basically have a get_rect() method and a draw() method. It's up to the user how that drawing gets done. One concrete drawable provided would be a bitmap image drawable.

Related D Projects

The Schooner project is creating utilities for OpenGL too. Namely GLD and font libraries. Luigi can already use GLD, and should be able to use Schooner's OpenGL font library once it's ready too.

Universal is another OpenGL-based GUI project.

MinWin is a GUI toolkit that wraps native widgets. Could be complementary to Luigi. It contains things like native dialogs that could be used along with Luigi (though MinWin is not set up to allow that sort of usage now).

Click here to go back to the master list of DSource Projects.