sdl_gfx.pas 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  1. unit sdl_gfx;
  2. {
  3. $Id: sdl_gfx.pas,v 1.3 2007/05/29 21:31:04 savage Exp $
  4. }
  5. {
  6. $Log: sdl_gfx.pas,v $
  7. Revision 1.3 2007/05/29 21:31:04 savage
  8. Changes as suggested by Almindor for 64bit compatibility.
  9. Revision 1.2 2007/05/20 20:30:18 savage
  10. Initial Changes to Handle 64 Bits
  11. Revision 1.1 2005/01/03 19:08:32 savage
  12. Header for the SDL_Gfx library.
  13. }
  14. {$I jedi-sdl.inc}
  15. interface
  16. uses
  17. {$IFDEF MORPHOS}
  18. exec,
  19. {$ENDIF}
  20. sdl;
  21. const
  22. {$IFDEF WINDOWS}
  23. SDLgfxLibName = 'SDL_gfx.dll';
  24. {$ENDIF}
  25. {$IFDEF UNIX}
  26. {$IFDEF DARWIN}
  27. SDLgfxLibName = 'libSDL_gfx.dylib';
  28. {$ELSE}
  29. SDLgfxLibName = 'libSDL_gfx.so';
  30. {$ENDIF}
  31. {$ENDIF}
  32. {$IFDEF MACOS}
  33. SDLgfxLibName = 'SDL_gfx';
  34. {$ENDIF}
  35. {$IFDEF MORPHOS}
  36. SDLgfxLibName = 'powersdl_gfx.library';
  37. {$ENDIF}
  38. // Some rates in Hz
  39. FPS_UPPER_LIMIT = 200;
  40. FPS_LOWER_LIMIT = 1;
  41. FPS_DEFAULT = 30;
  42. // ---- Defines
  43. SMOOTHING_OFF = 0;
  44. SMOOTHING_ON = 1;
  45. type
  46. PFPSmanager = ^TFPSmanager;
  47. TFPSmanager = packed record
  48. framecount : Uint32;
  49. rateticks : single;
  50. lastticks : Uint32;
  51. rate : Uint32;
  52. end;
  53. // ---- Structures
  54. PColorRGBA = ^TColorRGBA;
  55. TColorRGBA = packed record
  56. r : Uint8;
  57. g : Uint8;
  58. b : Uint8;
  59. a : Uint8;
  60. end;
  61. PColorY = ^TColorY;
  62. TColorY = packed record
  63. y : Uint8;
  64. end;
  65. {$IFDEF MORPHOS}
  66. {$INCLUDE powersdl_gfx.inc}
  67. {$ELSE MORPHOS}
  68. {
  69. SDL_framerate: framerate manager
  70. LGPL (c) A. Schiffler
  71. }
  72. procedure SDL_initFramerate( manager : PFPSmanager );
  73. cdecl; external {$IFDEF __GPC__}name 'SDL_initFramerate'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  74. {$EXTERNALSYM SDL_initFramerate}
  75. function SDL_setFramerate( manager : PFPSmanager; rate : integer ) : integer;
  76. cdecl; external {$IFDEF __GPC__}name 'SDL_setFramerate'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  77. {$EXTERNALSYM SDL_setFramerate}
  78. function SDL_getFramerate( manager : PFPSmanager ) : integer;
  79. cdecl; external {$IFDEF __GPC__}name 'SDL_getFramerate'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  80. {$EXTERNALSYM SDL_getFramerate}
  81. procedure SDL_framerateDelay( manager : PFPSmanager );
  82. cdecl; external {$IFDEF __GPC__}name 'SDL_framerateDelay'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  83. {$EXTERNALSYM SDL_framerateDelay}
  84. {
  85. SDL_gfxPrimitives: graphics primitives for SDL
  86. LGPL (c) A. Schiffler
  87. }
  88. // Note: all ___Color routines expect the color to be in format 0xRRGGBBAA
  89. // Pixel
  90. function pixelColor( dst : PSDL_Surface; x : Sint16; y : Sint16; color : Uint32 ) : integer;
  91. cdecl; external {$IFDEF __GPC__}name 'pixelColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  92. {$EXTERNALSYM pixelColor}
  93. function pixelRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  94. cdecl; external {$IFDEF __GPC__}name 'pixelRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  95. {$EXTERNALSYM pixelRGBA}
  96. // Horizontal line
  97. function hlineColor( dst : PSDL_Surface; x1: Sint16; x2 : Sint16; y : Sint16; color : Uint32 ) : integer;
  98. cdecl; external {$IFDEF __GPC__}name 'hlineColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  99. {$EXTERNALSYM hlineColor}
  100. function hlineRGBA( dst : PSDL_Surface; x1: Sint16; x2 : Sint16; y : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  101. cdecl; external {$IFDEF __GPC__}name 'hlineRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  102. {$EXTERNALSYM hlineRGBA}
  103. // Vertical line
  104. function vlineColor( dst : PSDL_Surface; x : Sint16; y1 : Sint16; y2 : Sint16; color : Uint32 ) : integer;
  105. cdecl; external {$IFDEF __GPC__}name 'vlineColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  106. {$EXTERNALSYM vlineColor}
  107. function vlineRGBA( dst : PSDL_Surface; x : Sint16; y1 : Sint16; y2 : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  108. cdecl; external {$IFDEF __GPC__}name 'vlineRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  109. {$EXTERNALSYM vlineRGBA}
  110. // Rectangle
  111. function rectangleColor( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16; y2 : Sint16; color : Uint32 ) : integer;
  112. cdecl; external {$IFDEF __GPC__}name 'rectangleColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  113. {$EXTERNALSYM rectangleColor}
  114. function rectangleRGBA( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16;
  115. x2 : Sint16; y2 : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  116. cdecl; external {$IFDEF __GPC__}name 'rectangleRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  117. {$EXTERNALSYM rectangleRGBA}
  118. // Filled rectangle (Box)
  119. function boxColor( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16; y2 : Sint16; color : Uint32 ) : integer;
  120. cdecl; external {$IFDEF __GPC__}name 'boxColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  121. {$EXTERNALSYM boxColor}
  122. function boxRGBA( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16;
  123. y2 : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  124. cdecl; external {$IFDEF __GPC__}name 'boxRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  125. {$EXTERNALSYM boxRGBA}
  126. // Line
  127. function lineColor( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16; y2 : Sint16; color : Uint32 ) : integer;
  128. cdecl; external {$IFDEF __GPC__}name 'lineColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  129. {$EXTERNALSYM lineColor}
  130. function lineRGBA( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16;
  131. x2 : Sint16; y2 : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  132. cdecl; external {$IFDEF __GPC__}name 'lineRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  133. {$EXTERNALSYM lineRGBA}
  134. // AA Line
  135. function aalineColor( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16; y2 : Sint16; color : Uint32 ) : integer;
  136. cdecl; external {$IFDEF __GPC__}name 'aalineColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  137. {$EXTERNALSYM aalineColor}
  138. function aalineRGBA( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16;
  139. x2 : Sint16; y2 : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  140. cdecl; external {$IFDEF __GPC__}name 'aalineRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  141. {$EXTERNALSYM aalineRGBA}
  142. // Circle
  143. function circleColor( dst : PSDL_Surface; x : Sint16; y : Sint16; r : Sint16; color : Uint32 ) : integer;
  144. cdecl; external {$IFDEF __GPC__}name 'circleColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  145. {$EXTERNALSYM circleColor}
  146. function circleRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16; rad : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  147. cdecl; external {$IFDEF __GPC__}name 'circleRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  148. {$EXTERNALSYM circleRGBA}
  149. // AA Circle
  150. function aacircleColor( dst : PSDL_Surface; x : Sint16; y : Sint16; r : Sint16; color : Uint32 ) : integer;
  151. cdecl; external {$IFDEF __GPC__}name 'aacircleColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  152. {$EXTERNALSYM aacircleColor}
  153. function aacircleRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16;
  154. rad : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  155. cdecl; external {$IFDEF __GPC__}name 'aacircleRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  156. {$EXTERNALSYM aacircleRGBA}
  157. // Filled Circle
  158. function filledCircleColor( dst : PSDL_Surface; x : Sint16; y : Sint16; r : Sint16; color : Uint32 ) : integer;
  159. cdecl; external {$IFDEF __GPC__}name 'filledCircleColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  160. {$EXTERNALSYM filledCircleColor}
  161. function filledCircleRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16;
  162. rad : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  163. cdecl; external {$IFDEF __GPC__}name 'filledCircleRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  164. {$EXTERNALSYM filledCircleRGBA}
  165. // Ellipse
  166. function ellipseColor( dst : PSDL_Surface; x : Sint16; y : Sint16; rx : Sint16; ry : Sint16; color : Uint32 ) : integer;
  167. cdecl; external {$IFDEF __GPC__}name 'ellipseColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  168. {$EXTERNALSYM ellipseColor}
  169. function ellipseRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16;
  170. rx : Sint16; ry : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  171. cdecl; external {$IFDEF __GPC__}name 'ellipseRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  172. {$EXTERNALSYM ellipseRGBA}
  173. // AA Ellipse
  174. function aaellipseColor( dst : PSDL_Surface; xc : Sint16; yc : Sint16; rx : Sint16; ry : Sint16; color : Uint32 ) : integer;
  175. cdecl; external {$IFDEF __GPC__}name 'aaellipseColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  176. {$EXTERNALSYM aaellipseColor}
  177. function aaellipseRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16;
  178. rx : Sint16; ry : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  179. cdecl; external {$IFDEF __GPC__}name 'aaellipseRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  180. {$EXTERNALSYM aaellipseRGBA}
  181. // Filled Ellipse
  182. function filledEllipseColor( dst : PSDL_Surface; x : Sint16; y : Sint16; rx : Sint16; ry : Sint16; color : Uint32 ) : integer;
  183. cdecl; external {$IFDEF __GPC__}name 'filledEllipseColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  184. {$EXTERNALSYM filledEllipseColor}
  185. function filledEllipseRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16;
  186. rx : Sint16; ry : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  187. cdecl; external {$IFDEF __GPC__}name 'filledEllipseRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  188. {$EXTERNALSYM filledEllipseRGBA}
  189. // Pie
  190. function pieColor( dst : PSDL_Surface; x : Sint16; y : Sint16; rad : Sint16;
  191. start : Sint16; finish : Sint16; color : Uint32 ) : integer;
  192. cdecl; external {$IFDEF __GPC__}name 'pieColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  193. {$EXTERNALSYM pieColor}
  194. function pieRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16; rad : Sint16;
  195. start : Sint16; finish : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  196. cdecl; external {$IFDEF __GPC__}name 'pieRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  197. {$EXTERNALSYM pieRGBA}
  198. // Filled Pie
  199. function filledPieColor( dst : PSDL_Surface; x : Sint16; y : Sint16; rad : Sint16;
  200. start : Sint16; finish : Sint16; color : Uint32 ) : integer;
  201. cdecl; external {$IFDEF __GPC__}name 'filledPieColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  202. {$EXTERNALSYM filledPieColor}
  203. function filledPieRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16; rad : Sint16;
  204. start : Sint16; finish : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  205. cdecl; external {$IFDEF __GPC__}name 'filledPieRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  206. {$EXTERNALSYM filledPieRGBA}
  207. // Trigon
  208. function trigonColor( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16; y2 : Sint16; x3 : Sint16; y3 : Sint16; color : Uint32 ) : integer;
  209. cdecl; external {$IFDEF __GPC__}name 'trigonColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  210. {$EXTERNALSYM trigonColor}
  211. function trigonRGBA( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16; y2 : Sint16; x3 : Sint16; y3 : Sint16;
  212. r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  213. cdecl; external {$IFDEF __GPC__}name 'trigonRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  214. {$EXTERNALSYM trigonRGBA}
  215. // AA-Trigon
  216. function aatrigonColor( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16; y2 : Sint16; x3 : Sint16; y3 : Sint16; color : Uint32 ) : integer;
  217. cdecl; external {$IFDEF __GPC__}name 'aatrigonColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  218. {$EXTERNALSYM aatrigonColor}
  219. function aatrigonRGBA( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16; y2 : Sint16; x3 : Sint16; y3 : Sint16;
  220. r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  221. cdecl; external {$IFDEF __GPC__}name 'aatrigonRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  222. {$EXTERNALSYM aatrigonRGBA}
  223. // Filled Trigon
  224. function filledTrigonColor( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16; y2 : Sint16; x3 : Sint16; y3 : Sint16; color : Uint32 ) : integer;
  225. cdecl; external {$IFDEF __GPC__}name 'filledTrigonColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  226. {$EXTERNALSYM filledTrigonColor}
  227. function filledTrigonRGBA( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16; y2 : Sint16; x3 : Sint16; y3 : Sint16;
  228. r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  229. cdecl; external {$IFDEF __GPC__}name 'filledTrigonRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  230. {$EXTERNALSYM filledTrigonRGBA}
  231. // Polygon
  232. function polygonColor( dst : PSDL_Surface; const vx : PSint16; const vy : PSint16; n : integer; color : Uint32 ) : integer;
  233. cdecl; external {$IFDEF __GPC__}name 'polygonColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  234. {$EXTERNALSYM polygonColor}
  235. function polygonRGBA( dst : PSDL_Surface; const vx : PSint16; const vy : PSint16;
  236. n : integer; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  237. cdecl; external {$IFDEF __GPC__}name 'polygonRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  238. {$EXTERNALSYM polygonRGBA}
  239. // AA-Polygon
  240. function aapolygonColor( dst : PSDL_Surface; const vx : PSint16; const vy : PSint16; n : integer; color : Uint32 ) : integer;
  241. cdecl; external {$IFDEF __GPC__}name 'aapolygonColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  242. {$EXTERNALSYM aapolygonColor}
  243. function aapolygonRGBA( dst : PSDL_Surface; const vx : PSint16; const vy : PSint16;
  244. n : integer; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  245. cdecl; external {$IFDEF __GPC__}name 'aapolygonRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  246. {$EXTERNALSYM aapolygonRGBA}
  247. // Filled Polygon
  248. function filledPolygonColor( dst : PSDL_Surface; const vx : PSint16; const vy : PSint16; n : integer; color : Uint32 ) : integer;
  249. cdecl; external {$IFDEF __GPC__}name 'filledPolygonColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  250. {$EXTERNALSYM filledPolygonColor}
  251. function filledPolygonRGBA( dst : PSDL_Surface; const vx : PSint16;
  252. const vy : PSint16; n : integer; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  253. cdecl; external {$IFDEF __GPC__}name 'filledPolygonRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  254. {$EXTERNALSYM filledPolygonRGBA}
  255. // Bezier
  256. // s = number of steps
  257. function bezierColor( dst : PSDL_Surface; const vx : PSint16; const vy : PSint16; n : integer; s : integer; color : Uint32 ) : integer;
  258. cdecl; external {$IFDEF __GPC__}name 'bezierColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  259. {$EXTERNALSYM bezierColor}
  260. function bezierRGBA( dst : PSDL_Surface; const vx : PSint16; const vy : PSint16;
  261. n : integer; s : integer; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  262. cdecl; external {$IFDEF __GPC__}name 'bezierRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  263. {$EXTERNALSYM bezierRGBA}
  264. // Characters/Strings
  265. function characterColor( dst : PSDL_Surface; x : Sint16; y : Sint16; c : AnsiChar; color : Uint32 ) : integer;
  266. cdecl; external {$IFDEF __GPC__}name 'characterColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  267. {$EXTERNALSYM characterColor}
  268. function characterRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16; c : AnsiChar; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  269. cdecl; external {$IFDEF __GPC__}name 'characterRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  270. {$EXTERNALSYM characterRGBA}
  271. function stringColor( dst : PSDL_Surface; x : Sint16; y : Sint16; const c : PAnsiChar; color : Uint32 ) : integer;
  272. cdecl; external {$IFDEF __GPC__}name 'stringColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  273. {$EXTERNALSYM stringColor}
  274. function stringRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16; const c : PAnsiChar; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  275. cdecl; external {$IFDEF __GPC__}name 'stringRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  276. {$EXTERNALSYM stringRGBA}
  277. procedure gfxPrimitivesSetFont(const fontdata : Pointer; cw : integer; ch : integer );
  278. cdecl; external {$IFDEF __GPC__}name 'gfxPrimitivesSetFont'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  279. {$EXTERNALSYM gfxPrimitivesSetFont}
  280. {
  281. SDL_imageFilter - bytes-image "filter" routines
  282. (uses inline x86 MMX optimizations if available)
  283. LGPL (c) A. Schiffler
  284. }
  285. { Comments: }
  286. { 1.) MMX functions work best if all data blocks are aligned on a 32 bytes boundary. }
  287. { 2.) Data that is not within an 8 byte boundary is processed using the C routine. }
  288. { 3.) Convolution routines do not have C routines at this time. }
  289. // Detect MMX capability in CPU
  290. function SDL_imageFilterMMXdetect : integer;
  291. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterMMXdetect'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  292. {$EXTERNALSYM SDL_imageFilterMMXdetect}
  293. // Force use of MMX off (or turn possible use back on)
  294. procedure SDL_imageFilterMMXoff;
  295. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterMMXoff'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  296. {$EXTERNALSYM SDL_imageFilterMMXoff}
  297. procedure SDL_imageFilterMMXon;
  298. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterMMXon'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  299. {$EXTERNALSYM SDL_imageFilterMMXon}
  300. //
  301. // All routines return:
  302. // 0 OK
  303. // -1 Error (internal error, parameter error)
  304. //
  305. // SDL_imageFilterAdd: D = saturation255(S1 + S2)
  306. function SDL_imageFilterAdd(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar; length : integer ) : integer;
  307. cdecl; external {$IFDEF __GPC__}name 'SDL_imaSDL_imageFilterAddgeFilterMMXon'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  308. {$EXTERNALSYM SDL_imageFilterAdd}
  309. // SDL_imageFilterMean: D = S1/2 + S2/2
  310. function SDL_imageFilterMean(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar; length : integer ) : integer;
  311. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterMean'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  312. {$EXTERNALSYM SDL_imageFilterMean}
  313. // SDL_imageFilterSub: D = saturation0(S1 - S2)
  314. function SDL_imageFilterSub(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar; length : integer ) : integer;
  315. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterSub'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  316. {$EXTERNALSYM SDL_imageFilterSub}
  317. // SDL_imageFilterAbsDiff: D = | S1 - S2 |
  318. function SDL_imageFilterAbsDiff(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar; length : integer ) : integer;
  319. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterAbsDiff'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  320. {$EXTERNALSYM SDL_imageFilterAbsDiff}
  321. // SDL_imageFilterMult: D = saturation(S1 * S2)
  322. function SDL_imageFilterMult(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar; length : integer ) : integer;
  323. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterMult'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  324. {$EXTERNALSYM SDL_imageFilterMult}
  325. // SDL_imageFilterMultNor: D = S1 * S2 (non-MMX)
  326. function SDL_imageFilterMultNor(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar; length : integer ) : integer;
  327. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterMultNor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  328. {$EXTERNALSYM SDL_imageFilterMultNor}
  329. // SDL_imageFilterMultDivby2: D = saturation255(S1/2 * S2)
  330. function SDL_imageFilterMultDivby2(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar;
  331. length : integer ) : integer;
  332. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterMultDivby2'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  333. {$EXTERNALSYM SDL_imageFilterMultDivby2}
  334. // SDL_imageFilterMultDivby4: D = saturation255(S1/2 * S2/2)
  335. function SDL_imageFilterMultDivby4(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar;
  336. length : integer ) : integer;
  337. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterMultDivby4'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  338. {$EXTERNALSYM SDL_imageFilterMultDivby4}
  339. // SDL_imageFilterBitAnd: D = S1 & S2
  340. function SDL_imageFilterBitAnd(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar; length : integer ) : integer;
  341. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterBitAnd'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  342. {$EXTERNALSYM SDL_imageFilterBitAnd}
  343. // SDL_imageFilterBitOr: D = S1 | S2
  344. function SDL_imageFilterBitOr(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar; length : integer ) : integer;
  345. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterBitOr'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  346. {$EXTERNALSYM SDL_imageFilterBitOr}
  347. // SDL_imageFilterDiv: D = S1 / S2 (non-MMX)
  348. function SDL_imageFilterDiv(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar; length : integer ) : integer;
  349. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterDiv'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  350. {$EXTERNALSYM SDL_imageFilterDiv}
  351. // SDL_imageFilterBitNegation: D = !S
  352. function SDL_imageFilterBitNegation(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer ) : integer;
  353. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterBitNegation'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  354. {$EXTERNALSYM SDL_imageFilterBitNegation}
  355. // SDL_imageFilterAddByte: D = saturation255(S + C)
  356. function SDL_imageFilterAddByte(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer; C : AnsiChar ) : integer;
  357. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterAddByte'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  358. {$EXTERNALSYM SDL_imageFilterAddByte}
  359. // SDL_imageFilterAddUint: D = saturation255(S + (uint)C)
  360. function SDL_imageFilterAddUint(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer; C : Cardinal ) : integer;
  361. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterAddUint'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  362. {$EXTERNALSYM SDL_imageFilterAddUint}
  363. // SDL_imageFilterAddByteToHalf: D = saturation255(S/2 + C)
  364. function SDL_imageFilterAddByteToHalf(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer;
  365. C : AnsiChar ) : integer;
  366. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterAddByteToHalf'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  367. {$EXTERNALSYM SDL_imageFilterAddByteToHalf}
  368. // SDL_imageFilterSubByte: D = saturation0(S - C)
  369. function SDL_imageFilterSubByte(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer; C : AnsiChar ) : integer;
  370. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterSubByte'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  371. {$EXTERNALSYM SDL_imageFilterSubByte}
  372. // SDL_imageFilterSubUint: D = saturation0(S - (uint)C)
  373. function SDL_imageFilterSubUint(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer; C : Cardinal ) : integer;
  374. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterSubUint'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  375. {$EXTERNALSYM SDL_imageFilterSubUint}
  376. // SDL_imageFilterShiftRight: D = saturation0(S >> N)
  377. function SDL_imageFilterShiftRight(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer; N : AnsiChar ) : integer;
  378. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterShiftRight'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  379. {$EXTERNALSYM SDL_imageFilterShiftRight}
  380. // SDL_imageFilterShiftRightUint: D = saturation0((uint)S >> N)
  381. function SDL_imageFilterShiftRightUint(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer; N : AnsiChar ) : integer;
  382. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterShiftRightUint'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  383. {$EXTERNALSYM SDL_imageFilterShiftRightUint}
  384. // SDL_imageFilterMultByByte: D = saturation255(S * C)
  385. function SDL_imageFilterMultByByte(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer; C : AnsiChar ) : integer;
  386. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterMultByByte'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  387. {$EXTERNALSYM SDL_imageFilterMultByByte}
  388. // SDL_imageFilterShiftRightAndMultByByte: D = saturation255((S >> N) * C)
  389. function SDL_imageFilterShiftRightAndMultByByte(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer;
  390. N : AnsiChar; C : AnsiChar ) : integer;
  391. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterShiftRightAndMultByByte'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  392. {$EXTERNALSYM SDL_imageFilterShiftRightAndMultByByte}
  393. // SDL_imageFilterShiftLeftByte: D = (S << N)
  394. function SDL_imageFilterShiftLeftByte(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer;
  395. N : AnsiChar ) : integer;
  396. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterShiftLeftByte'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  397. {$EXTERNALSYM SDL_imageFilterShiftLeftByte}
  398. // SDL_imageFilterShiftLeftUint: D = ((uint)S << N)
  399. function SDL_imageFilterShiftLeftUint(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer;
  400. N : AnsiChar ) : integer;
  401. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterShiftLeftUint'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  402. {$EXTERNALSYM SDL_imageFilterShiftLeftUint}
  403. // SDL_imageFilterShiftLeft: D = saturation255(S << N)
  404. function SDL_imageFilterShiftLeft(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer; N : AnsiChar ) : integer;
  405. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterShiftLeft'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  406. {$EXTERNALSYM SDL_imageFilterShiftLeft}
  407. // SDL_imageFilterBinarizeUsingThreshold: D = S >= T ? 255:0
  408. function SDL_imageFilterBinarizeUsingThreshold(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer;
  409. T : AnsiChar ) : integer;
  410. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterBinarizeUsingThreshold'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  411. {$EXTERNALSYM SDL_imageFilterBinarizeUsingThreshold}
  412. // SDL_imageFilterClipToRange: D = (S >= Tmin) & (S <= Tmax) 255:0
  413. function SDL_imageFilterClipToRange(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer;
  414. Tmin : Byte; Tmax : Byte ) : integer;
  415. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterClipToRange'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  416. {$EXTERNALSYM SDL_imageFilterClipToRange}
  417. // SDL_imageFilterNormalizeLinear: D = saturation255((Nmax - Nmin)/(Cmax - Cmin)*(S - Cmin) + Nmin)
  418. function SDL_imageFilterNormalizeLinear(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer; Cmin : integer;
  419. Cmax : integer; Nmin : integer; Nmax : integer ) : integer;
  420. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterClipToRange'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  421. {$EXTERNALSYM SDL_imageFilterClipToRange}
  422. { !!! NO C-ROUTINE FOR THESE FUNCTIONS YET !!! }
  423. // SDL_imageFilterConvolveKernel3x3Divide: Dij = saturation0and255( ... )
  424. function SDL_imageFilterConvolveKernel3x3Divide(Src : PAnsiChar; Dest : PAnsiChar; rows : integer;
  425. columns : integer; Kernel : PShortInt; Divisor : Byte ) : integer;
  426. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterConvolveKernel3x3Divide'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  427. {$EXTERNALSYM SDL_imageFilterConvolveKernel3x3Divide}
  428. // SDL_imageFilterConvolveKernel5x5Divide: Dij = saturation0and255( ... )
  429. function SDL_imageFilterConvolveKernel5x5Divide(Src : PAnsiChar; Dest : PAnsiChar; rows : integer;
  430. columns : integer; Kernel : PShortInt; Divisor : Byte ) : integer;
  431. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterConvolveKernel5x5Divide'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  432. {$EXTERNALSYM SDL_imageFilterConvolveKernel5x5Divide}
  433. // SDL_imageFilterConvolveKernel7x7Divide: Dij = saturation0and255( ... )
  434. function SDL_imageFilterConvolveKernel7x7Divide(Src : PAnsiChar; Dest : PAnsiChar; rows : integer;
  435. columns : integer; Kernel : PShortInt; Divisor : Byte ) : integer;
  436. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterConvolveKernel7x7Divide'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  437. {$EXTERNALSYM SDL_imageFilterConvolveKernel7x7Divide}
  438. // SDL_imageFilterConvolveKernel9x9Divide: Dij = saturation0and255( ... )
  439. function SDL_imageFilterConvolveKernel9x9Divide(Src : PAnsiChar; Dest : PAnsiChar; rows : integer;
  440. columns : integer; Kernel : PShortInt; Divisor : Byte ) : integer;
  441. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterConvolveKernel9x9Divide'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  442. {$EXTERNALSYM SDL_imageFilterConvolveKernel9x9Divide}
  443. // SDL_imageFilterConvolveKernel3x3ShiftRight: Dij = saturation0and255( ... )
  444. function SDL_imageFilterConvolveKernel3x3ShiftRight(Src : PAnsiChar; Dest : PAnsiChar; rows : integer;
  445. columns : integer; Kernel : PShortInt;
  446. NRightShift : AnsiChar ) : integer;
  447. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterConvolveKernel3x3ShiftRight'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  448. {$EXTERNALSYM SDL_imageFilterConvolveKernel3x3ShiftRight}
  449. // SDL_imageFilterConvolveKernel5x5ShiftRight: Dij = saturation0and255( ... )
  450. function SDL_imageFilterConvolveKernel5x5ShiftRight(Src : PAnsiChar; Dest : PAnsiChar; rows : integer;
  451. columns : integer; Kernel : PShortInt;
  452. NRightShift : AnsiChar ) : integer;
  453. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterConvolveKernel5x5ShiftRight'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  454. {$EXTERNALSYM SDL_imageFilterConvolveKernel5x5ShiftRight}
  455. // SDL_imageFilterConvolveKernel7x7ShiftRight: Dij = saturation0and255( ... )
  456. function SDL_imageFilterConvolveKernel7x7ShiftRight(Src : PAnsiChar; Dest : PAnsiChar; rows : integer;
  457. columns : integer; Kernel : PShortInt;
  458. NRightShift : AnsiChar ) : integer;
  459. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterConvolveKernel7x7ShiftRight'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  460. {$EXTERNALSYM SDL_imageFilterConvolveKernel7x7ShiftRight}
  461. // SDL_imageFilterConvolveKernel9x9ShiftRight: Dij = saturation0and255( ... )
  462. function SDL_imageFilterConvolveKernel9x9ShiftRight(Src : PAnsiChar; Dest : PAnsiChar; rows : integer;
  463. columns : integer; Kernel : PShortInt;
  464. NRightShift : AnsiChar ) : integer;
  465. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterConvolveKernel9x9ShiftRight'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  466. {$EXTERNALSYM SDL_imageFilterConvolveKernel9x9ShiftRight}
  467. // SDL_imageFilterSobelX: Dij = saturation255( ... )
  468. function SDL_imageFilterSobelX(Src : PAnsiChar; Dest : PAnsiChar; rows : integer; columns : integer ) : integer;
  469. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterSobelX'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  470. {$EXTERNALSYM SDL_imageFilterSobelX}
  471. // SDL_imageFilterSobelXShiftRight: Dij = saturation255( ... )
  472. function SDL_imageFilterSobelXShiftRight(Src : PAnsiChar; Dest : PAnsiChar; rows : integer; columns : integer;
  473. NRightShift : AnsiChar ) : integer;
  474. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterSobelXShiftRight'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  475. {$EXTERNALSYM SDL_imageFilterSobelXShiftRight}
  476. // Align/restore stack to 32 byte boundary -- Functionality untested! --
  477. procedure SDL_imageFilterAlignStack;
  478. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterAlignStack'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  479. {$EXTERNALSYM SDL_imageFilterAlignStack}
  480. procedure SDL_imageFilterRestoreStack;
  481. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterRestoreStack'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  482. {$EXTERNALSYM SDL_imageFilterRestoreStack}
  483. {
  484. SDL_rotozoom - rotozoomer
  485. LGPL (c) A. Schiffler
  486. }
  487. {
  488. rotozoomSurface()
  489. Rotates and zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface.
  490. 'angle' is the rotation in degrees. 'zoom' a scaling factor. If 'smooth' is 1
  491. then the destination 32bit surface is anti-aliased. If the surface is not 8bit
  492. or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.
  493. }
  494. function rotozoomSurface( src : PSDL_Surface; angle : double; zoom : double; smooth : integer ) : PSDL_Surface;
  495. cdecl; external {$IFDEF __GPC__}name 'rotozoomSurface'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  496. {$EXTERNALSYM rotozoomSurface}
  497. function rotozoomSurfaceXY( src : PSDL_Surface; angle : double; zoomx : double; zoomy : double; smooth : integer ) : PSDL_Surface;
  498. cdecl; external {$IFDEF __GPC__}name 'rotozoomSurfaceXY'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  499. {$EXTERNALSYM rotozoomSurfaceXY}
  500. { Returns the size of the target surface for a rotozoomSurface() call }
  501. procedure rotozoomSurfaceSize( width : integer; height : integer; angle : double; zoom : double; var dstwidth : integer;
  502. var dstheight : integer );
  503. cdecl; external {$IFDEF __GPC__}name 'rotozoomSurfaceSize'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  504. {$EXTERNALSYM rotozoomSurfaceSize}
  505. procedure rotozoomSurfaceSizeXY
  506. ( width : integer; height : integer; angle : double; zoomx : double; zoomy : double;
  507. var dstwidth : integer; var dstheight : integer );
  508. cdecl; external {$IFDEF __GPC__}name 'rotozoomSurfaceSizeXY'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  509. {$EXTERNALSYM rotozoomSurfaceSizeXY}
  510. {
  511. zoomSurface()
  512. Zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface.
  513. 'zoomx' and 'zoomy' are scaling factors for width and height. If 'smooth' is 1
  514. then the destination 32bit surface is anti-aliased. If the surface is not 8bit
  515. or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.
  516. }
  517. function zoomSurface(src : PSDL_Surface; zoomx : double; zoomy : double; smooth : integer ) : PSDL_Surface;
  518. cdecl; external {$IFDEF __GPC__}name 'zoomSurface'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  519. {$EXTERNALSYM zoomSurface}
  520. { Returns the size of the target surface for a zoomSurface() call }
  521. procedure zoomSurfaceSize( width : integer; height : integer; zoomx : double; zoomy : double; var dstwidth : integer; var dstheight : integer );
  522. cdecl; external {$IFDEF __GPC__}name 'zoomSurfaceSize'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  523. {$EXTERNALSYM zoomSurfaceSize}
  524. {$ENDIF MORPHOS}
  525. implementation
  526. end.