Hi chintu,
there are two problems.
Change resizeGL() to:
@
void resizeGL(int Height, int Width) {
glViewport(0, 0, Width, Height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-200, 200, -200, 200, -1, 1);
glMatrixMode(GL_MODELVIEW);
};
@
OpenGL need a box for the scenario (glOrtho) and viewport was wrong.
In paintGL(), your lines for drawing are wrong, change like this:
@
glVertex2f(Pt[counter+1].getsx(),Pt[counter+1].getsy());
@
As hint: you need counter+i in x and y coordinate!