Original Post
🔒 Locked
HUD implementation
Advertisement
yes, and you might want to clear the depthbuffer before you start drawing your hud.
ok, everything is working fine
thxs for the help.
just have a little question regarding my code. I have a feeling there are some useless things in here.
//========================================================
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45.0f, width/height, 1.0f, 100.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
// draw 3D scene.
glPopMatrix();
glPushMatrix();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0f, width, 0.0f, height);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
// draw HUD.
glPopMatrix();
//========================================================
is this code correct (it seems to work fine) or are there some useless calls i am making ?
thxs again for all the help ^^
Jesus is coming! (look busy)
[edited by - casul on May 12, 2004 11:08:30 AM]
just have a little question regarding my code. I have a feeling there are some useless things in here.
//========================================================
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45.0f, width/height, 1.0f, 100.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
// draw 3D scene.
glPopMatrix();
glPushMatrix();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0f, width, 0.0f, height);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
// draw HUD.
glPopMatrix();
//========================================================
is this code correct (it seems to work fine) or are there some useless calls i am making ?
thxs again for all the help ^^
Jesus is coming! (look busy)
[edited by - casul on May 12, 2004 11:08:30 AM]
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement