glMatrixMode GL_PROJECTION
glLoadIdentity
glOrtho 0 1 0 1 -1 1
glMatrixMode GL_MODELVIEW
glLoadIdentity
glColor 0 0 1
glBegin GL_QUADS
glVertex2 .1 .1
glVertex2 .4 .1
glVertex2 .4 .4
glVertex2 .1 .4
glEnd
glColor 1 0 0
glBegin GL_TRIANGLES
glVertex3 0.5 0.25 0.5
glVertex3 0.75 0.25 -0.5
glVertex3 0.75 0.75 -0.5
glEnd
