Archived

This topic is now archived and is closed to further replies.

CrackMonkeyT

GUI help.

Recommended Posts

Hey everyone, I am in the process of making a 3d game, and parts of it (obviously) have to be in 2d, like the gui and hud over-lays, etc. How do I go about doing this? Are there any good tutorials on that sort of thing? I was thinking about using "billboards" and the regular mouse handler, but that seems in-efficiant to test where the mouse hit and check every pixel of every clickable object to figure out what the person wanted... Anyway if anyone has some insight, or links to tut''s, etc. That would be wonderful! Thanks in advance, peace, Me.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Render everything 3D with your ordinary perspective projection view, then switch to orthographic projectional view and draw some nice 2D bitmaps in screen coordinates, then switch back to perspective at the beginning of the render loop..

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/ntopnglo_0e0o.asp

Share this post


Link to post
Share on other sites
Thats exactly how I did it too. You can create a set of classes
CGuiElement and have everything derived from that base class, like buttons, list, static images, you name it.

I would suggest just using opengl immediate mode to draw to gui. It makes things easy and still fast since you dont have that much geometry to use.

Share this post


Link to post
Share on other sites
Thanx for the help. Does anyone have any example code or antying? I don''t know all that much about opengl (I''ve been using for about a month total, now) and example code is the quickest way for me personaly to learn things. Anything like that would be great. In the mean time I will google around for the things that you guys suggested.

Thanx again,
Me.

Share this post


Link to post
Share on other sites