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