home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / PROG / PASCAL / VGA256P.ZIP / SIMPLE.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-02-03  |  1.3 KB  |  41 lines

  1. { Demonstrates:  Dynamically loaded BGI file. }
  2.  
  3. { Designer VGA  BGI graphics driver }
  4. {   By:  Markham Thomas             }
  5. {        Feb 2, 1989                }
  6. {   Test routine                    }
  7.  
  8. uses
  9.   Graph,crt,DVGATPU;                   { DVGATPU contains VGA256 module defs }
  10.  
  11. var
  12.   Gd, Gm : integer;
  13.   count  : integer;
  14.   DAC    : RGB;                        { define the DAC array (type in TPU) }
  15.  
  16. const
  17.   DVGA320x200 = 0;                     { Standard VGA mode 13h }
  18.   DVGA640x480 = 1;                     { Designer VGA graphics modes }
  19.   DVGA800x600 = 2;
  20.  
  21. begin
  22.   Gd := InstallUserDriver('VGA256',@DetectVGA256);  { must say   gd := Install...  to work }
  23.   Gd := DETECT;
  24.   InitGraph(Gd, gm ,'');
  25.   DAC[0][0] := 0;                      { Demonstrate how to use setvgapalette }
  26.   DAC[0][1] := 0;
  27.   DAC[0][2] := 0;
  28.   for count := 1 to 255 do begin
  29.       DAC[count][0] := random($3f);
  30.       DAC[count][1] := random($3f);
  31.       DAC[count][2] := random($3f);
  32.   end;
  33.   setvgapalette(DAC);                  { load the DAC registers from array }
  34.   for Count := 1 to 2000 do begin      { Test the graphics mode }
  35.       SetColor(random(255));
  36.       line(getmaxx div 2,getmaxy div 2,random(getmaxx),random(getmaxy));
  37.   end;
  38.   restorecrtmode;
  39. end.
  40.  
  41.