home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / languages / pcq_incl3v1.lha / Graphics / RastPort.i < prev    next >
Encoding:
Text File  |  1994-10-12  |  5.0 KB  |  141 lines

  1. {
  2.         RastPort.i for PCQ Pascal
  3. }
  4.  
  5. {$I   "Include:Graphics/GFX.i"}
  6.  
  7. type
  8.  
  9.     AreaInfo = record
  10.         VctrTbl : Address;      { ptr to start of vector table }
  11.         VctrPtr : Address;      { ptr to current vertex }
  12.         FlagTbl : Address;      { ptr to start of vector flag table }
  13.         FlagPtr : Address;      { ptrs to areafill flags }
  14.         Count   : Short;        { number of vertices in list }
  15.         MaxCount : Short;       { AreaMove/Draw will not allow Count>MaxCount}
  16.         FirstX,
  17.         FirstY  : Short;        { first point for this polygon }
  18.     end;
  19.     AreaInfoPtr = ^AreaInfo;
  20.  
  21.     TmpRas = record
  22.         RasPtr  : Address;
  23.         Size    : Integer;
  24.     end;
  25.     TmpRasPtr = ^TmpRas;
  26.  
  27. { unoptimized for 32bit alignment of pointers }
  28.     GelsInfo = record
  29.         sprRsrvd        : Byte; { flag of which sprites to reserve from
  30.                                   vsprite system }
  31.         Flags   : Byte;       { system use }
  32.         gelHead,
  33.         gelTail : Address; { (VSpritePtr) dummy vSprites for list management}
  34.  
  35.     { pointer to array of 8 WORDS for sprite available lines }
  36.  
  37.         nextLine : Address;
  38.  
  39.     { pointer to array of 8 pointers for color-last-assigned to vSprites }
  40.  
  41.         lastColor : Address;
  42.         collHandler : Address;  { (collTablePtr) addresses of collision routines }
  43.         leftmost,
  44.         rightmost,
  45.         topmost,
  46.         bottommost      : Short;
  47.         firstBlissObj,
  48.         lastBlissObj    : Address;    { system use only }
  49.     end;
  50.     GelsInfoPtr = ^GelsInfo;
  51.  
  52.     RastPort = record
  53.         Layer           : Address;      { LayerPtr }
  54.         BitMap          : Address;      { BitMapPtr }
  55.         AreaPtrn        : Address;      { ptr to areafill pattern }
  56.         TmpRas          : TmpRasPtr;
  57.         AreaInfo        : AreaInfoPtr;
  58.         GelsInfo        : GelsInfoPtr;
  59.         Mask            : Byte;         { write mask for this raster }
  60.         FgPen           : Byte;         { foreground pen for this raster }
  61.         BgPen           : Byte;         { background pen         }
  62.         AOlPen          : Byte;         { areafill outline pen }
  63.         DrawMode        : Byte; { drawing mode for fill, lines, and text }
  64.         AreaPtSz        : Byte;         { 2^n words for areafill pattern }
  65.         linpatcnt       : Byte; { current line drawing pattern preshift }
  66.         dummy           : Byte;
  67.         Flags           : Short;        { miscellaneous control bits }
  68.         LinePtrn        : Short;        { 16 bits for textured lines }
  69.         cp_x,
  70.         cp_y            : Short;        { current pen position }
  71.         minterms        : Array [0..7] of Byte;
  72.         PenWidth        : Short;
  73.         PenHeight       : Short;
  74.         Font            : Address;      { (TextFontPtr) current font address }
  75.         AlgoStyle       : Byte;         { the algorithmically generated style }
  76.         TxFlags         : Byte;         { text specific flags }
  77.         TxHeight        : Short;        { text height }
  78.         TxWidth         : Short;        { text nominal width }
  79.         TxBaseline      : Short;        { text baseline }
  80.         TxSpacing       : Short;        { text spacing (per character) }
  81.         RP_User         : Address;
  82.         longreserved    : Array [0..1] of Integer;
  83.         wordreserved    : Array [0..6] of Short;        { used to be a node }
  84.         reserved        : Array [0..7] of Byte;         { for future use }
  85.     end;
  86.     RastPortPtr = ^RastPort;
  87.  
  88. const
  89.  
  90. { drawing modes }
  91.  
  92.     JAM1        = 0;    { jam 1 color into raster }
  93.     JAM2        = 1;    { jam 2 colors into raster }
  94.     COMPLEMENT  = 2;    { XOR bits into raster }
  95.     INVERSVID   = 4;    { inverse video for drawing modes }
  96.  
  97. { these are the flag bits for RastPort flags }
  98.  
  99.     FRST_DOT    = $01;  { draw the first dot of this line ? }
  100.     ONE_DOT     = $02;  { use one dot mode for drawing lines }
  101.     DBUFFER     = $04;  { flag set when RastPorts are double-buffered }
  102.  
  103.              { only used for bobs }
  104.  
  105.     AREAOUTLINE = $08;  { used by areafiller }
  106.     NOCROSSFILL = $20;  { areafills have no crossovers }
  107.  
  108. { there is only one style of clipping: raster clipping }
  109. { this preserves the continuity of jaggies regardless of clip window }
  110. { When drawing into a RastPort, if the ptr to ClipRect is nil then there }
  111. { is no clipping done, this is dangerous but useful for speed }
  112.  
  113. Function AllocRaster(width,height : Short) : PLANEPTR;
  114.     External;
  115.  
  116. PROCEDURE EraseRect(RP : RastPortPtr; xmin, ymin, xmax, ymax : Short);
  117.     External;
  118.  
  119. Procedure FreeRaster(p : PLANEPTR; width, height : Short);
  120.     External;
  121.  
  122. Procedure InitRastPort(rp : RastPortPtr);
  123.     External;
  124.  
  125. Procedure InitTmpRas(tmpras : TmpRasPtr; buffer : Address; size : Integer);
  126.     External;
  127.  
  128. Procedure ScrollRaster(rp : RastPortPtr; dx, dy,
  129.                         xmin, ymin, xmax, ymax : Short);
  130.     External;
  131.  
  132. Procedure SetRast(rp : RastPortPtr; pen : Byte);
  133.     External;
  134.  
  135. { --- functions in V39 or higher (Release 3) --- }
  136.  
  137. PROCEDURE ScrollRasterBF(RP : RastPortPtr; dx, dy, xmin, ymin, xmax, ymax : Integer);
  138.     External;
  139.  
  140.  
  141.