home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c100 / 1.ddi / BLAZE.ZIP / DEMO.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1990-07-19  |  5.3 KB  |  180 lines

  1. /*
  2.                                                 Creative Options Interface
  3.                                                      Runtime Version 1.00
  4.  
  5.                                                 Blaze Class Specification
  6.  
  7.                                                  DEMONSTRATION SOFTWARE
  8.  
  9.                                              Developed by Robert M Miller
  10.                                     Copyright (C) 1990 Software Dimensions
  11.  
  12. Disclaimer -------------------------------------------------------------------
  13.  
  14. This source code may be modified and used without royalties as long as
  15. the purchaser of the code agrees not to distribute the modified source
  16. code along with the source code of his/her own works.  In other words, you
  17. can distribute this along with your own programs as long it is in an
  18. executable form (.EXE/.COM).
  19.  
  20. */
  21.  
  22. #include "blaze.h"
  23. #include <stdlib.h>
  24. #include <dos.h>
  25.  
  26. main ()
  27. {
  28.     register int i, j;
  29.     int k, l, m, n;
  30.     void *s;
  31.  
  32.     Blaze++; // Cancels 43/50 line mode
  33.     Blaze.InvisibleCursor(); // Hides cursor
  34.     -Blaze (0,0); // Resets cursor and (-Blaze) clears the screen
  35.  
  36.     for (i=0,j=0;j<1000;j++)
  37.         Blaze << (i=(i==15)?0:(++i)) << "Blaze! ";
  38.  
  39.     Blaze.EraseArea(0,12,80,3,112);
  40.     Blaze (0,13) << (1|112) << Centered << "  Welcome to Blaze!  ";
  41.  
  42.     sleep(5);
  43.  
  44.     -Blaze (0,0);
  45.  
  46.     for (i=0,j=0;j<200;j++)
  47.         Blaze << (i=(i==15)?0:(++i)) << Centered << "What could be faster?";
  48.  
  49.     for (i=0,j=0;j<200;j++)
  50.         Blaze << (i=(i==15)?0:(++i)) << Centered << "What could be easier?";
  51.  
  52.     for (i=0,j=0;j<200;j++)
  53.         Blaze << (i=(i==15)?0:(++i)) << Centered << "What do you get for just $10?";
  54.  
  55.     for (i=0,j=0;j<200;j++)
  56.         Blaze << (i=(i==15)?0:(++i)) << Centered << "Automatic centering" << "\n\r";
  57.  
  58.     for (i=0,j=0;j<200;j++)
  59.         Blaze << (i=(i==15)?0:(++i)) << Flushed << "Automatic right flushing" << "\n\r";
  60.  
  61.     for (i=0,j=0;j<200;j++)
  62.         Blaze << (i=(i==15)?0:(++i)) << "Total color control" << "\n\r";
  63.  
  64.     for (i=0,j=0;j<200;j++)
  65.         Blaze << (i=(i==15)?0:(++i)) << Centered << "Total position control" << "\n\r";
  66.  
  67.     -- Blaze; // 43/50 EGA/VGA if possible
  68.  
  69.     -Blaze (0,0);
  70.     Blaze.InvisibleCursor();
  71.  
  72.     for (i=0,j=0;j<300;j++)
  73.         Blaze << (i=(i==15)?0:(++i)) << Centered << "Automatic 43/50 Line EGA/VGA Support!" << "\n\r";
  74.  
  75.     ++ Blaze; // 25 CGA return
  76.     Blaze.InvisibleCursor();
  77.  
  78.     for (i=0,j=0;j<30000;j++)
  79.         Blaze (rand()%55,rand()%25) << (i=(i==15)?0:(++i)) << "Turn scolling on or off!";
  80.  
  81.     Blaze.EraseArea(0,12,80,3,112);
  82.   Blaze (0,13) << (1|112) << Centered << "  This string was displayed 30000 times!  ";
  83.   sleep(5);
  84.  
  85.     -Blaze;
  86.  
  87.     for (i=0,j=0;j<10000;j++)
  88.         Blaze.Box(rand()%55,rand()%15,(rand()%20)+4,(rand()%8)+4,i=(i==15)?0:(++i));
  89.  
  90.     Blaze.EraseArea(0,12,80,3,112);
  91.     Blaze (0,13) << (1|112) << Centered << "  Draw empty boxes!  ";
  92.   sleep(5);
  93.     -Blaze;
  94.  
  95.     for (i=0,j=0;j<10000;j++)
  96.         Blaze.BoxFilled(rand()%55,rand()%15,(rand()%20)+4,(rand()%8)+4,1|((i=(i==7)?0:(++i))<<4));
  97.  
  98.     Blaze.EraseArea(0,12,80,3,112);
  99.     Blaze (0,13) << (1|112) << Centered << "  Draw filled boxes!  ";
  100.   sleep(5);
  101.  
  102.     for (i=0,j=0;j<10000;j++)
  103.     Blaze.EraseArea(rand()%55,rand()%15,(rand()%20)+4,(rand()%8)+4,(i=(i==7)?0:(++i))<<4);
  104.  
  105.     Blaze.EraseArea(0,12,80,3,112);
  106.     Blaze (0,13) << (1|112) << Centered << "  Fill areas!  ";
  107.   sleep(5);
  108.     Blaze (0,13) << (1|112) << Centered << "  Change colors of a region!  ";
  109.  
  110.     for (i=0,j=0;j<10000;j++)
  111.         Blaze.BoxAttribute(rand()%55,rand()%15,(rand()%20)+4,(rand()%8)+4,1|((i=(i==7)?0:(++i))<<4));
  112.  
  113.     Blaze.EraseArea(0,12,80,3,112);
  114.     Blaze (0,13) << (1|112) << Centered << "  Change colors of a region!  ";
  115.   sleep(5);
  116.   -Blaze;
  117.  
  118.     for (i=0,j=0,k=0;j<10000;j++)
  119.     Blaze.CharacterFill(rand()%55,rand()%15,(rand()%20)+4,(rand()%8)+4,(k=(k==15)?0:(++k)),(i=(i==255)?0:(++i)));
  120.  
  121.     Blaze.EraseArea(0,12,80,3,112);
  122.     Blaze (0,13) << (1|112) << Centered << "  Fill areas with characters!  ";
  123.   sleep(5);
  124.  
  125.     for (k=0;k<3;k++)
  126.     {
  127.         for (i=0,j=0;j<500;j++)
  128.             Blaze.ScrollUp(rand()%55,rand()%15,(rand()%20)+4,(rand()%8)+4);
  129.         for (i=0,j=0;j<500;j++)
  130.             Blaze.ScrollDown(rand()%55,rand()%15,(rand()%20)+4,(rand()%8)+4);
  131.     }
  132.  
  133.     Blaze.EraseArea(0,12,80,3,112);
  134.     Blaze (0,13) << (1|112) << Centered << "  Scroll any region of the screen!  ";
  135.   sleep(5);
  136.   -Blaze;
  137.  
  138.     for (i=0,j=0;j<5000;j++)
  139.     {
  140.         Blaze.Shadow(k=rand()%55,l=rand()%15,m=(rand()%20)+4,n=(rand()%8)+4);
  141.         Blaze.BoxFilled(k+1,l+1,m,n,1|((i=(i==7)?1:(++i))<<4));
  142.  
  143.     }
  144.  
  145.     Blaze.EraseArea(0,12,80,3,112);
  146.     Blaze (0,13) << (1|112) << Centered << "  Draw boxes with shadows!  ";
  147.   sleep(5);
  148.  
  149.     s=new char[160*Blaze.WhatHeight()];
  150.     Blaze.GetArea(0,0,80,Blaze.WhatHeight(),s);
  151.     Blaze.EraseArea(0,12,80,3,112);
  152.     Blaze (0,13) << (1|112) << Centered << "  Save an area or all of the screen!  ";
  153.   sleep(5);
  154.     -Blaze; // Clear screen
  155.     Blaze.EraseArea(0,12,80,3,112);
  156.     Blaze (0,13) << (1|112) << Centered << "  Watch me restore the last screen!  ";
  157.     sleep(5);
  158.     Blaze.PutArea(0,0,80,Blaze.WhatHeight(),s);
  159.     Blaze.EraseArea(0,12,80,3,112);
  160.     Blaze (0,13) << (1|112) << Centered << "  Walla!  Here it is!  ";
  161.   sleep(5);
  162.   delete s;
  163.  
  164.     -Blaze (0,0); // (0,0) -- home cursor
  165.  
  166.     for (i=0,j=0;j<400;j++)
  167.         Blaze << (i=(i==15)?0:(++i)) << Centered << "All of the samples you just saw were repeated 10,000 times each!"
  168.       << "\n\r";
  169.  
  170.     for (i=0,j=0;j<200;j++)
  171.         Blaze << (i=(i==15)?0:(++i)) << Centered << "Read the DEMO.DOC file for more information!"
  172.       << "\n\r";
  173.  
  174.     for (i=0,j=0;j<300;j++)
  175.         Blaze << (i=(i==15)?0:(++i)) << Centered << "Order the TC++ Blaze Class Today!  Only $10!"
  176.       << "\n\r";
  177.  
  178.     Blaze.VisibleCursor();
  179. }
  180.