Not logged in, Join Here! or Log In Below:  
News Articles Search    

Submitted by Niel Waldren, posted on November 28, 2001

Image Description, by Niel Waldren

This image shows screenshots from example applications using GLGooey, a collection of GUI components that we're going to be using in a forthcoming game. As the name suggests, GLGooey uses OpenGL and although the examples shown use GLUT, this is not a prerequisite - infact our game does not use GLUT. The fonts are rendered with the help of FreeType which is available from

The colors and fonts can be easily customized on both a global or per control level. The look and feel of the interface can also be customized by overloading window and event classes. As shown in the screen shots, it is possible to give the whole GUI any degree of transparency allowing a 3d scene in the background to show through. I've tried to keep the project platform independent which means that a bit of work has to be done to integrate GLGooey into an existing project (see the documentation for more info).

There's still some work to be done: Basic things like exposing the ability to customize colors and fonts to the application (at the moment it has to be done within an overloaded Window class), aswell as more complex issues such as implementing further controls and a good dose of optimization. But, basically the project is up and running so I thought I'd make it available. The source code for the entire project along with project files for MSVC++, a couple of examples and documentation can be downloaded from Executables for the examples can be found in the samples folder.

Coming soon: The game itself is making good progress, so watch this space for screenshots :-)

Image of the Day Gallery


Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

November 28, 2001, 01:32 PM

very nice interface indeed :) needs a bit of antialiasing around the edges though...

i hope you can manipulate them as perspective 3d objects (ie. make them fly off when you click ok ;)


November 28, 2001, 01:45 PM

Indeed a very nice user interface you got there.

Checking out the website now ...



November 28, 2001, 01:47 PM

Looks fine.
I think it would be cool to use it for making GUIs for platform independant content creation tools in OpenGL (I think we had a topic about platform dependant controls/GUIs vs. custom ones in OpenGL. Having a standard library for OpenGL dealing with stuff like text boxes, list views etc. in graphic mode would be cool... :)


November 28, 2001, 02:22 PM

Reminds me of a discussions I had once. Someone should have done TK for OpenGL a long time ago. It would reduce the number of platforms to support :-) I raises another question: Should the bottom level of the display be 3D or 2D? There's no reason you couldn't have all windows be 3D objects with a texture map on the front :-) Imagine X drawing into texture memory...


November 28, 2001, 03:27 PM

Looks great

Can i use it for my engine?

Have fun



November 28, 2001, 03:57 PM

Looks very nice. I am also working on a GUI system for DirectX, and it doesnt like quite as nice as yours =). I havent gotten an editbox going yet, or a check box. I really like those scroll bars, though. Is the behavior similar to windows(clickable scroll buttons, draggable thumb, and clickable background box thing)?

Also, how are events handled? MouseClicks, Moves, etc? Do you have MouseOn and MouseOut support? Is it possible to change the behavior of a window without changing the class (a la Windows)?

I think maybe I should get back to work on my own system =).



November 28, 2001, 04:15 PM

AWESOME !! 51 FPS !!
did you do this all in your spare time ?!


November 28, 2001, 04:58 PM

Lycium: thnx - anti-aliasing and perspective - good points :-)

Bunnz: use it for whatever you like

Zaei: clickable scroll buttons, draggable thumb, and clickable background box thing are all there. Download it and try it out, the source code may interest you if you're implementing something similar.
Events are handled via event classes and event handler classes. For instance all the mouse events you mentioned are implemented and are used by deriving a class from MouseHandler and then overloading the provided methods. Then the handler gets attached to the window class. If you're prepared to use multiple inheritance you can even make the window class itself do the handling if you want. Looks something like this:

class MyWindow : public Window, public MouseHandler
virtual MouseHandler& clicked(MouseClickEvent& event)

virtual MouseHandler& entered(MouseEvent& event)

Then in the implementation for MyWindow's constructor you would make the following call


Whenever a clicked or entered event hits MyWindow the members are called. If you're wondering how events are handled at OS level, it's easy - they're not! It's up to the user to pass system events on to Gooey's window manager - That's the integration work I mentioned in the image description. With GLUT, it's about 10 lines of code.

Kosh: :-)))


November 28, 2001, 05:21 PM

Nicely done! =). My scroll bar's thumb has always given me h*ll, trying to find the correct value to give the scroll bar.

For my events, I use the method Windows has chosen, by sending event messages to a queue, which is then processed every tick using a function pointer. Since the entire system is wrapped up into a DLL, I've chosen not to export the class definitions, so everything is referenced through handles. The regular Window class has just about everything you could want, and then the various controls are built from that base.

Keep up the good work!



November 28, 2001, 08:36 PM

easy looking learning interface.


November 28, 2001, 10:06 PM

i tried the examples and your guisystem looks very cool!
i also like the way you code, it looks quite professional
(i like to save people's project sources just to learn from their codestyle =))

i 've heard of the freenet project but i never considered to use it for my own projects... thx for the tip ;-)

maybe you know it already, but there's a small bug in the scrolling behavior
for example in example2.exe
take the listcontrol window
the first time you scroll a window at a time down, it is ok : row nr5 is the first visible row
the second time you scroll a window at a time down, row nr11 is the first visible row instead of row nr10
it's a detail :)


Lion V

November 28, 2001, 11:30 PM

Nice !

A good gui is essential for a truly sleek game.



November 29, 2001, 03:39 AM

You got a cursor to go with the interface? =)


November 29, 2001, 04:47 AM

Mattie: thanks for spotting the bug - I hadn't noticed :-(

Herr_O: Cursors are TODO :-)


November 29, 2001, 05:10 AM

Nice looking stuff. Are you drawing everything each frame or are you using some of the standard tricks to clip windows? For games, redrawing the GUI every frame is often acceptable as the background image is likely to change all the time and the windows are often translucent; however, for almost all other applications, you really don't want to do that and looking into some sort of clipping method and not redrawing everything each frame is vital. This gets a bit hairy when trying to do translucency but it's still doable.
The windowing system I've written doesn't use openGL (it's all 2d blits and draws although this could be altered very easily) but I did manage to make it run on the PlayStation2 so it's fairly portable :)



November 29, 2001, 06:43 AM

Great GUI.
I'm planning on using it for my Major Qualifying Project to help display and control the graphics engine.

Do you need help porting this to Linux/Unix ?

William Dahlberg

November 29, 2001, 08:31 AM

Nifty GUI!

What type of game is the one that you're going to use the GUI in?


November 29, 2001, 08:59 AM

luther2k: Gooey was conceived for games showing OpenGL scenes in the background which require constant updating, so at the moment I just update every frame, but maybe I'll get round to having only necessary bits updated when necessary - someday?-)

dabion: I won't be porting this to linux/unix myself in the near future, but I reckon a port should be pretty straightforward, so if you want to give it a try feel free. Just send me a mail if any difficulties crop up and I'll be glad to help where I can.

william: it's a definitely some form of 3d shooter, but with a heavy lean towards early eighties arcade stuff, plenty of goodies, power-ups, strange alien spacecraft and huge high-scores. When we post the first screenshots there'll be more info ;-)

This thread contains 18 messages.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.