One solution if your polygon is always convex is to compute the convex hull of your points with the following algorithm to find the order of vertex on the contour.
Anyway, if your polygon is not always convex, there will be more than one solution to build a concave polygon if you don’t know the neighbors vertex on the contour of a particular vertex.Also OpenGL is not able to draw concave polygon right away. You need to use GLU in this case or an algorithm which use the stencil buffer.