Unit Graph


The unit Graph exports functions and procedures for graphical output. It requires at least a VESA compatible VGA-Card or a VGA-Card with softwaredriver (min. 512KB video memory).


initgraph

Procedure InitGraph(var gd,gm : integer;const path : string);

initializes the graph package

Before the graph unit can be used, be sure your graphicsadapter supports the VESA-Standart. Otherwise in the most cases you can try to use a vesa-tsr to make your adapter vesacompatible (e.g. UNIVBE).

graphdriver has two valid values: graphdriver=0 which performs an auto detect and inits the highest possible mode with the most colors. 1024x768x64K is the highest possible resolution supported by the driver, if you need a higher resolution, you must edit MODES.PPI. If you need another mode, then set graphdriver to a value unequal zero and graphmode to the mode you wish (VESA modes where 640x480x256 is $101 etc.).

pathtodriver is only needed, if you use the BGI fonts from Borland.

Example:

var 
   gd,gm : integer; 
   pathtodriver : string; 

begin 
   gd:=detect; { highest possible resolution } 
   gm:=0; { not needed, auto detection } 
   pathtodriver:='C:\PP\BGI'; { path to BGI fonts, drivers aren't needed } 
   initgraph(gd,gm,pathtodriver); 
   if graphresult<>grok then 
     halt; ..... { whatever you need } 
   closegraph; { restores the old graphics mode } 
end. 

Systems: Dos, Turbo Pascal

See also: closegraph, graphresult


klaempfl@haegar.cip.mw.uni-muenchen.de

Copyright (c) 1997 by Gernot Tenchio and Florian Klaempfl