home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff258.lzh / Suplib / doc / rastport.doc < prev    next >
Text File  |  1989-10-18  |  2KB  |  53 lines

  1.  
  2.                   RASTPORT.DOC
  3.             (SUP32.LIB and DRES.LIBRARY)
  4.  
  5. MakeRastPort                             MakeRastPort
  6.  
  7.     BOOL MakeRastPort(rp, bm, tmprassize, numai)
  8.     RP *rp;          D0  D1    D2      A0.W
  9.     BM *bm;
  10.     long tmprassize;
  11.     short numai;
  12.  
  13.     This function fills in an unitialized rastport by InitRastPort()ing it,
  14.     attaching the bitmap, and allocating a TmpRas and AreaInfo structure
  15.     (and associated raster and vector array) according to the following:
  16.  
  17.       tmprassize   == -1    Allocate a TmpRas structure and a raster the
  18.                 size of one plane of the bitmap.
  19.               0     Do not allocate a TmpRas structure or raster
  20.               N     Allocate a TmpRas structure and raster of size
  21.                 N bytes.
  22.  
  23.     numai       == 0     Do not allocate an AreaInfo structure or vectors
  24.               N     Allocate an AreaInfo and buffer space for N
  25.                 vectors (5 bytes per vector).
  26.  
  27.     RESULTS:    0 on failure, 1 on success.  If successful the rastport
  28.         will have been initialized with the bitmap attached to the
  29.         rastport.  An optional TmpRas and optional AreaInfo
  30.         structure will have been allocated as well as memory
  31.         for the raster itself and area info vectors.  The APen
  32.         will be set to 1 and the DrMd to JAM2.
  33.  
  34.         This is an all or nothing function.  If it fails, anything
  35.         allocated so far will be freed.
  36.  
  37.  
  38. FreeRastPort                             FreeRastPort
  39.  
  40.     (void) FreeRastPort(rp)
  41.     RP *rp;
  42.  
  43.     This function frees memory associated with a rastport but not the
  44.     rastport structure itself.    If a TmpRas exists the temporary raster
  45.     and TmpRas structure will be freed.  If an AreaInfo exists the
  46.     vector array and AreaInfo structure will be freed.    If a BitMap
  47.     exists rp->BitMap will be set to NULL (but the BitMap itself is
  48.     not freed, see FreeBitMap() and FreeRastPortBitMap())
  49.  
  50.  
  51.  
  52.  
  53.