////////////// OpenGL CGCore for 2D Functions ver 1 ///////////////// #include #include #include #include "CGCore2D.h" void C_Point::draw() { color.set(); glBegin(GL_POINTS); glVertex2f(x, y); glEnd(); } C_Line::C_Line(float x1,float y1,float x2,float y2,C_Color col) { p.x=x1;p.y=y1;q.x=x2;q.y=y2,color=col; p.t=1.;q.t=1.; } void C_Line::draw() { color.set(); glBegin(GL_LINES); glVertex2f(p.x, p.y); glVertex2f(q.x, q.y); glEnd(); } C_Polyline::C_Polyline(C_Point *p0,int numberPoints0) { int i; numberPoints=numberPoints0; p=new C_Point[numberPoints]; for (i=0;i