source: buchla-68k/orig/DOC/NSLIB.TXT@ ee49131

Last change on this file since ee49131 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 8 years ago

Imported original source code.

  • Property mode set to 100755
File size: 3.2 KB
Line 
1VSDD Driver Functions in NSLIB
2------------------------------
3
4b7subs.c
5--------
6
7 line(x1,y1,x2,y2,ic,bc)
8 int x1,y1,x2,y2,ic,bc;
9
10 line(x1,y1,x2,y2,ic,bc) -- draw a line from (x1,y1) to (x2,y2) if bc==0,
11 or a rectangle with corners at (x1,y1) and (x2,y2) in mode ic
12
13 point(x,y,ic)
14 int x,y,ic;
15
16 point(x,y,ic) -- plot a point according to ic
17
18 SetCLT(n,r,g,b)
19 int n,r,g,b;
20
21 SetCLT(n,r,g,b) -- Set color lookup table values
22
23nsclip.c
24--------
25
26 int
27 Clip(x1,y1,x2,y2)
28 double x1, y1, x2, y2;
29
30 Clip(x1,y1,x2,y2) -- clip a line and draw its visible portion
31
32 returns 0 if line not visible, 1 if some portion was visible
33
34
35nsgraf.c
36--------
37
38 double Clipxl, /* left clipping limit -- world units */
39 Clipxr, /* right clipping limit -- world units */
40 Clipyb, /* bottom clipping limit -- world units */
41 Clipyt, /* top clipping limit -- world units */
42 Wxl, /* window left edge -- world units */
43 Wxr, /* window right edge -- world units */
44 Wyb, /* window bottom edge -- world units */
45 Wyt, /* window top edge -- world units */
46 Vxl, /* viewport left edge -- screen units */
47 Vxr, /* viewport right edge -- screen units */
48 Vyb, /* viewport bottom edge -- screen units */
49 Vyt, /* viewport top edge -- screen units */
50 WVxm, /* windowed view x scale factor */
51 WVxa, /* windowed view x offset */
52 WVym, /* windowed view y scale factor */
53 WVya, /* windowed view y offset */
54 Cwx, /* current x -- world units */
55 Cwy; /* current y -- world units */
56
57 int PenBgnd, /* current pen background color for lines */
58 PenFgnd, /* current pen foreground color for lines */
59 ChrBgnd, /* current background color for characters */
60 ChrFgnd; /* current foreground color for characters */
61
62 LineTo(x,y)
63 double x, y;
64
65 LineTo(x,y) -- Draw a line from current position to (x,y)
66
67
68 MoveTo(x,y)
69 double x, y;
70
71 MoveTo(x,y) -- Move current position to (x,y)
72
73 NSinit()
74
75 NSinit() -- Initialize NSPAK variables
76
77 int
78 SetBgnd(color)
79 int color;
80
81 SetBgnd(color) -- set character background color
82 Returns old background color.
83
84 int
85 SetFgnd(color)
86 int color;
87
88 SetFgnd(color) -- set character foreground color
89 Returns old foreground color.
90
91 SetPen(bcolor,fcolor)
92 int bcolor, fcolor;
93
94 SetPen(bcolor,fcolor) -- set pen colors for lines
95
96 SetView(x1,y1,x2,y2)
97 int x1, y1, x2, y2;
98
99 SetView(x1,y1,x2,y2) -- Set viewport edges
100
101 SetWind(x1,y1,x2,y2)
102 double x1, y1, x2, y2;
103
104 SetWind(x1,y1,x2,y2) -- Set window edges
105
106 static
107 Setwv()
108
109 Setwv() -- Setup window to viewport transformation
110
111 ShowLine(x1,y1,x2,y2)
112 double x1, y1, x2, y2;
113
114 ShowLine(x1,y1,x2,y2) -- Draw a line between (x1,y1)-(x2,y2)
115
116
117 VPbord()
118
119 VPbord() -- outline viewport
120
121 WctoSc(x,y,sx,sy)
122 double x, y;
123 int *sx, *sy;
124
125 WctoSc(x,y,sx,sy) -- Convert world coordinates to screen coordinates
126
127nslseg.c
128--------
129
130 static int
131 abs(a)
132 int a;
133
134 i = abs(a) -- return absolute value of a
135
136 int
137 lseg(x1,y1,x2,y2,t)
138 int x1,y1,x2,y2,t;
139
140 lseg(x1,y1,x2,y2,t) -- draw a line from (x1,y1) to (x2,y2) in mode t
141
142 static int
143 sign(a)
144 int a;
145
146 i = sign(a) -- return sign of a as -1, 0 , or 1
147
Note: See TracBrowser for help on using the repository browser.