home *** CD-ROM | disk | FTP | other *** search
- BGI Linking Graph's procedures with Gr's graphic conventions.
- ver 1.0 Copyright (c) 1993 by Matthias Köppe.
-
- -----------------------------------------------------------------------------
-
- BGI is a Turbo Pascal unit. It is used for linking the procedures and
- functions of unit Graph with the clipping conventions of the commonly used
- graphics interface Gr.
-
- P r o c e d u r e s
-
- The BGI unit replace following routines of unit Graph:
-
- PutPixel Line LineTo LineRel
- MoveTo MoveRel Bar Rectangle
- Circle FillCircle GetImage PutImage
-
- These routines can directly be used in your applications. They pay attention
- to the Gr parameters.
-
- If you want to utilize other Graph routines, make sure they provide clipping
- facilities. For instance, Arc and PutImage do not even co-operate with their
- ViewPort clipping.
-
- Simply call the GrClipBgi procedure before every Graph call with co-ordinates,
- and add to the specified co-ordinates the BgiX or BgiY values.
-
-
- C l i p p i n g
-
- The BGI unit supports several clipping modes. The current mode is stored in
- the BgiClipMode variable. Following table shows the mechanisms.
-
- Mode Clipping mechanism
- ------------ -------------------------------------------------------------
- bcmUpdAlways Before every drawing operation, it is tested whether the
- ViewPort matches the ClipRect settings. If necessary, the
- ViewPort and the BgiX, BgiY variables are adapted to the new
- parameters.
- - Choose this mode if ClipRect and DrawOrigin are set by
- direct assignments and not by Gr's setting routines.
- bcmUpdNever There is no test performed whether the ClipRect has changed.
- Only if indicated in BgiClipState, the ViewPort and BgiX,
- BgiY are adapted.
- - Choose this mode if ClipRect and DrawOrigin are only set
- by Gr's setting routines, since they report a change to the
- BGI unit.
- bcmUpdStop same as bcmUpdNever
- bcmUpdOnReq ViewPort and BgiX, BgiY are not modified before a drawing
- operation. Gr's setting routines adapt them each time.
- - Choose this mode if ClipRect and DrawOrigin are only set
- by Gr's setting routines and BGI routines are extensively
- used.
-
- The clipping mode should not be set directly. You should rather use Gr's
- clipping notification. (Read Gr.doc)
-
-
- E x p o r t e d R o u t i n e s
-
- Following UserXX pointers of Gr are supported.
-
- UserXX Routines Q. Description
- -------------- ------------- -- ---------------------------------------
- LineProc Line 50 Line drawing routine
- ClipNotifyProc NotifyClip 50 Clipping notification
- InitGraphProc InitBgiGraph 50 Initializing Graph by Gr.GrMode
- CloseGraphProc CloseBgiGraph 50 De-initializing Graph
- ActivePageProc SetBgiPage 50 Setting the active screen page for BGI
- ChParamsProc ChBgiParams 50 Changing graphic parameters
-
- I n i t i a l i z a t i o n
-
- The InitBgiGraph routine initializes the Graph unit by InitGraph. Driver and
- mode are determined from the set Gr mode.
- The BGI driver path must be specified in the PathToDriver variable. It is
- initialized with 'C:\TP\BGI'.
-
-