|Function||Initializes Borland's graphics system and the plotting functions of the VectorLib library (DOS only).|
|Syntax C/C++||#include <Vgraph.h>
void V_initGraph( char *pathtodriver );
procedure V_initGraph( BGI_path:String );
|Description||In DOS programs, this function is used to initialize Borland's graphics system by calling Borland's function initgraph and to initialize the VectorLib plotting functions (by internally calling V_initPlot).
The search-path for graphics driver files has to be passed as a pointer to the string pathtodriver (see Borland's function initgraph for details).
The function uses initgraph to automatically detect the graphics driver present. This automatic detection ensures that programs may run on different PC systems without changes in the source code. If, however, it causes problems or for other reasons is not desired, do not use V_initGraph (but first initgraph and then V_initPlot). The global variable V_gmode is set to the graphics mode with the highest resolution possible for the detected graphics driver. If initgraph has already been called, do not use V_initGraph, but call only V_initPlot. Normally, V_initGraph will be called at the beginning of a program that uses graphics; to switch back into text mode within the program, use restorecrtmode. The next call to one of the AutoPlot functions switches again into graphics mode. You may also do that yourself by using
setgraphmode( V_gmode );
(to do this, the declaration
external int V_gmode;
has to appear in the module containing this call).
At the end of the program, free the memory allocated for graphics operations and go back to the standard mode with closegraph.
Windows programs do not use the BGI routines. Consequently, BGI initialization is available only under DOS, but not under Windows. V_initPlot has to be used in order to prepare the OptiVec plotting operations under Windows.
|Error handling||In case of failure, grapherrormsg is called, the appropriate error message displayed and the program aborted.|
VectorLib Table of Contents OptiVec home