Jump to content
  • Advertisement
Sign in to follow this  
Dabacle

GUI Display

This topic is 4954 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

Hi guys! I've tried to draw my GUI using the usual glBegin() glEnd() and glVertex3f() stuff. I was wondering if there is a better way to keep the GUI information facing the screen and to draw all pixels (child objects over parents) without depth testing? I've tried disabling the depth test but that doesn't seem to work... also I've set my alpha value but does this work for purely colored quads or only textured? Even when I turn on blending and set the blendFunc I still can't get it to look right. I just want to make sure I'm doing the right things for the GUI I'm designing. Right now the class structure is pretty well set up so I'm just trying to implement the Drawing functions... Thanks! Dave

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Disabling the depth test should work fine. What exactly do you mean when you say it "doesn't seem to work"?

--cfmdobbie

Share this post


Link to post
Share on other sites
Disabling depth testing should keep the GUI window on top of everything else. If your problem is that the GUI windows get translated/rotated with the camera, you simply need to draw the GUI before any of that takes place. If that's not the problem, give us a bit more as to what is going wrong.

Good luck!

EDIT:
Oh yeah and I assume you're pushing and popping all your translations on to a new matrix each frame via glPushMatrix() and glPopMatrix()? That'd definitely cause you some problems if you're not.

Share this post


Link to post
Share on other sites
Hi! Sorry for the vague post but that information you guys gave me works fine. I was just curious if there are other commands to draw to a screen using 2D coordinates while using 3D coordinates for everything else. No actually I didn't push my translation matrix each frame... I'll try that now! What I meant by "doesn't seem to work" was that if I had all of my GUI translated to say glTranslatef(0.0f, 0.0f, -10.0f) I would have to add offsets to each child to move it closer to the camera to be able to see it. I just messed around with the order I was drawing my GUI objects and it works... I was an idiot and I was drawing things out of order.

Again I'm sorry for being vague...

Thanks a lot for the help guys! :)
Dabacle

Share this post


Link to post
Share on other sites
Glad you got your GUI working. What I was proposing is likely what you did, move the translations/rotations to after the GUI is called. The push and pop of the modelview stack was so that the translations of the previous frame were not added to the matrix of the present one (and so on and so forth). But, as it seems to be working for you, I wouldn't worry about it.

Have fun!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!