30 #ifndef _SDL2_gfxPrimitives_h 31 #define _SDL2_gfxPrimitives_h 35 #define M_PI 3.1415926535897932384626433832795 39 #include "../render.hpp" 46 #define SDL_Texture BtkTexture 47 #define SDL_Renderer BtkRenderer 49 #define pixelColor _BGFX_pixelColor 50 #define pixelRGBA _BGFX_pixelRGBA 51 #define hlineColor _BGFX_hlineColor 52 #define hlineRGBA _BGFX_hlineRGBA 54 #define vlineColor _BGFX_vlineColor 55 #define vlineRGBA _BGFX_vlineRGBA 57 #define lineColor _BGFX_lineColor 58 #define lineRGBA _BGFX_lineRGBA 60 #define thickLineColor _BGFX_thickLineColor 61 #define thickLineRGBA _BGFX_thickLineRGBA 63 #define aalineColor _BGFX_aalineColor 64 #define aalineRGBA _BGFX_aalineRGBA 66 #define rectangleColor _BGFX_rectangleColor 67 #define rectangleRGBA _BGFX_rectangleRGBA 69 #define roundedRectangleColor _BGFX_roundedRectangleColor 70 #define roundedRectangleRGBA _BGFX_roundedRectangleRGBA 72 #define boxColor _BGFX_boxColor 73 #define boxRGBA _BGFX_boxRGBA 75 #define circleColor _BGFX_circleColor 76 #define circleRGBA _BGFX_circleRGBA 78 #define aacircleColor _BGFX_aacircleColor 79 #define aacircleRGBA _BGFX_aacircleRGBA 81 #define filledCircleColor _BGFX_filledCircleColor 82 #define filledCircleRGBA _BGFX_filledCircleRGBA 84 #define arcColor _BGFX_arcColor 85 #define arcRGBA _BGFX_arcRGBA 87 #define pieColor _BGFX_pieColor 88 #define pieRGBA _BGFX_pieRGBA 90 #define filledPieColor _BGFX_filledPieColor 91 #define filledPieRGBA _BGFX_filledPieRGBA 93 #define ellipseColor _BGFX_ellipseColor 94 #define ellipseRGBA _BGFX_ellipseRGBA 96 #define aaellipseColor _BGFX_aaellipseColor 97 #define aaellipseRGBA _BGFX_aaellipseRGBA 99 #define trigonColor _BGFX_trigonColor 100 #define trigonRGBA _BGFX_trigonRGBA 102 #define aatrigonColor _BGFX_aatrigonColor 103 #define aatrigonRGBA _BGFX_aatrigonRGBA 106 #define roundedBoxColor _BGFX_roundedBoxColor 107 #define roundedBoxRGBA _BGFX_roundedBoxRGBA 109 #define filledEllipseColor _BGFX_filledEllipseColor 110 #define filledEllipseRGBA _BGFX_filledEllipseRGBA 112 #define filledTrigonColor _BGFX_filledTrigonColor 113 #define filledTrigonRGBA _BGFX_filledTrigonRGBA 115 #define polygonColor _BGFX_polygonColor 116 #define polygonRGBA _BGFX_polygonRGBA 118 #define aapolygonColor _BGFX_aapolygonColor 119 #define aapolygonRGBA _BGFX_aapolygonRGBA 121 #define filledPolygonColor _BGFX_filledPolygonColor 122 #define filledPolygonRGBA _BGFX_filledPolygonRGBA 124 #define bezierColor _BGFX_bezierColor 125 #define bezierRGBA _BGFX_bezierRGBA 127 #define texturedPolygon _BGFX_texturedPolygon 131 #define SDL2_GFXPRIMITIVES_MAJOR 1 132 #define SDL2_GFXPRIMITIVES_MINOR 0 133 #define SDL2_GFXPRIMITIVES_MICRO 4 139 # if defined(DLL_EXPORT) && !defined(LIBSDL2_GFX_DLL_IMPORT) 140 # define SDL2_GFXPRIMITIVES_SCOPE __declspec(dllexport) 142 # ifdef LIBSDL2_GFX_DLL_IMPORT 143 # define SDL2_GFXPRIMITIVES_SCOPE __declspec(dllimport) 147 #ifndef SDL2_GFXPRIMITIVES_SCOPE 148 # define SDL2_GFXPRIMITIVES_SCOPE extern 155 SDL2_GFXPRIMITIVES_SCOPE
int pixelColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Uint32 color);
156 SDL2_GFXPRIMITIVES_SCOPE
int pixelRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
160 SDL2_GFXPRIMITIVES_SCOPE
int hlineColor(SDL_Renderer * renderer, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color);
161 SDL2_GFXPRIMITIVES_SCOPE
int hlineRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
165 SDL2_GFXPRIMITIVES_SCOPE
int vlineColor(SDL_Renderer * renderer, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color);
166 SDL2_GFXPRIMITIVES_SCOPE
int vlineRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y1, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
170 SDL2_GFXPRIMITIVES_SCOPE
int rectangleColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color);
171 SDL2_GFXPRIMITIVES_SCOPE
int rectangleRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1,
172 Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
176 SDL2_GFXPRIMITIVES_SCOPE
int roundedRectangleColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color);
177 SDL2_GFXPRIMITIVES_SCOPE
int roundedRectangleRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1,
178 Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
182 SDL2_GFXPRIMITIVES_SCOPE
int boxColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color);
183 SDL2_GFXPRIMITIVES_SCOPE
int boxRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2,
184 Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
188 SDL2_GFXPRIMITIVES_SCOPE
int roundedBoxColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color);
189 SDL2_GFXPRIMITIVES_SCOPE
int roundedBoxRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2,
190 Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
194 SDL2_GFXPRIMITIVES_SCOPE
int lineColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color);
195 SDL2_GFXPRIMITIVES_SCOPE
int lineRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1,
196 Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
200 SDL2_GFXPRIMITIVES_SCOPE
int aalineColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color);
201 SDL2_GFXPRIMITIVES_SCOPE
int aalineRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1,
202 Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
205 SDL2_GFXPRIMITIVES_SCOPE
int thickLineColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2,
206 Uint8 width, Uint32 color);
207 SDL2_GFXPRIMITIVES_SCOPE
int thickLineRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2,
208 Uint8 width, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
212 SDL2_GFXPRIMITIVES_SCOPE
int circleColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color);
213 SDL2_GFXPRIMITIVES_SCOPE
int circleRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
217 SDL2_GFXPRIMITIVES_SCOPE
int arcColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color);
218 SDL2_GFXPRIMITIVES_SCOPE
int arcRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end,
219 Uint8 r, Uint8 g, Uint8 b, Uint8 a);
223 SDL2_GFXPRIMITIVES_SCOPE
int aacircleColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color);
224 SDL2_GFXPRIMITIVES_SCOPE
int aacircleRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y,
225 Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
229 SDL2_GFXPRIMITIVES_SCOPE
int filledCircleColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 r, Uint32 color);
230 SDL2_GFXPRIMITIVES_SCOPE
int filledCircleRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y,
231 Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
235 SDL2_GFXPRIMITIVES_SCOPE
int ellipseColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color);
236 SDL2_GFXPRIMITIVES_SCOPE
int ellipseRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y,
237 Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
241 SDL2_GFXPRIMITIVES_SCOPE
int aaellipseColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color);
242 SDL2_GFXPRIMITIVES_SCOPE
int aaellipseRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y,
243 Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
247 SDL2_GFXPRIMITIVES_SCOPE
int filledEllipseColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color);
248 SDL2_GFXPRIMITIVES_SCOPE
int filledEllipseRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y,
249 Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
253 SDL2_GFXPRIMITIVES_SCOPE
int pieColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad,
254 Sint16 start, Sint16 end, Uint32 color);
255 SDL2_GFXPRIMITIVES_SCOPE
int pieRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad,
256 Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
260 SDL2_GFXPRIMITIVES_SCOPE
int filledPieColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad,
261 Sint16 start, Sint16 end, Uint32 color);
262 SDL2_GFXPRIMITIVES_SCOPE
int filledPieRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad,
263 Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
267 SDL2_GFXPRIMITIVES_SCOPE
int trigonColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color);
268 SDL2_GFXPRIMITIVES_SCOPE
int trigonRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3,
269 Uint8 r, Uint8 g, Uint8 b, Uint8 a);
273 SDL2_GFXPRIMITIVES_SCOPE
int aatrigonColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color);
274 SDL2_GFXPRIMITIVES_SCOPE
int aatrigonRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3,
275 Uint8 r, Uint8 g, Uint8 b, Uint8 a);
279 SDL2_GFXPRIMITIVES_SCOPE
int filledTrigonColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color);
280 SDL2_GFXPRIMITIVES_SCOPE
int filledTrigonRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3,
281 Uint8 r, Uint8 g, Uint8 b, Uint8 a);
285 SDL2_GFXPRIMITIVES_SCOPE
int polygonColor(SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n, Uint32 color);
286 SDL2_GFXPRIMITIVES_SCOPE
int polygonRGBA(SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
287 int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
291 SDL2_GFXPRIMITIVES_SCOPE
int aapolygonColor(SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n, Uint32 color);
292 SDL2_GFXPRIMITIVES_SCOPE
int aapolygonRGBA(SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
293 int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
297 SDL2_GFXPRIMITIVES_SCOPE
int filledPolygonColor(SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n, Uint32 color);
298 SDL2_GFXPRIMITIVES_SCOPE
int filledPolygonRGBA(SDL_Renderer * renderer,
const Sint16 * vx,
299 const Sint16 * vy,
int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
303 SDL2_GFXPRIMITIVES_SCOPE
int texturedPolygon(SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n, SDL_Surface * texture,
int texture_dx,
int texture_dy);
307 SDL2_GFXPRIMITIVES_SCOPE
int bezierColor(SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
int s, Uint32 color);
308 SDL2_GFXPRIMITIVES_SCOPE
int bezierRGBA(SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
309 int n,
int s, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
314 SDL2_GFXPRIMITIVES_SCOPE
void gfxPrimitivesSetFont(
const void *fontdata, Uint32 cw, Uint32 ch);
315 SDL2_GFXPRIMITIVES_SCOPE
void gfxPrimitivesSetFontRotation(Uint32 rotation);
316 SDL2_GFXPRIMITIVES_SCOPE
int characterColor(SDL_Renderer * renderer, Sint16 x, Sint16 y,
char c, Uint32 color);
317 SDL2_GFXPRIMITIVES_SCOPE
int characterRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y,
char c, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
318 SDL2_GFXPRIMITIVES_SCOPE
int stringColor(SDL_Renderer * renderer, Sint16 x, Sint16 y,
const char *s, Uint32 color);
319 SDL2_GFXPRIMITIVES_SCOPE
int stringRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y,
const char *s, Uint8 r, Uint8 g, Uint8 b, Uint8 a);