5 const VGfloat white_color
[4] = {1.0, 1.0, 1.0, 1.0};
6 const VGfloat color
[4] = {0.4, 0.1, 1.0, 1.0};
15 static const VGubyte sqrCmds
[5] = {VG_MOVE_TO_ABS
, VG_HLINE_TO_ABS
, VG_VLINE_TO_ABS
, VG_HLINE_TO_ABS
, VG_CLOSE_PATH
};
16 static const VGfloat sqrCoords
[5] = {50.0f
, 50.0f
, 250.0f
, 250.0f
, 50.0f
};
17 path
= vgCreatePath(VG_PATH_FORMAT_STANDARD
, VG_PATH_DATATYPE_F
, 1, 0, 0, 0,
18 VG_PATH_CAPABILITY_APPEND_TO
);
19 vgAppendPathData(path
, 5, sqrCmds
, sqrCoords
);
21 fill
= vgCreatePaint();
22 vgSetParameterfv(fill
, VG_PAINT_COLOR
, 4, color
);
23 vgSetPaint(fill
, VG_FILL_PATH
);
25 vgSetfv(VG_CLEAR_COLOR
, 4, white_color
);
26 vgSetf(VG_STROKE_LINE_WIDTH
, 10);
27 vgSeti(VG_STROKE_CAP_STYLE
, VG_CAP_BUTT
);
28 vgSeti(VG_STROKE_JOIN_STYLE
, VG_JOIN_ROUND
);
29 vgSetf(VG_STROKE_MITER_LIMIT
, 4.0f
);
31 vgSeti(VG_MASKING
, VG_TRUE
);
33 vgMask(VG_INVALID_HANDLE
, VG_CLEAR_MASK
,
37 /* new window size or exposure */
47 vgClear(0, 0, window_width(), window_height());
48 vgDrawPath(path
, VG_FILL_PATH
);
54 int main(int argc
, char **argv
)
56 return run(argc
, argv
, init
, reshape
,