TVGRAPH 1.02
TURBO VISION
using TURBO VISION In EGA/VGA graphics
(C) Mindware 1991
Brisbane,QLD,Australia
Fido : 3:640/305.1
0. See Modified TVDEMO program and STYX.PAS to show you how to do things
1. All that is required is to include TVGRAPH in the uses statement in your
main program and amazing - TVGRAPH will work in graphics mode.
2. Declarations are as follows
type
PGRect=^GRect;
GRect=Trect;
PGPoint=^GPoint;
GPoint=TPoint; (* These two just to avoid confusion *)
3. Graphics IDs
All "text" windows are given a graphics ID of 0, each window you want
to use graphics in - you need to assign a graphics ID to it, if a line is
drawn using the internal RawDrawLine - then if the current graphics window
is the same as the location you are writing to on the screen then the graphics
will overwrite - else the graphics will be clipped.
function NextGraphId:byte; (* Get next available graphics id *)
procedure UseGraphId(b:byte); (* Use graphics ID for following graphics *)
procedure ReleaseGraphId(b:byte); (* release graphics ID for use *)
To assign a graphics id to a character cell ensure you write character n with
attribute 0FFh into the location using standard TURBO VISION methods.
4. Other routines
procedure TextToGraphics(T:TRect;var G:Grect);
(*converts a Text rectangle T into a Grect based on current screen locations *)
procedure RawDrawLine(X1,Y1,X2,Y2:integer;Color:word);
(* draw line from using screen co-ordinates *)
procedure DrawLine(X1,Y1,X2,Y2:integer;Color:word);
(* draw line using global co-ordinates i.e. *)
(* X is 0..GraphXMax (10000) *)
(* Y is 0..GraphYMax=(07500) *)
function ISin(X:integer):integer;
function ICos(X:integer):integer;
(* Integer trig functions - X is number of 16ths of a degree *)
(* returns number -1024..1024 representing -1.000..+1.000 *)
|