home *** CD-ROM | disk | FTP | other *** search
/ Point Programming 1 / PPROG1.ISO / c / sclib31 / examples / window1.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-31  |  1.0 KB  |  38 lines

  1. #include <scl1.h>
  2. #include <scl1keys.h>
  3. #include <scl1clor.h>
  4.  
  5.     /********************
  6.         Window function */
  7.  
  8. /* screen data is stored in these buffers, use W_BUF_SIZE macro to calculate
  9.    buffer size. See file window2.c for an example of using CreateWindow,
  10.    DestroyWindow and WriteWindow */
  11.  
  12. char buffer1[W_BUF_SIZE(0,0,24,79)];
  13. char buffer2[W_BUF_SIZE(9,26,15,52)];
  14.  
  15. main()
  16. {
  17. char WFlag1=-2;     /* save do not clear screen */
  18. char WFlag2=0;      /* save and clear screen */
  19.  
  20. Window(BLACK_WHITE,0,0,24,79,&WFlag1,buffer1);
  21.  
  22. FillBlock(WHITE_BLACK,0,0,24,79,'X');
  23.  
  24. WriteScreenLen(BLACK_WHITE,24,0,70," The whole screen has been saved, press any key...");
  25. GetKey();
  26.  
  27. Window(WHITE_BLACK,9,26,15,52,&WFlag2,buffer2);
  28.  
  29. WriteScreenLen(BLACK_WHITE,24,0,70," A second window was SAVED AND CLEARED, press any key to restore it...");
  30. GetKey();
  31.  
  32. Window(WHITE_BLACK,9,26,15,52,&WFlag2,buffer2);
  33.  
  34. WriteScreenLen(BLACK_WHITE,24,0,70," Press any key to restore the screen...");
  35. GetKey();
  36.  
  37. Window(BLACK_WHITE,0,0,24,79,&WFlag1,buffer1);
  38. }