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

NAME

6       dtk_create_triangle_2p,  dtk_create_rectangle_hw  -  Create  and modify
7       rectangular shapes
8

SYNOPSIS

10       #include <drawtk.h>
11
12       dtk_hshape dtk_create_rectangle_2p(dtk_hshape shp,
13                       float p1_x, float p1_y, float p2_x, float p2_y,
14                       int filled, const float *color);
15       dtk_hshape dtk_create_rectangle_hw(dtk_hshape shp,
16                       float cx, float cy, float h, float w,
17                       int filled, const float *color);
18

DESCRIPTION

20       dtk_create_rectangle_2p() creates a rectangle whose the  opposing  cor‐
21       ners are located at (p1_x,p1_y) and  (p2_x,p2_y).
22
23       dtk_create_rectangle_hw() creates a rectangle with height h and width w
24       and with its center located at (cx,cy) in the original frame.
25
26       shp, filled and color have the same usage  and  meaning  as  for  other
27       shape creation function:
28
29        * shp  can be used to modify a previously created shape. If it is non-
30          null, the handle will be used to modify the shape referenced by shp:
31          no  new shape is created and the returned value is ensured to be shp
32          in case of success, NULL otherwise. If shp  is  NULL,  the  function
33          will attempt to create a new shape.
34
35        * filled  is  set  to  0 if the described shape should be a continuous
36          line or a non-null value if the shape is supposed to be filled poly‐
37          gon.
38
39        * color  should  point to a 4 float array containing a normalized RGBA
40          value (i.e. each component is between 0.0 and 1.0).
41

RETURN VALUE

43       In case of success these functions return the handle to the newly  cre‐
44       ated  or  modified  shape.  If the shp argument is non-null, the handle
45       returned is the same value. In case of error, NULL is returned.
46

SEE ALSO

48       dtk_destroy_shape(3)
49
50
51
52
53
54EPFL                                 2011           DTK_CREATE_RECTANGLE_2P(3)
Impressum