{ Demonstrates: Linked-In OBJ version of VGA256.BGI. } { Designer VGA BGI graphics driver } { By: Markham Thomas } { Feb 2, 1989 } { Test routine } uses Graph,crt,DVGATPU; { DVGATPU contains VGA256 module defs } var Gd, Gm : integer; count : integer; DAC : RGB; { define the DAC array (type in TPU) } const DVGA320x200 = 0; { Standard VGA mode 13h } DVGA640x480 = 1; { Designer VGA graphics modes } DVGA800x600 = 2; begin Gd := InstallUserDriver('VGA256',@DetectVGA256); { must say gd := Install... to work } gd := registerbgidriver(@_VGADRIVERPROC); Gd := DETECT; InitGraph(Gd, gm ,''); DAC[0][0] := 0; { Demonstrate how to use setvgapalette } DAC[0][1] := 0; DAC[0][2] := 0; for count := 1 to 255 do begin DAC[count][0] := random($3f); DAC[count][1] := random($3f); DAC[count][2] := random($3f); end; setvgapalette(DAC); { load the DAC registers from array } for Count := 1 to 2000 do begin { Test the graphics mode } SetColor(random(255)); line(getmaxx div 2,getmaxy div 2,random(getmaxx),random(getmaxy)); end; restorecrtmode; end.