1DTK_CREATE_LINE(3) Draw Toolkit manual DTK_CREATE_LINE(3)
2
3
4
6 dtk_create_line - Create and modify line shape
7
9 #include <drawtk.h>
10
11 dtk_hshape dtk_create_line(dtk_hshape shp,
12 float x1, float y1, float x2, float y2,
13 const float *color);
14
16 dtk_create_line() creates a line between the points (x1,y1) and
17 (x2,y2).
18
19 shp and color have the same usage and meaning as for other shape cre‐
20 ation function:
21
22 * shp can be used to modify a previously created shape. If it is non-
23 null, the handle will be used to modify the shape referenced by shp:
24 no new shape is created and the returned value is ensured to be shp
25 in case of success, NULL otherwise. If shp is NULL, the function
26 will attempt to create a new shape.
27
28 * color should point to a 4 float array containing a normalized RGBA
29 value (i.e. each component is between 0.0 and 1.0).
30
32 In case of success these functions return the handle to the newly cre‐
33 ated or modified shape. If the shp argument is non-null, the handle
34 returned is the same value. In case of error, NULL is returned.
35
37 dtk_destroy_shape(3)
38
39
40
41
42
43EPFL 2011 DTK_CREATE_LINE(3)