Best way to make an GUI or HUD overlay?

Hey coders, I am tyring to add a GUI to my game but I don’t know how to draw things with a 2d cordinate system that is not affected by gluLookAt. I think I need to use glOrtho but have not had any luck yet.

You will have to push projection matrix, set it to identity, set a glortho projection, push modelview matrix, set it to identity.
Then draw your hud.
Then pop both modelview and projection matrices to go back to your normal 3D projection.

Search the web for “opengl 2D hud” should give you exact code to use if you are still lost.

Sweet! That got me moving again.

you could also take a look here, for some more light into ortho and viewport :smiley:

http://www.opengl.org/discussion_boards/…0728#Post270728