8 const VGfloat white_color
[4] = {1.0, 1.0, 1.0, 1.0};
9 const VGfloat color
[4] = {0.0, 0.0, 0.0, 1.0};
17 VGfloat clearColor
[] = {1.0f
, 1.0f
, 1.0f
, 1.0f
};/* white color */
18 VGfloat fillColor
[] = {1.0f
, 0.0f
, 0.0f
, 1.0f
};/* red color */
19 static const VGubyte segments
[4] = {VG_MOVE_TO_ABS
,
24 const VGfloat cx
= 0, cy
=29, width
=80, height
=40;
25 const VGfloat hw
= width
* 0.5f
;
26 const VGfloat hh
= height
* 0.5f
;
41 vgSetfv(VG_CLEAR_COLOR
, 4, clearColor
);
42 vgSeti(VG_RENDERING_QUALITY
, VG_RENDERING_QUALITY_NONANTIALIASED
);
45 path
= vgCreatePath(VG_PATH_FORMAT_STANDARD
, VG_PATH_DATATYPE_F
,
46 1.0f
, 0.0f
, 0, 0, VG_PATH_CAPABILITY_ALL
);
47 if (path
== VG_INVALID_HANDLE
) {
50 paint
= vgCreatePaint();
51 if (paint
== VG_INVALID_HANDLE
) {
56 vgAppendPathData(path
, 4, segments
, data
);
57 vgSetParameterfv(paint
, VG_PAINT_COLOR
, 4, fillColor
);
58 vgSetParameteri( paint
, VG_PAINT_TYPE
, VG_PAINT_TYPE_COLOR
);
59 vgSetPaint(paint
, VG_FILL_PATH
);
62 /* new window size or exposure */
71 vgClear(0, 0, window_width(), window_height());
74 vgDrawPath(path
, VG_FILL_PATH
);
79 int main(int argc
, char **argv
)
81 set_window_size(100, 100);
82 return run(argc
, argv
, init
, reshape
,