MarsuGL
08-19-2001, 01:35 PM
Hello,
I want to have a bmp that fits exactly my windows, the pb is that the window is 640*480
and, i want my menu to be blended with the background and to be ALWAYS ON TOP, like if it was a 2d menu over a 3d background.
i need help with the kind of projection to use.
i've tried to convert a fontloader code but it don't works.
could you take a look, i'm sure that the error(s) will be as fat as..as.. as what ??
in this function i try to draw a quad that even not appears. (a placement error ?)
void test(void)
{
glColor3f(1.0,0.0,0.0);
glDisable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho(0,640,0,480,-100,100);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glTranslated(10,10,0);
glBegin(GL_QUADS);
glVertex3f(0.0,0.0,0.0);
glVertex3f(30.0,0.0,0.0);
glVertex3f(30.0,30.0,0.0);
glVertex3f(0.0,30.0,0.0);
glEnd();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glEnable(GL_DEPTH_TEST);
}
I want to have a bmp that fits exactly my windows, the pb is that the window is 640*480
and, i want my menu to be blended with the background and to be ALWAYS ON TOP, like if it was a 2d menu over a 3d background.
i need help with the kind of projection to use.
i've tried to convert a fontloader code but it don't works.
could you take a look, i'm sure that the error(s) will be as fat as..as.. as what ??
in this function i try to draw a quad that even not appears. (a placement error ?)
void test(void)
{
glColor3f(1.0,0.0,0.0);
glDisable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho(0,640,0,480,-100,100);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glTranslated(10,10,0);
glBegin(GL_QUADS);
glVertex3f(0.0,0.0,0.0);
glVertex3f(30.0,0.0,0.0);
glVertex3f(30.0,30.0,0.0);
glVertex3f(0.0,30.0,0.0);
glEnd();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glEnable(GL_DEPTH_TEST);
}