home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / gnu / gchsrc31 / atarilib / doublebu.cc < prev    next >
C/C++ Source or Header  |  1992-04-27  |  904b  |  43 lines

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. //  This file is part of the Atari Machine Specific Library,
  4. //  and is Copyright 1992 by Warwick W. Allison.
  5. //
  6. //  You are free to copy and modify these sources, provided you acknoledge
  7. //  the origin by retaining this notice, and adhere to the conditions
  8. //  described in the file COPYING.
  9. //
  10. //////////////////////////////////////////////////////////////////////////////
  11.  
  12. #include "doublebuffer.h"
  13. #include <osbind.h>
  14.  
  15. DoubleBuffer *Pages;
  16.  
  17. DoubleBuffer::DoubleBuffer()
  18. {
  19.     Canvas[0]=new Screen;
  20.     Canvas[1]=new Screen;
  21.     Pulse=0;
  22. }
  23.  
  24. DoubleBuffer::DoubleBuffer(Screen& a, Screen& b)
  25. {
  26.     Canvas[0]=&a;
  27.     Canvas[1]=&b;
  28.     Pulse=0;
  29. }
  30.  
  31. void DoubleBuffer::Flip()
  32. {
  33.     Canvas[Pulse]->Show();
  34.     Vsync();
  35.     Pulse=1-Pulse;
  36. }
  37.  
  38. void DoubleBuffer::Flop()
  39. {
  40.     Canvas[Pulse]->Show();
  41.     Pulse=1-Pulse;
  42. }
  43.