fill in the polygon
-
hello everyone i really need your help here.... i have implemented a program that is clipping the polygon against a square.. what i need to do now is to use the vertices that got created after clipping to fill in the polygon
void OnFillPolygon()
{
// TODO: Add your command handler code here
wglMakeCurrent(m_hDC,m_hRC);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
::SwapBuffers(m_hDC);
glPushMatrix();
glColor3f( 1.0, 0.0, 0.0 ); //red
glPolygonMode( GL_FRONT, GL_FILL );
glBegin( GL_POLYGON ); //draw solid polygon
glVertex2i( 10, 10 );
glVertex2i( 100, 10 );
glVertex2i( 150, 50 );
glVertex2i( 100, 100 );
glVertex2i( 50, 80 );
glVertex2i( 10, 10 );*/
glEnd();
glPopMatrix();
wglMakeCurrent(m_hDC,NULL);
wglMakeCurrent(m_hDC,m_hRC);
glFlush();
::SwapBuffers(m_hDC);
}this is just specifying exact vertex values...
what should i do so that those were the vertices after clipping.....?