PageRenderTime 22ms CodeModel.GetById 14ms app.highlight 5ms RepoModel.GetById 0ms app.codeStats 1ms

/src/GFX/Primitives.xs

http://github.com/PerlGameDev/SDL
Unknown | 1027 lines | 929 code | 98 blank | 0 comment | 0 complexity | 9d70a918cf95744b85379c59bb523044 MD5 | raw file
   1#include "EXTERN.h"
   2#include "perl.h"
   3#include "XSUB.h"
   4#include "ppport.h"
   5#include "helper.h"
   6
   7#ifndef aTHX_
   8#define aTHX_
   9#endif
  10
  11#include <SDL.h>
  12#ifdef HAVE_SDL_GFX_PRIMITIVES
  13#include <SDL_gfxPrimitives.h>
  14
  15#ifndef SDL_GFXPRIMITIVES_MAJOR
  16#define SDL_GFXPRIMITIVES_MAJOR 0
  17#endif
  18
  19#ifndef SDL_GFXPRIMITIVES_MINOR
  20#define SDL_GFXPRIMITIVES_MINOR 0
  21#endif
  22
  23#ifndef SDL_GFXPRIMITIVES_MICRO
  24#define SDL_GFXPRIMITIVES_MICRO 0
  25#endif
  26
  27#ifndef SDL_GFXPRIMITEVES_VERSION
  28#define SDL_GFXPRIMITEVES_VERSION(X)      \
  29{                                         \
  30	(X)->major = SDL_GFXPRIMITIVES_MAJOR; \
  31	(X)->minor = SDL_GFXPRIMITIVES_MINOR; \
  32	(X)->patch = SDL_GFXPRIMITIVES_MICRO; \
  33}
  34#endif
  35
  36#endif
  37
  38MODULE = SDL::GFX::Primitives 	PACKAGE = SDL::GFX::Primitives    PREFIX = gfx_prim_
  39
  40=for documentation
  41
  42The Following are XS bindings to the SDL_gfx Library
  43
  44Described here:
  45
  46See: L<http:/*www.ferzkopp.net/joomla/content/view/19/14/> */
  47
  48=cut
  49
  50#ifdef HAVE_SDL_GFX_PRIMITIVES
  51
  52const SDL_version *
  53gfx_prim_linked_version()
  54	PREINIT:
  55		char* CLASS = "SDL::Version";
  56	CODE:
  57		SDL_version *linked_version = safemalloc( sizeof( SDL_version) );
  58		SDL_GFXPRIMITEVES_VERSION(linked_version);
  59		
  60		RETVAL = linked_version;
  61	OUTPUT:
  62		RETVAL
  63
  64int
  65gfx_prim_pixel_color(dst, x, y, color)
  66	SDL_Surface *dst
  67	Sint16 x
  68	Sint16 y
  69	Uint32 color
  70	CODE:
  71		RETVAL = pixelColor(dst, x, y, color);
  72	OUTPUT:
  73		RETVAL
  74
  75int
  76gfx_prim_pixel_RGBA(dst, x, y, r, g, b, a)
  77	SDL_Surface * dst
  78	Sint16 x
  79	Sint16 y
  80	Uint8 r
  81	Uint8 g
  82	Uint8 b
  83	Uint8 a
  84	CODE:
  85		RETVAL = pixelRGBA(dst, x, y, r, g, b, a);
  86	OUTPUT:
  87		RETVAL
  88
  89int
  90gfx_prim_hline_color(dst, x1, x2, y, color)
  91	SDL_Surface * dst
  92	Sint16 x1
  93	Sint16 x2
  94	Sint16 y
  95	Uint32 color
  96	CODE:
  97		RETVAL = hlineColor(dst, x1, x2, y, color);
  98	OUTPUT:
  99		RETVAL
 100
 101int
 102gfx_prim_hline_RGBA(dst, x1, x2, y, r, g, b, a)
 103	SDL_Surface * dst
 104	Sint16 x1
 105	Sint16 x2
 106	Sint16 y
 107	Uint8 r
 108	Uint8 g
 109	Uint8 b
 110	Uint8 a
 111	CODE:
 112		RETVAL = hlineRGBA(dst, x1, x2, y, r, g, b, a);
 113	OUTPUT:
 114		RETVAL
 115
 116int
 117gfx_prim_vline_color(dst, x, y1, y2, color)
 118	SDL_Surface * dst
 119	Sint16 x
 120	Sint16 y1
 121	Sint16 y2
 122	Uint32 color
 123	CODE:
 124		RETVAL = vlineColor(dst, x, y1, y2, color);
 125	OUTPUT:
 126		RETVAL
 127
 128int
 129gfx_prim_vline_RGBA(dst, x, y1, y2, r, g, b, a)
 130	SDL_Surface * dst
 131	Sint16 x
 132	Sint16 y1
 133	Sint16 y2
 134	Uint8 r
 135	Uint8 g
 136	Uint8 b
 137	Uint8 a
 138	CODE:
 139		RETVAL = vlineRGBA(dst, x, y1, y2, r, g, b, a);
 140	OUTPUT:
 141		RETVAL
 142
 143int
 144gfx_prim_rectangle_color(dst, x1, y1, x2, y2, color)
 145	SDL_Surface * dst
 146	Sint16 x1
 147	Sint16 y1
 148	Sint16 x2
 149	Sint16 y2
 150	Uint32 color
 151	CODE:
 152		RETVAL = rectangleColor(dst, x1, y1, x2, y2, color);
 153	OUTPUT:
 154		RETVAL
 155
 156int
 157gfx_prim_rectangle_RGBA(dst, x1, y1, x2, y2, r, g, b, a)
 158	SDL_Surface * dst
 159	Sint16 x1
 160	Sint16 y1
 161	Sint16 x2
 162	Sint16 y2
 163	Uint8 r
 164	Uint8 g
 165	Uint8 b
 166	Uint8 a
 167	CODE:
 168		RETVAL = rectangleRGBA(dst, x1, y1, x2, y2, r, g, b, a);
 169	OUTPUT:
 170		RETVAL
 171
 172int
 173gfx_prim_box_color(dst, x1, y1, x2, y2, color)
 174	SDL_Surface * dst
 175	Sint16 x1
 176	Sint16 y1
 177	Sint16 x2
 178	Sint16 y2
 179	Uint32 color
 180	CODE:
 181		RETVAL = boxColor(dst, x1, y1, x2, y2, color);
 182	OUTPUT:
 183		RETVAL
 184
 185int
 186gfx_prim_box_RGBA(dst, x1, y1, x2, y2, r, g, b, a)
 187	SDL_Surface * dst
 188	Sint16 x1
 189	Sint16 y1
 190	Sint16 x2
 191	Sint16 y2
 192	Uint8 r
 193	Uint8 g
 194	Uint8 b
 195	Uint8 a
 196	CODE:
 197		RETVAL = boxRGBA(dst, x1, y1, x2, y2, r, g, b, a);
 198	OUTPUT:
 199		RETVAL
 200
 201int
 202gfx_prim_line_color(dst, x1, y1, x2, y2, color)
 203	SDL_Surface * dst
 204	Sint16 x1
 205	Sint16 y1
 206	Sint16 x2
 207	Sint16 y2
 208	Uint32 color
 209	CODE:
 210		RETVAL = lineColor(dst, x1, y1, x2, y2, color);
 211	OUTPUT:
 212		RETVAL
 213
 214int
 215gfx_prim_line_RGBA(dst, x1, y1, x2, y2, r, g, b, a)
 216	SDL_Surface * dst
 217	Sint16 x1
 218	Sint16 y1
 219	Sint16 x2
 220	Sint16 y2
 221	Uint8 r
 222	Uint8 g
 223	Uint8 b
 224	Uint8 a
 225	CODE:
 226		RETVAL = lineRGBA(dst, x1, y1, x2, y2, r, g, b, a);
 227	OUTPUT:
 228		RETVAL
 229
 230int
 231gfx_prim_aaline_color(dst, x1, y1, x2, y2, color)
 232	SDL_Surface * dst
 233	Sint16 x1
 234	Sint16 y1
 235	Sint16 x2
 236	Sint16 y2
 237	Uint32 color
 238	CODE:
 239		RETVAL = aalineColor(dst, x1, y1, x2, y2, color);
 240	OUTPUT:
 241		RETVAL
 242
 243int
 244gfx_prim_aaline_RGBA(dst, x1, y1, x2, y2, r, g, b, a)
 245	SDL_Surface * dst
 246	Sint16 x1
 247	Sint16 y1
 248	Sint16 x2
 249	Sint16 y2
 250	Uint8 r
 251	Uint8 g
 252	Uint8 b
 253	Uint8 a
 254	CODE:
 255		RETVAL = aalineRGBA(dst, x1, y1, x2, y2, r, g, b, a);
 256	OUTPUT:
 257		RETVAL
 258
 259int
 260gfx_prim_circle_color(dst, x, y, r, color)
 261	SDL_Surface * dst
 262	Sint16 x
 263	Sint16 y
 264	Sint16 r
 265	Uint32 color
 266	CODE:
 267		RETVAL = circleColor(dst, x, y, r, color);
 268	OUTPUT:
 269		RETVAL
 270
 271int
 272gfx_prim_circle_RGBA(dst, x, y, rad, r, g, b, a)
 273	SDL_Surface * dst
 274	Sint16 x
 275	Sint16 y
 276	Sint16 rad
 277	Uint8 r
 278	Uint8 g
 279	Uint8 b
 280	Uint8 a
 281	CODE:
 282		RETVAL = circleRGBA(dst, x, y, rad, r, g, b, a);
 283	OUTPUT:
 284		RETVAL
 285
 286#if (SDL_GFXPRIMITIVES_MAJOR >= 2) && (SDL_GFXPRIMITIVES_MINOR >= 0) && (SDL_GFXPRIMITIVES_MICRO >= 17)
 287
 288int
 289gfx_prim_arc_color( dst, x, y, r, start, end, color )
 290	SDL_Surface * dst
 291	Sint16 x
 292	Sint16 y
 293	Sint16 r
 294	Sint16 start
 295	Sint16 end
 296	Uint32 color
 297	CODE:
 298		RETVAL = arcColor(dst, x, y, r, start, end, color);
 299	OUTPUT:
 300		RETVAL
 301
 302int
 303gfx_prim_arc_RGBA( dst, x, y, rad, start, end, r, g, b, a )
 304	SDL_Surface * dst
 305	Sint16 x
 306	Sint16 y
 307	Sint16 rad
 308	Sint16 start
 309	Sint16 end
 310	Uint8 r
 311	Uint8 g
 312	Uint8 b
 313	Uint8 a
 314	CODE:
 315		RETVAL = arcRGBA(dst, x, y, rad, start, end, r, g, b, a);
 316	OUTPUT:
 317		RETVAL
 318
 319#else
 320
 321int
 322gfx_prim_arc_color( dst, x, y, r, start, end, color )
 323	SDL_Surface * dst
 324	Sint16 x
 325	Sint16 y
 326	Sint16 r
 327	Sint16 start
 328	Sint16 end
 329	Uint32 color
 330	CODE:
 331		warn("SDL_gfx >= 2.0.17 needed for SDL::GFX::Primitives::arc_color( dst, x, y, r, start, end, color )");
 332		XSRETURN_UNDEF;
 333	OUTPUT:
 334		RETVAL
 335
 336int
 337gfx_prim_arc_RGBA( dst, x, y, rad, start, end, r, g, b, a )
 338	SDL_Surface * dst
 339	Sint16 x
 340	Sint16 y
 341	Sint16 rad
 342	Sint16 start
 343	Sint16 end
 344	Uint8 r
 345	Uint8 g
 346	Uint8 b
 347	Uint8 a
 348	CODE:
 349		warn("SDL_gfx >= 2.0.17 needed for SDL::GFX::Primitives::arc_RGBA( dst, x, y, rad, start, end, r, g, b, a )");
 350		XSRETURN_UNDEF;
 351	OUTPUT:
 352		RETVAL
 353
 354#endif
 355
 356int
 357gfx_prim_aacircle_color(dst, x, y, r, color)
 358	SDL_Surface * dst
 359	Sint16 x
 360	Sint16 y
 361	Sint16 r
 362	Uint32 color
 363	CODE:
 364		RETVAL = aacircleColor(dst, x, y, r, color);
 365	OUTPUT:
 366		RETVAL
 367
 368int
 369gfx_prim_aacircle_RGBA(dst, x, y, rad, r, g, b, a)
 370	SDL_Surface * dst
 371	Sint16 x
 372	Sint16 y
 373	Sint16 rad
 374	Uint8 r
 375	Uint8 g
 376	Uint8 b
 377	Uint8 a
 378	CODE:
 379		RETVAL = aacircleRGBA(dst, x, y, rad, r, g, b, a);
 380	OUTPUT:
 381		RETVAL
 382
 383int
 384gfx_prim_filled_circle_color(dst, x, y, r, color)
 385	SDL_Surface * dst
 386	Sint16 x
 387	Sint16 y
 388	Sint16 r
 389	Uint32 color
 390	CODE:
 391		RETVAL = filledCircleColor(dst, x, y, r, color);
 392	OUTPUT:
 393		RETVAL
 394
 395int
 396gfx_prim_filled_circle_RGBA(dst, x, y, rad, r, g, b, a)
 397	SDL_Surface * dst
 398	Sint16 x
 399	Sint16 y
 400	Sint16 rad
 401	Uint8 r
 402	Uint8 g
 403	Uint8 b
 404	Uint8 a
 405	CODE:
 406		RETVAL = filledCircleRGBA(dst, x, y, rad, r, g, b, a);
 407	OUTPUT:
 408		RETVAL
 409
 410int
 411gfx_prim_ellipse_color(dst, x, y, rx, ry, color)
 412	SDL_Surface * dst
 413	Sint16 x
 414	Sint16 y
 415	Sint16 rx
 416	Sint16 ry
 417	Uint32 color
 418	CODE:
 419		RETVAL = ellipseColor(dst, x, y, rx, ry, color);
 420	OUTPUT:
 421		RETVAL
 422
 423int
 424gfx_prim_ellipse_RGBA(dst, x, y, rx, ry, r, g, b, a)
 425	SDL_Surface * dst
 426	Sint16 x
 427	Sint16 y
 428	Sint16 rx
 429	Sint16 ry
 430	Uint8 r
 431	Uint8 g
 432	Uint8 b
 433	Uint8 a
 434	CODE:
 435		RETVAL = ellipseRGBA(dst, x, y, rx, ry, r, g, b, a);
 436	OUTPUT:
 437		RETVAL
 438
 439int
 440gfx_prim_aaellipse_color(dst, xc, yc, rx, ry, color)
 441	SDL_Surface * dst
 442	Sint16 xc
 443	Sint16 yc
 444	Sint16 rx
 445	Sint16 ry
 446	Uint32 color
 447	CODE:
 448		RETVAL = aaellipseColor(dst, xc, yc, rx, ry, color);
 449	OUTPUT:
 450		RETVAL
 451
 452int
 453gfx_prim_aaellipse_RGBA(dst, x, y, rx, ry, r, g, b, a)
 454	SDL_Surface * dst
 455	Sint16 x
 456	Sint16 y
 457	Sint16 rx
 458	Sint16 ry
 459	Uint8 r
 460	Uint8 g
 461	Uint8 b
 462	Uint8 a
 463	CODE:
 464		RETVAL = aaellipseRGBA(dst, x, y, rx, ry, r, g, b, a);
 465	OUTPUT:
 466		RETVAL
 467
 468int
 469gfx_prim_filled_ellipse_color(dst, x, y, rx, ry, color)
 470	SDL_Surface * dst
 471	Sint16 x
 472	Sint16 y
 473	Sint16 rx
 474	Sint16 ry
 475	Uint32 color
 476	CODE:
 477		RETVAL = filledEllipseColor(dst, x, y, rx, ry, color);
 478	OUTPUT:
 479		RETVAL
 480
 481int
 482gfx_prim_filled_ellipse_RGBA(dst, x, y, rx, ry, r, g, b, a)
 483	SDL_Surface * dst
 484	Sint16 x
 485	Sint16 y
 486	Sint16 rx
 487	Sint16 ry
 488	Uint8 r
 489	Uint8 g
 490	Uint8 b
 491	Uint8 a
 492	CODE:
 493		RETVAL = filledEllipseRGBA(dst, x, y, rx, ry, r, g, b, a);
 494	OUTPUT:
 495		RETVAL
 496
 497int
 498gfx_prim_pie_color(dst, x, y, rad, start, end, color)
 499	SDL_Surface * dst
 500	Sint16 x
 501	Sint16 y
 502	Sint16 rad
 503	Sint16 start
 504	Sint16 end
 505	Uint32 color
 506	CODE:
 507		RETVAL = pieColor(dst, x, y, rad, start, end, color);
 508	OUTPUT:
 509		RETVAL
 510
 511int
 512gfx_prim_pie_RGBA(dst, x, y, rad, start, end, r, g, b, a)
 513	SDL_Surface * dst
 514	Sint16 x
 515	Sint16 y
 516	Sint16 rad
 517	Sint16 start
 518	Sint16 end
 519	Uint8 r
 520	Uint8 g
 521	Uint8 b
 522	Uint8 a
 523	CODE:
 524		RETVAL = pieRGBA(dst, x, y, rad, start, end, r, g, b, a);
 525	OUTPUT:
 526		RETVAL
 527
 528int
 529gfx_prim_filled_pie_color(dst, x, y, rad, start, end, color)
 530	SDL_Surface * dst
 531	Sint16 x
 532	Sint16 y
 533	Sint16 rad
 534	Sint16 start
 535	Sint16 end
 536	Uint32 color
 537	CODE:
 538		RETVAL = filledPieColor(dst, x, y, rad, start, end, color);
 539	OUTPUT:
 540		RETVAL
 541
 542int
 543gfx_prim_filled_pie_RGBA(dst, x, y, rad, start, end, r, g, b, a)
 544	SDL_Surface * dst
 545	Sint16 x
 546	Sint16 y
 547	Sint16 rad
 548	Sint16 start
 549	Sint16 end
 550	Uint8 r
 551	Uint8 g
 552	Uint8 b
 553	Uint8 a
 554	CODE:
 555		RETVAL = filledPieRGBA(dst, x, y, rad, start, end, r, g, b, a);
 556	OUTPUT:
 557		RETVAL
 558
 559int
 560gfx_prim_trigon_color(dst, x1, y1, x2, y2, x3, y3, color)
 561	SDL_Surface * dst
 562	Sint16 x1
 563	Sint16 y1
 564	Sint16 x2
 565	Sint16 y2
 566	Sint16 x3
 567	Sint16 y3
 568	Uint32 color
 569	CODE:
 570		RETVAL = trigonColor(dst, x1, y1, x2, y2, x3, y3, color);
 571	OUTPUT:
 572		RETVAL
 573
 574int
 575gfx_prim_trigon_RGBA(dst, x1, y1, x2, y2, x3, y3, r, g, b, a)
 576	SDL_Surface * dst
 577	Sint16 x1
 578	Sint16 y1
 579	Sint16 x2
 580	Sint16 y2
 581	Sint16 x3
 582	Sint16 y3
 583	Uint8 r
 584	Uint8 g
 585	Uint8 b
 586	Uint8 a
 587	CODE:
 588		RETVAL = trigonRGBA(dst, x1, y1, x2, y2, x3, y3, r, g, b, a);
 589	OUTPUT:
 590		RETVAL
 591
 592int
 593gfx_prim_aatrigon_color(dst, x1, y1, x2, y2, x3, y3, color)
 594	SDL_Surface * dst
 595	Sint16 x1
 596	Sint16 y1
 597	Sint16 x2
 598	Sint16 y2
 599	Sint16 x3
 600	Sint16 y3
 601	Uint32 color
 602	CODE:
 603		RETVAL = aatrigonColor(dst, x1, y1, x2, y2, x3, y3, color);
 604	OUTPUT:
 605		RETVAL
 606
 607int
 608gfx_prim_aatrigon_RGBA(dst, x1, y1, x2, y2, x3, y3, r, g, b, a)
 609	SDL_Surface * dst
 610	Sint16 x1
 611	Sint16 y1
 612	Sint16 x2
 613	Sint16 y2
 614	Sint16 x3
 615	Sint16 y3
 616	Uint8 r
 617	Uint8 g
 618	Uint8 b
 619	Uint8 a
 620	CODE:
 621		RETVAL = aatrigonRGBA(dst, x1, y1, x2, y2, x3, y3, r, g, b, a);
 622	OUTPUT:
 623		RETVAL
 624
 625int
 626gfx_prim_filled_trigon_color(dst, x1, y1, x2, y2, x3, y3, color)
 627	SDL_Surface * dst
 628	Sint16 x1
 629	Sint16 y1
 630	Sint16 x2
 631	Sint16 y2
 632	Sint16 x3
 633	Sint16 y3
 634	Uint32 color
 635	CODE:
 636		RETVAL = filledTrigonColor(dst, x1, y1, x2, y2, x3, y3, color);
 637	OUTPUT:
 638		RETVAL
 639
 640int
 641gfx_prim_filled_trigon_RGBA(dst, x1, y1, x2, y2, x3, y3, r, g, b, a)
 642	SDL_Surface * dst
 643	Sint16 x1
 644	Sint16 y1
 645	Sint16 x2
 646	Sint16 y2
 647	Sint16 x3
 648	Sint16 y3
 649	Uint8 r
 650	Uint8 g
 651	Uint8 b
 652	Uint8 a
 653	CODE:
 654		RETVAL = filledTrigonRGBA(dst, x1, y1, x2, y2, x3, y3, r, g, b, a);
 655	OUTPUT:
 656		RETVAL
 657
 658int
 659gfx_prim_polygon_color(dst, vx, vy, n, color)
 660	SDL_Surface * dst
 661	AV* vx
 662	AV* vy
 663	int n
 664	Uint32 color
 665	CODE:
 666		Sint16 * _vx = av_to_sint16(vx);
 667		Sint16 * _vy = av_to_sint16(vy);
 668		RETVAL  =  polygonColor(dst, _vx, _vy, n, color);
 669	  	_svinta_free( _vx, av_len(vx) );
 670		_svinta_free( _vy, av_len(vy) );
 671	OUTPUT:
 672		RETVAL
 673
 674int
 675gfx_prim_polygon_RGBA(dst, vx, vy, n, r, g, b, a)
 676	SDL_Surface * dst
 677	AV* vx
 678	AV* vy
 679	int n
 680	Uint8 r
 681	Uint8 g
 682	Uint8 b
 683	Uint8 a
 684	CODE:
 685		Sint16 * _vx = av_to_sint16(vx);
 686		Sint16 * _vy = av_to_sint16(vy);
 687		RETVAL = polygonRGBA(dst, _vx, _vy, n, r, g, b, a);
 688		_svinta_free( _vx, av_len(vx) );
 689		_svinta_free( _vy, av_len(vy) );
 690
 691	OUTPUT:
 692		RETVAL
 693
 694int
 695gfx_prim_aapolygon_color(dst, vx, vy, n, color)
 696	SDL_Surface * dst
 697	AV* vx
 698	AV* vy
 699	int n
 700	Uint32 color
 701	CODE:
 702		Sint16 * _vx = av_to_sint16(vx);
 703		Sint16 * _vy = av_to_sint16(vy);
 704		RETVAL = aapolygonColor(dst, _vx, _vy, n, color);
 705		_svinta_free( _vx, av_len(vx) );
 706		_svinta_free( _vy, av_len(vy) );
 707
 708	OUTPUT:
 709		RETVAL
 710
 711int
 712gfx_prim_aapolygon_RGBA(dst, vx, vy, n, r, g, b, a)
 713	SDL_Surface * dst
 714	AV* vx
 715	AV* vy
 716	int n
 717	Uint8 r
 718	Uint8 g
 719	Uint8 b
 720	Uint8 a
 721	CODE:
 722		Sint16 * _vx = av_to_sint16(vx);
 723		Sint16 * _vy = av_to_sint16(vy);
 724		RETVAL = aapolygonRGBA(dst, _vx, _vy, n, r, g, b, a);
 725		_svinta_free( _vx, av_len(vx) );
 726		_svinta_free( _vy, av_len(vy) );
 727
 728	OUTPUT:
 729		RETVAL
 730
 731int
 732gfx_prim_filled_polygon_color(dst, vx, vy, n, color)
 733	SDL_Surface * dst
 734	AV* vx
 735	AV* vy
 736	int n
 737	Uint32 color
 738	CODE:
 739		Sint16 * _vx = av_to_sint16(vx);
 740		Sint16 * _vy = av_to_sint16(vy);
 741		RETVAL = filledPolygonColor(dst, _vx, _vy, n, color);
 742		_svinta_free( _vx, av_len(vx) );
 743		_svinta_free( _vy, av_len(vy) );
 744
 745	OUTPUT:
 746		RETVAL
 747
 748int
 749gfx_prim_filled_polygon_RGBA(dst, vx, vy, n, r, g, b, a)
 750	SDL_Surface * dst
 751	AV* vx
 752	AV* vy
 753	int n
 754	Uint8 r
 755	Uint8 g
 756	Uint8 b
 757	Uint8 a
 758	CODE:
 759		Sint16 * _vx = av_to_sint16(vx);
 760		Sint16 * _vy = av_to_sint16(vy);
 761		RETVAL = filledPolygonRGBA(dst, _vx, _vy, n, r, g, b, a);
 762		_svinta_free( _vx, av_len(vx) );
 763		_svinta_free( _vy, av_len(vy) );
 764
 765	OUTPUT:
 766		RETVAL
 767
 768#if (SDL_GFXPRIMITIVES_MAJOR >= 2) && (SDL_GFXPRIMITIVES_MINOR >= 0) && (SDL_GFXPRIMITIVES_MICRO >= 14)
 769
 770int
 771gfx_prim_textured_polygon(dst, vx, vy, n, texture, texture_dx, texture_dy)
 772	SDL_Surface * dst
 773	AV* vx
 774	AV* vy
 775	int n
 776	SDL_Surface * texture
 777	int texture_dx
 778	int texture_dy
 779	CODE:
 780		Sint16 * _vx = av_to_sint16(vx);
 781		Sint16 * _vy = av_to_sint16(vy);
 782		RETVAL = texturedPolygon(dst, _vx, _vy, n, texture, texture_dx, texture_dy);
 783		_svinta_free( _vx, av_len(vx) );
 784		_svinta_free( _vy, av_len(vy) );
 785
 786	OUTPUT:
 787		RETVAL
 788
 789#else
 790
 791int
 792gfx_prim_textured_polygon(dst, vx, vy, n, texture, texture_dx, texture_dy)
 793	SDL_Surface * dst
 794	AV* vx
 795	AV* vy
 796	int n
 797	SDL_Surface * texture
 798	int texture_dx
 799	int texture_dy
 800	CODE:
 801		warn("SDL_gfx >= 2.0.14 needed for SDL::GFX::Rotozoom::textured_polygon(dst, vx, vy, n, texture, texture_dx, texture_dy)");
 802		XSRETURN_UNDEF;
 803	OUTPUT:
 804		RETVAL
 805
 806#endif
 807
 808#if (SDL_GFXPRIMITIVES_MAJOR >= 2) && (SDL_GFXPRIMITIVES_MINOR >= 0) && (SDL_GFXPRIMITIVES_MICRO >= 17)
 809
 810int
 811gfx_prim_filled_polygon_color_MT(dst, vx, vy, n, color, polyInts, polyAllocated)
 812	SDL_Surface * dst
 813	AV* vx
 814	AV* vy
 815	int n
 816	Uint32 color
 817	int **polyInts
 818	int *polyAllocated
 819	CODE:
 820		Sint16 * _vx = av_to_sint16(vx);
 821		Sint16 * _vy = av_to_sint16(vy);
 822		RETVAL = filledPolygonColorMT(dst, _vx, _vy, n, color, polyInts, polyAllocated);
 823		_svinta_free( _vx, av_len(vx) );
 824		_svinta_free( _vy, av_len(vy) );
 825
 826	OUTPUT:
 827		RETVAL
 828
 829int
 830gfx_prim_filled_polygon_RGBA_MT(dst, vx, vy, n, r, g, b, a, polyInts, polyAllocated)
 831	SDL_Surface * dst
 832	AV* vx
 833	AV* vy
 834	int n
 835	Uint8 r
 836	Uint8 g
 837	Uint8 b
 838	Uint8 a
 839	int **polyInts
 840	int *polyAllocated
 841	CODE:
 842		Sint16 * _vx = av_to_sint16(vx);
 843		Sint16 * _vy = av_to_sint16(vy);
 844		RETVAL = filledPolygonRGBAMT(dst, _vx, _vy, n, r, g, b, a, polyInts, polyAllocated);
 845		_svinta_free( _vx, av_len(vx) );
 846		_svinta_free( _vy, av_len(vy) );
 847
 848	OUTPUT:
 849		RETVAL
 850
 851int
 852gfx_prim_textured_polygon_MT(dst, vx, vy, n, texture, texture_dx, texture_dy, polyInts, polyAllocated)
 853	SDL_Surface * dst
 854	AV* vx
 855	AV* vy
 856	int n
 857	SDL_Surface * texture
 858	int texture_dx
 859	int texture_dy
 860	int **polyInts
 861	int *polyAllocated
 862	CODE:
 863		Sint16 * _vx = av_to_sint16(vx);
 864		Sint16 * _vy = av_to_sint16(vy);
 865		RETVAL = texturedPolygonMT(dst, _vx, _vy, n, texture, texture_dx, texture_dy, polyInts, polyAllocated);
 866		_svinta_free( _vx, av_len(vx) );
 867		_svinta_free( _vy, av_len(vy) );
 868
 869	OUTPUT:
 870		RETVAL
 871
 872#else
 873
 874int
 875gfx_prim_filled_polygon_color_MT(dst, vx, vy, n, color, polyInts, polyAllocated)
 876	SDL_Surface * dst
 877	AV* vx
 878	AV* vy
 879	int n
 880	Uint32 color
 881	int **polyInts
 882	int *polyAllocated
 883	CODE:
 884		warn("SDL_gfx >= 2.0.17 needed for SDL::GFX::Primitives::filled_polygon_color_MT( dst, vx, vy, n, color, polyInts, polyAllocated )");
 885		XSRETURN_UNDEF;
 886	OUTPUT:
 887		RETVAL
 888
 889int
 890gfx_prim_filled_polygon_RGBA_MT(dst, vx, vy, n, r, g, b, a, polyInts, polyAllocated)
 891	SDL_Surface * dst
 892	AV* vx
 893	AV* vy
 894	int n
 895	Uint8 r
 896	Uint8 g
 897	Uint8 b
 898	Uint8 a
 899	int **polyInts
 900	int *polyAllocated
 901	CODE:
 902		warn("SDL_gfx >= 2.0.17 needed for SDL::GFX::Primitives::filled_polygon_RGBA_MT( dst, vx, vy, n, r, g, b, a, polyInts, polyAllocated )");
 903		XSRETURN_UNDEF;
 904	OUTPUT:
 905		RETVAL
 906
 907int
 908gfx_prim_textured_polygon_MT(dst, vx, vy, n, texture, texture_dx, texture_dy, polyInts, polyAllocated)
 909	SDL_Surface * dst
 910	AV* vx
 911	AV* vy
 912	int n
 913	SDL_Surface * texture
 914	int texture_dx
 915	int texture_dy
 916	int **polyInts
 917	int *polyAllocated
 918	CODE:
 919		warn("SDL_gfx >= 2.0.17 needed for SDL::GFX::Primitives::textured_polygon_MT( dst, vx, vy, n, texture, texture_dx, texture_dy, polyInts, polyAllocated )");
 920		XSRETURN_UNDEF;
 921	OUTPUT:
 922		RETVAL
 923
 924#endif
 925
 926int
 927gfx_prim_bezier_color(dst, vx, vy, n, s, color)
 928	SDL_Surface * dst
 929	AV* vx
 930	AV* vy
 931	int n
 932	int s
 933	Uint32 color
 934	CODE:
 935		Sint16 * _vx = av_to_sint16(vx);
 936		Sint16 * _vy = av_to_sint16(vy);
 937		RETVAL = bezierColor(dst, _vx, _vy, n, s, color);
 938		_svinta_free( _vx, av_len(vx) );
 939		_svinta_free( _vy, av_len(vy) );
 940
 941	OUTPUT:
 942		RETVAL
 943
 944int
 945gfx_prim_bezier_RGBA(dst, vx, vy, n, s, r, g, b, a)
 946	SDL_Surface * dst
 947	AV* vx
 948	AV* vy
 949	int n
 950	int s
 951	Uint8 r
 952	Uint8 g
 953	Uint8 b
 954	Uint8 a
 955	CODE:
 956		Sint16 * _vx = av_to_sint16(vx);
 957		Sint16 * _vy = av_to_sint16(vy);
 958		RETVAL = bezierRGBA(dst, _vx, _vy, n, s, r, g, b, a);
 959		_svinta_free( _vx, av_len(vx) );
 960		_svinta_free( _vy, av_len(vy) );
 961
 962	OUTPUT:
 963		RETVAL
 964
 965int
 966gfx_prim_character_color(dst, x, y, c, color)
 967	SDL_Surface * dst
 968	Sint16 x
 969	Sint16 y
 970	char c
 971	Uint32 color
 972	CODE:
 973		RETVAL = characterColor(dst, x, y, c, color);
 974	OUTPUT:
 975		RETVAL
 976
 977int
 978gfx_prim_character_RGBA(dst, x, y, c, r, g, b, a)
 979	SDL_Surface * dst
 980	Sint16 x
 981	Sint16 y
 982	char c
 983	Uint8 r
 984	Uint8 g
 985	Uint8 b
 986	Uint8 a
 987	CODE:
 988		RETVAL = characterRGBA(dst, x, y, c, r, g, b, a);
 989	OUTPUT:
 990		RETVAL
 991
 992int
 993gfx_prim_string_color(dst, x, y, c, color)
 994	SDL_Surface * dst
 995	Sint16 x
 996	Sint16 y
 997	const char *c
 998	Uint32 color
 999	CODE:
1000		RETVAL = stringColor(dst, x, y, c, color);
1001	OUTPUT:
1002		RETVAL
1003
1004int
1005gfx_prim_string_RGBA(dst, x, y, c, r, g, b, a)
1006	SDL_Surface * dst
1007	Sint16 x
1008	Sint16 y
1009	const char *c
1010	Uint8 r
1011	Uint8 g
1012	Uint8 b
1013	Uint8 a
1014	CODE:
1015		RETVAL = stringRGBA(dst, x, y, c, r, g, b, a);
1016	OUTPUT:
1017		RETVAL
1018
1019void
1020gfx_prim_set_font(fontdata, cw, ch)
1021	char *fontdata
1022	int cw
1023	int ch
1024	CODE:
1025		gfxPrimitivesSetFont(fontdata, cw, ch);
1026
1027#endif