home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 300-399 / ff339.lzh / PCQ / Include / DoubleBuffer.i < prev    next >
Text File  |  1990-03-19  |  1KB  |  45 lines

  1. {
  2.     DoubleBuffer.i
  3.  
  4.     These routines provide a very simple double buffer
  5.     mechanism, mainly by being a bit inflexible with the
  6.     choice of screens and windows.
  7.  
  8.     The first thing to do is to set up a NewScreen structure,
  9.     just like you would do for OpenScreen.  This can be any
  10.     sort of screen.  Then call OpenDoubleBuffer, which will
  11.     return a pointer to a full-screen, borderless backdrop
  12.     window, or Nil if something went wrong.
  13.  
  14.     If you write into the window's RastPort, it won't be
  15.     visible until you call SwapBuffers.  By the way, you
  16.     can always write into the same RastPort - you don't
  17.     need to reinitialize after SwapBuffers.  All the
  18.     buffer swapping takes place at the level of BitMaps,
  19.     so it's transparent to RastPorts.
  20.  
  21.     When you have finished, call CloseDoubleBuffer.  If you
  22.     close the window and screen seperately it might crash
  23.     (I'm not sure), but you'll definitely lose memory.
  24.  
  25.     The source for these routines is in the Runtime directory,
  26.     and the Object code is in PCQ.lib.  Take a look at the
  27.     source for an explanation how this works.
  28.  
  29.     One last point: GfxBase must be open before you call
  30.             OpenDoubleBuffer.  But if it wasn't
  31.             open, why would you need doublebuffers?
  32. }
  33.  
  34. {$I "Include/Intuition.i"}
  35.  
  36. Function OpenDoubleBuffer(ns : NewScreenPtr) : WindowPtr;
  37.     External;
  38.  
  39. Procedure SwapBuffers(w : WindowPtr);
  40.     External;
  41.  
  42. Procedure CloseDoubleBuffer(w : WindowPtr);
  43.     External;
  44.  
  45.