void createPrimitives() { VGfloat points[] = {-30,-30, 30,-30, 0,30}; line = testCreatePath(); vguLine(line, -30,-30,30,30); primitives[0] = line; polyOpen = testCreatePath(); vguPolygon(polyOpen, points, 3, VG_FALSE); primitives[1] = polyOpen; polyClosed = testCreatePath(); vguPolygon(polyClosed, points, 3, VG_TRUE); primitives[2] = polyClosed; rect = testCreatePath(); vguRect(rect, -50,-30, 100,60); primitives[3] = rect; rectRound = testCreatePath(); vguRoundRect(rectRound, -50,-30, 100,60, 30,30); primitives[4] = rectRound; ellipse = testCreatePath(); vguEllipse(ellipse, 0,0, 100, 100); primitives[5] = ellipse; arcOpen = testCreatePath(); vguArc(arcOpen, 0,0, 100,60, 0, 270, VGU_ARC_OPEN); primitives[6] = arcOpen; arcChord = testCreatePath(); vguArc(arcChord, 0,0, 100,60, 0, 270, VGU_ARC_CHORD); primitives[7] = arcChord; arcPie = testCreatePath(); vguArc(arcPie, 0,0, 100,60, 0, 270, VGU_ARC_PIE); primitives[8] = arcPie; }
// RoundrectOutline makes an rounded rectangle at the specified location and dimensions, outlined void RoundrectOutline(VGfloat x, VGfloat y, VGfloat w, VGfloat h, VGfloat rw, VGfloat rh) { VGPath path = newpath(); vguRoundRect(path, x, y, w, h, rw, rh); vgDrawPath(path, VG_STROKE_PATH); vgDestroyPath(path); }