Designing GUI in OpenGL

Started by
12 comments, last by Metus 22 years, 5 months ago
This topic came up on our local forum... heres the solution :

"Switch to glPerspective to draw your level then afterwards, change to glOrtho to draw the HUD, messages etc."

So you do so :

MainLoop
{
glPerspective();
DrawScene();
glOrtho();
DrawHub();
}

problem solved.....
pay us a visit : www.sagamedev.co.za
I burn cold
Advertisement
I''ve been trying to get this to work, but everytime i try it, it either complains that ortho doesnt take 4 paramaters, or that the main drawing function doesnt take 0 paramaters.
glOrtho doesn''t take 4 parameters... it takes 6:

left, right, bottom, top, near, and far clipping planes

gluOrtho2D takes 4 (IIRC, near and far are set to -1 and 1 respectively)
I think a GUI in perspective mode would be pretty cool, you could have your windows going into the screen as well!

Of course, you can still get some cool effects in ortho mode, my favorite is when opening/closing new windows, you can make them rotate in, or flip in, or fade in, or zoom in, or any of a number of effects. Heh, Windows XP eat your heart out!

codeka.com - Just click it.

This topic is closed to new replies.

Advertisement