////////////// OpenGL drawShape for 2D Functions ver 1 ///////////////// #include #include "drawShape2D.h" void setColor(color_t col) { glColor3f(col.r, col.g, col.b); } void drawDot(point2D_t pt) { glBegin(GL_POINTS); glVertex2f(pt.x, pt.y); glEnd(); } void drawLine(point2D_t p1,point2D_t p2) { glBegin(GL_LINES); glVertex2f(p1.x, p1.y); glVertex2f(p2.x, p2.y); glEnd(); } void drawLine(float x1,float y1,float x2,float y2) { glBegin(GL_LINES); glVertex2f(x1, y1); glVertex2f(x2, y2); glEnd(); } //n: number of points void drawPolyline(point2D_t pnt[],int n) { int i; glBegin(GL_LINE_STRIP); for (i=0;i