PDA

View Full Version : GUI in OpenGL



Sarah22
05-22-2009, 03:07 AM
Anyone here has an idea how to do it? I've searched the internet but never found one good tutorial. I've used some GUI libraries on some games that's I've made in the past but I want to learn how it is done. Buttons, checkbox, radiobutton, and etc. I might include it also on my homemade 3D game engine after learning it.

Sanctus
05-22-2009, 03:24 AM
I've done this some times before. You use a orthographics porjection and just draw 2D graphics that resembles GUI. Also use some methods like Draw and Update(for user interaction).

Sarah22
05-22-2009, 10:54 AM
Oh, is that it? I've done that many times. I thought there could be any other way? Like using windows buttons then inject it in opengl. lol

Brolingstanz
05-22-2009, 11:28 AM
Some fine suggestions in this thread

http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252403#Post252403

doublejay
05-22-2009, 03:05 PM
I create a GUI entirely in OpenGL. It is not open source however. Sorry!
Take a look at GLUI it is a simple one and it will give you a good idea.
I created an OpenGL GUI because I wanted some unique application interfaces. I started by drawing rectangles and capturing mouse events. One thing leading to another, I ended up whis this:
http://www.inalogic.com/MainSite/component/content/article/1-graphics/33-lighting-shaders
It may not be the kind of GUI you are looking for but at least it shows that you can take a GUI system in OpenGL as far as you like.

_NK47
05-28-2009, 09:10 AM
found this recently: http://libufo.sourceforge.net/
im doing basic GUI myself as well but i see no point in reimplementing the wheel and to catch up to (in this example) libUFO or any other package.

marek-knows.com
06-07-2009, 06:39 AM
I have also created a generic OpenGL GUI framework that I use with my games. I have video tutorials on my website showing step-by-step how to recreate it.