next up previous contents index
Next: InstallUserDriver Up: Functions and procedures Previous: ImageSize

InitGraph

   

Declaration:

Procedure InitGraph (var GraphDriver,GraphModus : integer;
const PathToDriver : string) ;

Description:

InitGraph initializes the graph package.

GraphDriver has two valid values: GraphDriver=0 which performs an auto detect and initializes 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 different from zero and graphmode to the mode you wish (VESA modes where 640x480x256 is 101h etc.).

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

Errors:

None.

See also:

Introduction, (page gif), DetectGraph, CloseGraph, GraphResult

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.



Michael Van Canneyt
Thu Sep 10 13:59:33 CEST 1998