5 const VGfloat white_color
[4] = {1.0, 1.0, 1.0, 1.0};
6 const VGfloat green_color
[4] = {0.0, 1.0, 0.0, 0.8};
15 static const VGubyte cmds
[6] = {VG_MOVE_TO_ABS
, VG_LINE_TO_ABS
, VG_LINE_TO_ABS
, VG_LINE_TO_ABS
,
16 VG_LINE_TO_ABS
, VG_CLOSE_PATH
};
17 static const VGfloat coords
[] = { 0, 200,
22 path
= vgCreatePath(VG_PATH_FORMAT_STANDARD
, VG_PATH_DATATYPE_F
, 1, 0, 0, 0,
23 VG_PATH_CAPABILITY_APPEND_TO
);
24 vgAppendPathData(path
, 6, cmds
, coords
);
26 fill
= vgCreatePaint();
27 vgSetParameterfv(fill
, VG_PAINT_COLOR
, 4, green_color
);
28 vgSetPaint(fill
, VG_FILL_PATH
);
30 vgSetfv(VG_CLEAR_COLOR
, 4, white_color
);
31 vgSeti(VG_FILL_RULE
, VG_NON_ZERO
);
34 /* new window size or exposure */
44 vgClear(0, 0, window_width(), window_height());
45 vgDrawPath(path
, VG_FILL_PATH
| VG_STROKE_PATH
);
51 int main(int argc
, char **argv
)
53 return run(argc
, argv
, init
, reshape
,