//Отрисовка нужного примитива public void DrawPrimitive(ObjPack packet) { switch (g) { case GLMode.GLPoints: glb[obcnt] = new GLPoint(packet.P1, packet.size); break; case GLMode.GLLines: glb[obcnt] = new GLLine(packet.P1, packet.P2, packet.size, packet.type); break; case GLMode.GLTriangles: glb[obcnt] = new GLTriangle(packet.P1, packet.P2, packet.P3, packet.size, packet.type); break; case GLMode.GLQuads: glb[obcnt] = new GLQuad(packet.P1, packet.P2, packet.P3, packet.P4, packet.size, packet.type); break; case GLMode.GLOther: glb[obcnt] = new GLTeapot(packet.P1, packet.size, packet.mode); break; } obcnt++; }
//------------ Методы рисования --------------- private void Draw(GLMode mode, ObjPack packet) { GLDrawing d = (GLDrawing)ObjList[(int)mode]; d.DrawPrimitive(packet); }