cybergraphics.pas 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. {
  2. This file is part of the Free Pascal MorphOS support package
  3. Copyright (c) 2015 Karoly Balogh
  4. member of the Free Pascal Development Team
  5. cybergraphics.library interface unit
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. {$mode fpc}
  13. {$packrecords 2}
  14. {$IFNDEF FPC_DOTTEDUNITS}
  15. UNIT CYBERGRAPHICS;
  16. {$ENDIF FPC_DOTTEDUNITS}
  17. INTERFACE
  18. {$IFDEF FPC_DOTTEDUNITS}
  19. USES
  20. Amiga.Core.Exec,Amiga.Core.Agraphics,Amiga.Core.Utility;
  21. {$ELSE FPC_DOTTEDUNITS}
  22. USES
  23. exec,agraphics,utility;
  24. {$ENDIF FPC_DOTTEDUNITS}
  25. VAR CyberGfxBase : pLibrary = nil;
  26. const
  27. CYBERGRAPHICSNAME : PAnsiChar = 'cybergraphics.library';
  28. {
  29. Contents of this file is based on cybergraphics.h from the MorphOS SDK:
  30. $VER: cybergraphics.h 50.12 (13.08.2008)
  31. include file for cybergraphics.library
  32. Copyright (c) 1996-2008 by Vision Factory Development
  33. All Rights reserved.
  34. }
  35. const
  36. CYBERGFXNAME = 'cybergraphics.library';
  37. CYBERGFX_INCLUDE_VERSION = 41;
  38. {
  39. Definition of CyberModeNode (Returned in AllocModeList)
  40. }
  41. type
  42. PCyberModeNode = ^tCyberModeNode;
  43. tCyberModeNode = record
  44. Node : tNode;
  45. ModeText : array[0..(DISPLAYNAMELEN)-1] of AnsiChar; { name for this mode }
  46. DisplayID : ULONG; { display id associated with the node }
  47. Width : UWORD; { visible width }
  48. Height : UWORD; { visible height }
  49. Depth : UWORD; { display depth }
  50. DisplayTagList : PTagItem; { taglist with extended ModeID information }
  51. end;
  52. {
  53. Parameters for GetCyberMapAttr()
  54. }
  55. const
  56. { function returns BytesPerRow if its called with this parameter }
  57. CYBRMATTR_XMOD = $80000001;
  58. { BytesPerPixel shall be returned }
  59. CYBRMATTR_BPPIX = $80000002;
  60. { do not use this ! private tag }
  61. CYBRMATTR_DISPADR = $80000003;
  62. { the pixel format is returned }
  63. CYBRMATTR_PIXFMT = $80000004;
  64. { returns width in pixels }
  65. CYBRMATTR_WIDTH = $80000005;
  66. { returns height in lines }
  67. CYBRMATTR_HEIGHT = $80000006;
  68. { returns bits per pixel }
  69. CYBRMATTR_DEPTH = $80000007;
  70. { returns -1 if supplied bitmap is a cybergfx one }
  71. CYBRMATTR_ISCYBERGFX = $80000008;
  72. { returns -1 if supplied bitmap is linear accessable }
  73. CYBRMATTR_ISLINEARMEM = $80000009;
  74. { returns colormap associated with that bitmap (v50) }
  75. CYBRMATTR_COLORMAP = $8000000A;
  76. {
  77. Parameters for GetCyberIDAttr()
  78. }
  79. { the pixel format is returned }
  80. CYBRIDATTR_PIXFMT = $80000001;
  81. { returns visible width in pixels }
  82. CYBRIDATTR_WIDTH = $80000002;
  83. { returns visible height in lines }
  84. CYBRIDATTR_HEIGHT = $80000003;
  85. { returns bits per pixel }
  86. CYBRIDATTR_DEPTH = $80000004;
  87. { BytesPerPixel shall be returned }
  88. CYBRIDATTR_BPPIX = $80000005;
  89. {
  90. Tags for CyberModeRequest()
  91. }
  92. CYBRMREQ_TB = TAG_USER + $40000;
  93. {
  94. FilterTags
  95. }
  96. { Minimum depth for displayed screenmode }
  97. CYBRMREQ_MinDepth = CYBRMREQ_TB + 0;
  98. { Maximum depth " " " }
  99. CYBRMREQ_MaxDepth = CYBRMREQ_TB + 1;
  100. { Minumum width " " " }
  101. CYBRMREQ_MinWidth = CYBRMREQ_TB + 2;
  102. { Maximum width " " " }
  103. CYBRMREQ_MaxWidth = CYBRMREQ_TB + 3;
  104. { Minumum height " " " }
  105. CYBRMREQ_MinHeight = CYBRMREQ_TB + 4;
  106. { Minumum height " " " }
  107. CYBRMREQ_MaxHeight = CYBRMREQ_TB + 5;
  108. CYBRMREQ_CModelArray = CYBRMREQ_TB + 6;
  109. CYBRMREQ_WinTitle = CYBRMREQ_TB + 20;
  110. CYBRMREQ_OKText = CYBRMREQ_TB + 21;
  111. CYBRMREQ_CancelText = CYBRMREQ_TB + 22;
  112. { Screen you wish the Requester to open on }
  113. CYBRMREQ_Screen = CYBRMREQ_TB + 30;
  114. {
  115. Tags for BestCyberModeID()
  116. }
  117. CYBRBIDTG_TB = TAG_USER + $50000;
  118. { FilterTags }
  119. CYBRBIDTG_Depth = CYBRBIDTG_TB + 0;
  120. CYBRBIDTG_NominalWidth = CYBRBIDTG_TB + 1;
  121. CYBRBIDTG_NominalHeight = CYBRBIDTG_TB + 2;
  122. CYBRBIDTG_MonitorID = CYBRBIDTG_TB + 3;
  123. CYBRBIDTG_BoardName = CYBRBIDTG_TB + 5;
  124. {
  125. definition of divers pixel formats
  126. }
  127. PIXFMT_LUT8 = 0;
  128. PIXFMT_RGB15 = 1;
  129. PIXFMT_RGB15X = 2;
  130. PIXFMT_BGR15 = 2;
  131. PIXFMT_RGB15PC = 3;
  132. PIXFMT_BGR15PC = 4;
  133. PIXFMT_RGB16 = 5;
  134. PIXFMT_BGR16 = 6;
  135. PIXFMT_RGB16PC = 7;
  136. PIXFMT_BGR16PC = 8;
  137. PIXFMT_RGB24 = 9;
  138. PIXFMT_BGR24 = 10;
  139. PIXFMT_ARGB32 = 11;
  140. PIXFMT_BGRA32 = 12;
  141. PIXFMT_RGBA32 = 13;
  142. {
  143. SrcRectangle formats defines for xxxPixelArray calls()
  144. }
  145. RECTFMT_RGB = 0;
  146. RECTFMT_RGBA = 1;
  147. RECTFMT_ARGB = 2;
  148. RECTFMT_LUT8 = 3;
  149. RECTFMT_GREY8 = 4;
  150. RECTFMT_RAW = 5;
  151. {
  152. Parameters for CVideoCtrlTagList()
  153. }
  154. SETVC_DPMSLevel = $88002001;
  155. { Full operation }
  156. DPMS_ON = 0;
  157. { Optional state of minimal power reduction }
  158. DPMS_STANDBY = 1;
  159. { Significant reduction of power consumption }
  160. DPMS_SUSPEND = 2;
  161. { Lowest level of power consumption }
  162. DPMS_OFF = 3;
  163. {
  164. Tags for LockBitMapTagList()
  165. }
  166. LBMI_WIDTH = $84001001;
  167. LBMI_HEIGHT = $84001002;
  168. LBMI_DEPTH = $84001003;
  169. LBMI_PIXFMT = $84001004;
  170. LBMI_BYTESPERPIX = $84001005;
  171. LBMI_BYTESPERROW = $84001006;
  172. LBMI_BASEADDRESS = $84001007;
  173. {
  174. Tags for UnLockBitMapTagList()
  175. }
  176. UBMI_UPDATERECTS = $85001001;
  177. UBMI_REALLYUNLOCK = $85001002;
  178. {
  179. Message passed to the DoCDrawMethodTagList() hook function
  180. }
  181. type
  182. PCDrawMsg = ^tCDrawMsg;
  183. tCDrawMsg = record
  184. cdm_MemPtr : APTR;
  185. cdm_offx : ULONG;
  186. cdm_offy : ULONG;
  187. cdm_xsize : ULONG;
  188. cdm_ysize : ULONG;
  189. cdm_BytesPerRow : UWORD;
  190. cdm_BytesPerPix : UWORD;
  191. cdm_ColorModel : UWORD;
  192. end;
  193. {
  194. Colour Table source formats for WriteLUTPixelArray()
  195. }
  196. { ULONG [] table }
  197. const
  198. CTABFMT_XRGB8 = 0;
  199. {
  200. graphics.library/AllocBitMap() extended flags
  201. }
  202. BMB_SPECIALFMT = 7;
  203. BMF_SPECIALFMT = 1 shl BMB_SPECIALFMT;
  204. BMF_REQUESTVMEM = (BMF_MINPLANES or BMF_DISPLAYABLE);
  205. BMB_ROOTMAP = 5;
  206. BMF_ROOTMAP = 1 shl BMB_ROOTMAP;
  207. BMB_3DTARGET = 8;
  208. BMF_3DTARGET = 1 shl BMB_3DTARGET;
  209. {*
  210. * Operations for ProcessPixelArray() (v50)
  211. *
  212. *}
  213. const
  214. POP_BRIGHTEN = 0;
  215. POP_DARKEN = 1;
  216. POP_SETALPHA = 2;
  217. POP_TINT = 3;
  218. POP_BLUR = 4;
  219. POP_COLOR2GREY = 5;
  220. POP_NEGATIVE = 6;
  221. POP_NEGFADE = 7;
  222. POP_TINTFADE = 8;
  223. POP_GRADIENT = 9;
  224. POP_SHIFTRGB = 10;
  225. {*
  226. * Values for POP_SHIFTRGB
  227. *
  228. *}
  229. const
  230. RGBSHIFT_BGR = 1;
  231. RGBSHIFT_BRG = 2;
  232. RGBSHIFT_GBR = 3;
  233. RGBSHIFT_GRB = 4;
  234. RGBSHIFT_RBG = 5;
  235. {*
  236. * Tags for ProcessPixelArray() ops
  237. *
  238. *}
  239. const
  240. PPAOPTAG_FADEFULLSCALE = $85231020;
  241. PPAOPTAG_FADEOFFSET = $85231021;
  242. PPAOPTAG_GRADIENTTYPE = $85231022;
  243. GRADTYPE_HORIZONTAL = 0;
  244. GRADTYPE_VERTICAL = 1;
  245. {* yet unsupported gradient types follow *}
  246. GRADTYPE_RECTANGLE = 2;
  247. GRADTYPE_LINEAR_ANGLE = 3;
  248. GRADTYPE_RADIAL = 4; {* "circle" center-based *}
  249. GRADIENT_NUMTYPES = 2;
  250. PPAOPTAG_GRADCOLOR1 = $85231023;
  251. PPAOPTAG_GRADCOLOR2 = $85231024;
  252. PPAOPTAG_GRADFULLSCALE = PPAOPTAG_FADEFULLSCALE;
  253. PPAOPTAG_GRADOFFSET = PPAOPTAG_FADEOFFSET;
  254. PPAOPTAG_RGBMASK = $85231025;
  255. PPAOPTAG_GRADSYMCENTER = $85231026;
  256. {*
  257. * Tags for BltBitMap(RastPort)Alpha() (v50)
  258. *
  259. *}
  260. const
  261. BLTBMA_MIXLEVEL = $88802000; {* from 0(0%) to 0xFFFFFFFF (100%) *}
  262. BLTBMA_USESOURCEALPHA = $88802001;
  263. BLTBMA_GLOBALALPHA = BLTBMA_MIXLEVEL;
  264. BLTBMA_DESTALPHAVALUE = $88802002;
  265. DESTALPHAVALUE_UNDEFINED = 0; {* default *}
  266. DESTALPHAVALUE_ONE = 1;
  267. DESTALPHAVALUE_USESOURCE = 2;
  268. DESTALPHAVALUE_USEDEST = 3;
  269. FUNCTION AllocCModeListTagList(ModeListTags : pTagItem location 'a1') : pList; syscall CyberGfxBase 072;
  270. FUNCTION BestCModeIDTagList(BestModeIDTags : pTagItem location 'a0') : longword; syscall CyberGfxBase 060;
  271. FUNCTION CModeRequestTagList(ModeRequest : POINTER location 'a0'; ModeRequestTags : pTagItem location 'a1') : longword; syscall CyberGfxBase 066;
  272. PROCEDURE CVideoCtrlTagList(ViewPort : pViewPort location 'a0'; TagList : pTagItem location 'a1'); syscall CyberGfxBase 162;
  273. PROCEDURE DoCDrawMethodTagList(Hook : pHook location 'a0'; a1arg : pRastPort location 'a1'; TagList : pTagItem location 'a2'); syscall CyberGfxBase 156;
  274. FUNCTION ExtractColor(a0arg : pRastPort location 'a0'; BitMap : pBitMap location 'a1'; Colour : longword location 'd0'; SrcX : longword location 'd1'; SrcY : longword location 'd2'; Width : longword location 'd3'; Height : longword location 'd4') : longword; syscall CyberGfxBase 186;
  275. FUNCTION FillPixelArray(a1arg : pRastPort location 'a1'; DestX : WORD location 'd0'; DestY : WORD location 'd1'; SizeX : WORD location 'd2'; SizeY : WORD location 'd3'; ARGB : longword location 'd4') : longword; syscall CyberGfxBase 150;
  276. PROCEDURE FreeCModeList(ModeList : pList location 'a0'); syscall CyberGfxBase 078;
  277. FUNCTION GetCyberIDAttr(CyberIDAttr : longword location 'd0'; CyberDisplayModeID : longword location 'd1') : longword; syscall CyberGfxBase 102;
  278. FUNCTION GetCyberMapAttr(CyberGfxBitmap : pBitMap location 'a0'; CyberAttrTag : longword location 'd0') : longword; syscall CyberGfxBase 096;
  279. FUNCTION InvertPixelArray(a1arg : pRastPort location 'a1'; DestX : WORD location 'd0'; DestY : WORD location 'd1'; SizeX : WORD location 'd2'; SizeY : WORD location 'd3') : longword; syscall CyberGfxBase 144;
  280. FUNCTION IsCyberModeID(displayID : longword location 'd0') : wordbool; syscall CyberGfxBase 054;
  281. FUNCTION LockBitMapTagList(BitMap : POINTER location 'a0'; TagList : pTagItem location 'a1') : POINTER; syscall CyberGfxBase 168;
  282. FUNCTION MovePixelArray(SrcX : WORD location 'd0'; SrcY : WORD location 'd1'; a1arg : pRastPort location 'a1'; DestX : WORD location 'd2'; DestY : WORD location 'd3'; SizeX : WORD location 'd4'; SizeY : WORD location 'd5') : longword; syscall CyberGfxBase 132;
  283. FUNCTION ReadPixelArray(destRect : POINTER location 'a0'; destX : WORD location 'd0'; destY : WORD location 'd1'; destMod : WORD location 'd2'; a1arg : pRastPort location 'a1'; SrcX : WORD location 'd3'; SrcY : WORD location 'd4'; SizeX : WORD location 'd5'; SizeY : WORD location 'd6'; DestFormat : byte location 'd7') : longword; syscall CyberGfxBase 120;
  284. FUNCTION ReadRGBPixel(a1arg : pRastPort location 'a1'; x : WORD location 'd0'; y : WORD location 'd1') : longword; syscall CyberGfxBase 108;
  285. FUNCTION ScalePixelArray(srcRect : POINTER location 'a0'; SrcW : WORD location 'd0'; SrcH : WORD location 'd1'; SrcMod : WORD location 'd2'; a1arg : pRastPort location 'a1'; DestX : WORD location 'd3'; DestY : WORD location 'd4'; DestW : WORD location 'd5'; DestH : WORD location 'd6'; SrcFormat : byte location 'd7') : LONGINT; syscall CyberGfxBase 090;
  286. PROCEDURE UnLockBitMap(Handle : POINTER location 'a0'); syscall CyberGfxBase 174;
  287. PROCEDURE UnLockBitMapTagList(Handle : POINTER location 'a0'; TagList : pTagItem location 'a1'); syscall CyberGfxBase 180;
  288. FUNCTION WriteLUTPixelArray(srcRect : POINTER location 'a0'; SrcX : WORD location 'd0'; SrcY : WORD location 'd1'; SrcMod : WORD location 'd2'; a1arg : pRastPort location 'a1'; ColorTab : POINTER location 'a2'; DestX : WORD location 'd3'; DestY : WORD location 'd4'; SizeX : WORD location 'd5'; SizeY : WORD location 'd6'; CTFormat : byte location 'd7') : longword; syscall CyberGfxBase 198;
  289. FUNCTION WritePixelArray(srcRect : POINTER location 'a0'; SrcX : WORD location 'd0'; SrcY : WORD location 'd1'; SrcMod : WORD location 'd2'; a1arg : pRastPort location 'a1'; DestX : WORD location 'd3'; DestY : WORD location 'd4'; SizeX : WORD location 'd5'; SizeY : WORD location 'd6'; SrcFormat : byte location 'd7') : longword; syscall CyberGfxBase 126;
  290. FUNCTION WriteRGBPixel(a1arg : pRastPort location 'a1'; x : WORD location 'd0'; y : WORD location 'd1'; argb : longword location 'd2') : LONGINT; syscall CyberGfxBase 114;
  291. {*** v43 ***}
  292. FUNCTION WritePixelArrayAlpha(srcRect : POINTER location 'a0'; SrcX : WORD location 'd0'; SrcY : WORD location 'd1'; SrcMod : WORD location 'd2'; a1arg : pRastPort location 'a1'; DestX : WORD location 'd3'; DestY : WORD location 'd4'; SizeX : WORD location 'd5'; SizeY : WORD location 'd6'; globalAlpha : LongWord location 'd7') : longword; syscall CyberGfxBase 216;
  293. PROCEDURE BltTemplateAlpha(source : pWORD location 'a0'; xSrc : LongInt location 'd0'; srcMod : LongInt location 'd1'; destRP : pRastPort location 'a1'; xDest : LongInt location 'd2'; yDest : LongInt location 'd3'; xSize : LongInt location 'd4'; ySize : LongInt location 'd5'); SysCall CyberGfxBase 222;
  294. PROCEDURE ProcessPixelArray(rastPort: pRastPort location 'a0'; destX: LongWord location 'd0'; destY: LongWord location 'd1'; sizeX: LongWord location 'd2'; sizeY: LongWord location 'd3'; operation: LongWord location 'd4'; value: LongInt location 'd5'; taglist: pTagItem location 'a2'); syscall CyberGfxBase 228;
  295. {*** v50 ***}
  296. FUNCTION BltBitMapAlpha(srcBitMap : pBitMap location 'a0'; xSrc : LongInt location 'd0'; ySrc : LongInt location 'd1'; destBitMap : pBitMap location 'a1'; xDest : LongInt location 'd2'; yDest : LongInt location 'd3'; xSize : LongInt location 'd4'; ySize : LongInt location 'd5'; tagList : pTagItem location 'a2') : LongWord; syscall CyberGfxBase 234;
  297. FUNCTION BltBitMapRastPortAlpha(srcBitMap : pBitMap location 'a0'; xSrc : LongInt location 'd0'; ySrc : LongInt location 'd1'; destRP : pRastPort location 'a1'; xDest : LongInt location 'd2'; yDest : LongInt location 'd3'; xSize : LongInt location 'd4'; ySize : LongInt location 'd5'; tagList : pTagItem location 'd2') : LongWord; SysCall CyberGfxBase 240;
  298. FUNCTION ScalePixelArrayAlpha(srcRect : POINTER location 'a0'; SrcW : WORD location 'd0'; SrcH : WORD location 'd1'; SrcMod : WORD location 'd2'; a1arg : pRastPort location 'a1'; DestX : WORD location 'd3'; DestY : WORD location 'd4'; DestW : WORD location 'd5'; DestH : WORD location 'd6'; globalAlpha : LongWord location 'd7') : LONGINT; syscall CyberGfxBase 252;
  299. {
  300. Functions and procedures with array of const go here
  301. }
  302. {
  303. FUNCTION AllocCModeListTags(const ModeListTags : Array Of Const) : pList;
  304. FUNCTION BestCModeIDTags(const BestModeIDTags : Array Of Const) : longword;
  305. FUNCTION CModeRequestTags(ModeRequest : POINTER; const ModeRequestTags : Array Of Const) : longword;
  306. PROCEDURE CVideoCtrlTags(ViewPort : pViewPort; const TagList : Array Of Const);
  307. PROCEDURE DoCDrawMethodTags(Hook : pHook; a1arg : pRastPort; const TagList : Array Of Const);
  308. FUNCTION LockBitMapTags(BitMap : POINTER; const TagList : Array Of Const) : POINTER;
  309. PROCEDURE UnLockBitMapTags(Handle : POINTER; const TagList : Array Of Const);
  310. }
  311. function SHIFT_PIXFMT(fmt : longint) : longint;
  312. function InitCyberGfxLibrary: boolean;
  313. IMPLEMENTATION
  314. {uses
  315. tagsarray;}
  316. {
  317. Functions and procedures with array of const go here
  318. }
  319. {
  320. FUNCTION AllocCModeListTags(const ModeListTags : Array Of Const) : pList;
  321. begin
  322. AllocCModeListTags := AllocCModeListTagList(readintags(ModeListTags));
  323. end;
  324. FUNCTION BestCModeIDTags(const BestModeIDTags : Array Of Const) : longword;
  325. begin
  326. BestCModeIDTags := BestCModeIDTagList(readintags(BestModeIDTags));
  327. end;
  328. FUNCTION CModeRequestTags(ModeRequest : POINTER; const ModeRequestTags : Array Of Const) : longword;
  329. begin
  330. CModeRequestTags := CModeRequestTagList(ModeRequest , readintags(ModeRequestTags));
  331. end;
  332. PROCEDURE CVideoCtrlTags(ViewPort : pViewPort; const TagList : Array Of Const);
  333. begin
  334. CVideoCtrlTagList(ViewPort , readintags(TagList));
  335. end;
  336. PROCEDURE DoCDrawMethodTags(Hook : pHook; a1arg : pRastPort; const TagList : Array Of Const);
  337. begin
  338. DoCDrawMethodTagList(Hook , a1arg , readintags(TagList));
  339. end;
  340. FUNCTION LockBitMapTags(BitMap : POINTER; const TagList : Array Of Const) : POINTER;
  341. begin
  342. LockBitMapTags := LockBitMapTagList(BitMap , readintags(TagList));
  343. end;
  344. PROCEDURE UnLockBitMapTags(Handle : POINTER; const TagList : Array Of Const);
  345. begin
  346. UnLockBitMapTagList(Handle , readintags(TagList));
  347. end;
  348. }
  349. function SHIFT_PIXFMT(fmt : longint) : longint; inline;
  350. begin
  351. SHIFT_PIXFMT:=(ULONG(fmt)) shl 24;
  352. end;
  353. const
  354. { Change VERSION and LIBVERSION to proper values }
  355. VERSION : string[2] = '0';
  356. LIBVERSION : longword = 0;
  357. function InitCyberGfxLibrary: boolean;
  358. begin
  359. InitCyberGfxLibrary := Assigned(CyberGfxBase);
  360. end;
  361. initialization
  362. CyberGfxBase := OpenLibrary(CYBERGFXNAME,LIBVERSION);
  363. finalization
  364. if Assigned(CyberGfxBase) then
  365. CloseLibrary(CyberGfxBase);
  366. END. (* UNIT CYBERGRAPHICS *)