float r = 1, g = 0, b = 0, a = 0.5;
float x = 20, y = 20, xsize = 80, ysize = 80;
window.glEnable2D();
glColor4f(r, g, b, a);
glBegin(GL_QUADS);
glVertex2f(x, y);
glVertex2f(x, y+ysize);
glVertex2f(x+xsize, y+ysize);
glVertex2f(x+xsize, y);
glEnd();
window.glDisable2D();
void Window::glEnable2D()
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0, screen->w, screen->h, 0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
void Window::glDisable2D()
{
glMatrixMode(GL_PROJECTION);
glTranslatef(0, -2.0, 0);
glLoadIdentity();
gluPerspective(60, 1.33333333, 1, 1024);
}
Any ideas to what is wrong? Cheers ~David [Edited by - win_crook on August 13, 2006 11:52:51 AM]