Jump to content
  • Advertisement

Archived

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

CrackMonkeyT

GUI help.

This topic is 5534 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
There''s a nice series on developing a game GUI in the articles section: Developing a GUI Using C++ and DirectX. You should be able to learn a lot from it despite the title, it presents the concepts in a nice way, and the method for rendering is rather irrelevant as long as you understand those.

Good luck!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!