glEnable(GL_BLEND); // Enable blending.
glBlendFunc(GL_ONE, GL_ZERO); // Just the source image.
glBegin(GL_TRIANGLES); // Drawing Using Triangles
glColor4f(1.0f, 0.0f, 0.0f, 1.0f);
glVertex4f( 0.0f, 1.2f, 0.0f, 1.0f);
glVertex4f(-1.2f,-1.0f, 0.0f, 1.0f);
glVertex4f( 1.2f,-1.0f, 0.0f, 1.0f);
glEnd();
// Alpha blending.
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBegin(GL_QUADS); // Draw A Quad
glColor4f(0.0f, 0.0f, 1.0f, 0.5f);
glVertex4f(-1.0f, 1.0f, 0.0f, 1.0f);
glVertex4f( 1.0f, 1.0f, 0.0f, 1.0f);
glVertex4f( 1.0f,-1.0f, 0.0f, 1.0f);
glVertex4f(-1.0f,-1.0f, 0.0f, 1.0f);
glEnd();