1 /*****************************************************************************
2 * This file is part of gfxprim library. *
4 * Gfxprim is free software; you can redistribute it and/or *
5 * modify it under the terms of the GNU Lesser General Public *
6 * License as published by the Free Software Foundation; either *
7 * version 2.1 of the License, or (at your option) any later version. *
9 * Gfxprim is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
12 * Lesser General Public License for more details. *
14 * You should have received a copy of the GNU Lesser General Public *
15 * License along with gfxprim; if not, write to the Free Software *
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
17 * Boston, MA 02110-1301 USA *
19 * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos *
20 * <jiri.bluebear.dluhos@gmail.com> *
22 * Copyright (C) 2009-2010 Cyril Hrubis <metan@ucw.cz> *
24 *****************************************************************************/
28 void GP_Triangle(GP_Context
*context
, int x0
, int y0
, int x1
, int y1
,
29 int x2
, int y2
, GP_Pixel pixel
)
31 GP_CHECK_CONTEXT(context
);
33 GP_Line(context
, x0
, y0
, x1
, y1
, pixel
);
34 GP_Line(context
, x0
, y0
, x2
, y2
, pixel
);
35 GP_Line(context
, x1
, y1
, x2
, y2
, pixel
);
38 void GP_TTriangle(GP_Context
*context
, int x0
, int y0
, int x1
, int y1
,
39 int x2
, int y2
, GP_Pixel pixel
)
41 GP_CHECK_CONTEXT(context
);
43 GP_TRANSFORM_POINT(context
, x0
, y0
);
44 GP_TRANSFORM_POINT(context
, x1
, y1
);
45 GP_TRANSFORM_POINT(context
, x2
, y2
);
47 GP_Triangle(context
, x0
, y0
, x1
, y1
, x2
, y2
, pixel
);
50 void GP_FillTriangle(GP_Context
* context
, int x0
, int y0
, int x1
, int y1
,
51 int x2
, int y2
, GP_Pixel pixel
)
53 GP_CHECK_CONTEXT(context
);
55 int coords
[6] = { x0
, y0
, x1
, y1
, x2
, y2
};
56 GP_FillPolygon(context
, 3, coords
, pixel
);
59 void GP_TFillTriangle(GP_Context
* context
, int x0
, int y0
, int x1
, int y1
,
60 int x2
, int y2
, GP_Pixel pixel
)
62 GP_CHECK_CONTEXT(context
);
64 GP_TRANSFORM_POINT(context
, x0
, y0
);
65 GP_TRANSFORM_POINT(context
, x1
, y1
);
66 GP_TRANSFORM_POINT(context
, x2
, y2
);
68 int coords
[6] = { x0
, y0
, x1
, y1
, x2
, y2
};
69 GP_FillPolygon(context
, 3, coords
, pixel
);