views:

723

answers:

12

Could someone recommend any good resources for creating Graphics User Interfaces, preferably in C/C++?

Currently my biggest influence is 3DBuzz.com's C++/OpenGL VTMs (Video Training Modules). While they are very good, they cover a large area of graphics programming, so only skim the surface of GUI programming.

This question does relate to "How do I make a GUI?", where there is also a rough outline of my current structure.

Any response would be appreciated.

thing2k

Edit: I've just read some of the answers and spotted that I've missed some points. I had to type the question twice as I caught the wrong button and lost it.

I missed two important points, first: This will be used cross platform including homebrew on a Sony PSP. Second: I want to create a GUI system not use an existing one.

Edit 2: I think some of you are missing the point, I don't what to use an existing GUI system I want to build one.

Qt in it's current form is not portable to the PSP, never mind the overkill of such a task.

That said I've decided to create an IM-GUI, and have started to prototype the code.

+1  A: 

Have a look at Qt. It is an open source library for making GUI's. Unlike Swing in Java, it assumes a lot of stuff, so it is really easy to make functional GUI's. For example, a textarea assumes that you want a context menu when you right click it with copy, paste, select all, etc. The documentation is also very good.

Marius
+1  A: 

http://www.fox-toolkit.org has an API reference, if you're looking how to work with a specific framework. Or were you more interested in general theory or something more along the lines of how to do the low-level stuff yourself?

Brian Warshaw
+2  A: 

I wouldn't use OpenGL for the GUI unless you are planning for hardware accelerated and/or 3D effects that you don't think you would get with a more traditional GUI toolkit (e.g Qt, wxWidgets, GTK, etc). If you just need a quick simple GUI for hosting your OpenGL graphics then FLTK is a nice choice. Otherwise, for rendering the GUI directly in OpenGL their are libraries like Crazy Eddie's GUI that do just that and provide lots of skinnable widgets that you won't have to reinvent. The window and OpenGL context could then be provide with a portable library like SDL.

EDIT: Now that I've gone back and taken at look your other post I think I have a better understanding of what you are asking. For a GUI on an embedded system like the Nintendo DS, I would consider using an "immediate mode" GUI. Jari Komppa has a good tutorial about them, but you could use a more object-oriented approach with C++ than the C code he presents.

Judge Maygarden
+1  A: 

First I want to thank monjardin for his answer and I'm trying to have a look at the link posted, unfortunately the sites not available.

Also thanks to Brian Warshaw for the link to fox-toolkit. While it might not be possible to port it to the psp, it does look very good I might make use of it for other projects.

As for Marius and CoreyN, thank you for the response, though I am sorry for not making my question clearer.

Thanks for the responses so far.

thing2k

thing2k
+1  A: 

For more information about "immediate mode" GUI, I can recommend the Molly Rocket forums. There's a good video presentation of the thinking behind IM-GUI, along with lots of discussion.

I recently hacked together a very quick IM-GUI system based on presentation on Jari's page, and in my case, where I really just wanted to be able to get a couple of buttons and boxes on the screen, and more or less just hard code the response to the inputs, it really felt like the right thing to do, instead of going for a more full blown GUI-architecture. (This was in a DirectX-application, so the number of choices I had was pretty limited).

A: 

Thanks dooz, unfortunately the video was no longer available from the, but I've managed to find it through google downloading now.

When I have chance to give it a look.

Cheers

thing2k

thing2k
A: 

I'll second Qt. It's cross platform, and I found it much easier to work with than the built in Visual Studio GUI stuff. It's dual-licensed, so if you don't want your code to be GPL you could purchase a license instead.

Herms
A: 

I've had a look at the Video from Molley Rocket and Looked through Jari Komppa's cached tutorials.

An IM-GUI seems the best way to go, I think it will be a lot more streamlined, and lot quicker to build than the system I originally had in mind.

Now a new issue, I can only except one Answer. :(

Thanks again to Monjardin and dooz, cheers.

thing2k

thing2k
A: 

I'd have a look at GLAM and GLGooey

epatel
A: 

One of the fastest ways is to use python with a gui binding like pyQt, PyFLTK, tkinter, wxPython or even via pygame which uses SDL.

Its easy fast and platform independent. Also the management of the packages is unbeatable.

See:

Sven Hecht
+1  A: 

For a platform like the PSP, I'd worry slightly about the performance of an IM GUI solution. With a traditional retained mode type of solution, when you create a control, you can also create the vertex buffer/display list or what-have-you required to render it. With an immediate mode solution, it seems to me that you'd need to recreate this dynamically each frame.

You might not care about this, if you're only doing a few buttons, or it's not going to be used in-game (assuming you're making a game) but, especially if you have a fair bit of text, the cost of rendering might start to hurt if you can't find a way to cache the display lists somehow.

James Sutherland
A: 

@James

You're probably right about the performance hit of IM GUIs, but as it's will be mainly used in menus and very rarly in game it shouldn't be too much of an issue.

I've already consided a few modifications that should help with rendering speed.

Cheers

thing2k

thing2k