1DTK_CREATE_SHAPE(3)           Draw Toolkit manual          DTK_CREATE_SHAPE(3)
2
3
4

NAME

6       dtk_create_shape - Create and modify custom shape
7

SYNOPSIS

9       #include <drawtk.h>
10
11       dtk_hshape dtk_create_shape(dtk_hshape shp,
12                       unsigned int ind_num, const float *vertex_array,
13                       int filled, const float *color);
14

DESCRIPTION

16       dtk_create_shape() creates a shape specified by ind_num vertices refer‐
17       enced by vertex_array. In this array, the position parameters (x,y)  of
18       each  vertex  are  packed together and the list should ordered, so that
19       the array is filled in the following way: x0,y0,x1,y1,x2,y2,...,xN,yN.
20
21       shp, filled and color have the same usage  and  meaning  as  for  other
22       shape creation function:
23
24        * shp  can be used to modify a previously created shape. If it is non-
25          null, the handle will be used to modify the shape referenced by shp:
26          no  new shape is created and the returned value is ensured to be shp
27          in case of success, NULL otherwise. If shp  is  NULL,  the  function
28          will attempt to create a new shape.
29
30        * filled  is  set  to  0 if the described shape should be a continuous
31          line or a non-null value if the shape is supposed to be filled poly‐
32          gon. In the case of filled polygon request, the last point specified
33          in vertex_array will be connected with the first one.
34
35        * color should point to a 4 float array containing a  normalized  RGBA
36          value (i.e. each component is between 0.0 and 1.0).
37

RETURN VALUE

39       In  case of success these functions return the handle to the newly cre‐
40       ated or modified shape. If the shp argument  is  non-null,  the  handle
41       returned is the same value. In case of error, NULL is returned.
42

SEE ALSO

44       dtk_destroy_shape(3)
45
46
47
48
49
50EPFL                                 2011                  DTK_CREATE_SHAPE(3)
Impressum