-
Notifications
You must be signed in to change notification settings - Fork 0
/
Documentation
265 lines (125 loc) · 7.55 KB
/
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
Borland Graphics Interface (BGI) for Windows
Version 6.0, August 9, 2004
The following functions are mostly from the original Borland Graphics Interface for DOS programs. The BGI graphics functions may also be used with Windows programs created by the Borland 5.0 compiler, the free GNU C++ compiler, and possibly other compilers. Extra Windows functions are also available, described in www.cs.colorado.edu/~main/cs1300/doc/bgi/bgi.html. These extra functions are indicated below by [WIN]. Also, any of the functions that use colors can use RGB colors in addition to the 16-color BGI palette.
Functions:
void arc (int x, int y, int stangle, int endangle, int radius);
void bar (int left, int top, int right, int bottom);
void bar3d (int left, int top, int right, int bottom, int depth, int topflag);
ostringstream bgiout; [WIN
void circle (int x, int y, int radius);
void cleardevice (void);
void clearmouseclick(int kind); [WIN
void clearviewport (void);
void closegraph (int window=ALL_WINDOWS); [WIN
int converttorgb (int color); [WIN
void delay (int millisec); [WIN
void detectgraph (int *graphdriver, int *graphmode);
void drawpoly (int numpoints, int *polypoints);
void ellipse (int x, int y, int stangle, int endangle, int xradius, int yradius);
void fillellipse (int x, int y, int xradius, int yradius);
void fillpoly (int numpoints, int *polypoints);
void floodfill (int x, int y, int border);
int getactivepage (void); [WIN
void getarccoords (struct arccoordstype *arccoords);
void getaspectratio (int *xasp, int *yasp);
int getbkcolor (void);
int getch (void); [WIN
int getcolor (void);
int getcurrentwindow (void); [WIN]
struct palettetype* getdefaultpalette (void);
int getdisplaycolor (int color); [WIN
char* getdrivername (void);
void getfillpattern (char *pattern);
void getfillsettings (struct fillsettingstype *fillinfo);
int getgraphmode (void);
void getimage (int left, int top, int right, int bottom, void *bitmap);
void getlinesettings (struct linesettingstype *lineinfo);
int getmaxcolor (void);
int getmaxmode (void);
int getmaxheight (void); [WIN
int getmaxwidth (void); [WIN
int getmaxx (void);
int getmaxy (void);
char* getmodename (int mode_number);
void getmoderange (int graphdriver, int *lomode, int *himode);
void getmouseclick(int kind, int& x, int& y); [WIN
void getpalette (struct palettetype *palette);
int getpalettesize (void);
int getpixel (int x, int y);
void gettextsettings (struct textsettingstype *texttypeinfo);
void getviewsettings (struct viewporttype *viewport);
int getvisualpage (void); [WIN
int getwindowheight (void); [WIN
int getwindowwidth (void); [WIN
int getx (void);
int gety (void);
void graphdefaults (void);
char* grapherrormsg (int errorcode);
int graphresult(void);
unsigned imagesize (int left, int top, int right, int bottom);
void initgraph (int *graphdriver, int *graphmode, char *pathtodriver);
int initwindow (int width, int height, const char* title="Windows BGI", int left=0, int top=0, bool dbflag=false, bool closeflag=true); [WIN]
int installuserdriver (char *name, int huge (*detect)(void));
int installuserfont (char *name);
bool ismouseclick(int kind); [WIN
int kbhit (void); [WIN
void line (int x1, int y1, int x2, int y2);
void linerel (int dx, int dy);
void lineto (int x, int y);
int mousex (void); [WIN
int mousey (void); [WIN
void moverel (int dx, int dy);
void moveto (int x, int y);
void outtext (char *textstring);
void outtextxy (int x, int y, char *textstring);
void pieslice (int x, int y, int stangle, int endangle, int radius);
void printimage (
const char* title=NULL, double width_inches=7,
double border_left_inches=0.75, double border_top_inches=0.75,
int left=0, int right=0, int right=INT_MAX, int bottom=INT_MAX
); [WIN]
void putimage (int left, int top, void *bitmap, int op);
void putpixel (int x, int y, int color);
void readimagefile (
const char* filename=NULL,
int left=0, int top=0, int right=INT_MAX, int bottom=INT_MAX
);
void rectangle (int left, int top, int right, int bottom);
int registerbgidriver (void (*driver)(void));
int registerbgifont (void (*font)(void));
void registermousehandler (int kind, void h(int, int)); [WIN
void restorecrtmode (void);
RGB functions: [WIN
COLOR(r,g,b),
RED_VALUE(v), GREEN_VALUE(v), BLUE_VALUE(v),
IS_BGI_COLOR(v), IS_RGB_COLOR(v)
void sector (int x, int y, int stangle, int endangle, int xradius, int yradius);
void setactivepage (int page);
void setallpalette (struct palettetype *palette);
void setaspectratio (int xasp, int yasp);
void setbkcolor (int color);
void setcolor (int color);
void setcurrentwindow (int window); [WIN]
void setmousequeuestatus(int kind, bool status=true); [WIN
void setfillpattern (char *upattern, int color);
void setfillstyle (int pattern, int color);
unsigned setgraphbufsize (unsigned bufsize);
void setgraphmode (int mode);
void setlinestyle (int linestyle, unsigned upattern, int thickness);
void setpalette (int colornum, int color);
void setrgbpalette (int colornum, int red, int green, int blue);
void settextjustify (int horiz, int vert);
void settextstyle (int font, int direction, int charsize);
void setusercharsize (int multx, int divx, int multy, int divy);
void setviewport (int left, int top, int right, int bottom, int clip);
void setvisualpage (int page);
void setwritemode (int mode);
int showerrorbox (const char *message); [WIN
int swapbuffers (void); [WIN]
int textheight (char *textstring);
int textwidth (char *textstring);
void writeimagefile (
const char* filename=NULL,
double width_inches=7, double border_left_inches=0.75, double border_top_inches=0.75,
int left=0, int top=0, int right=INT_MAX, int bottom=INT_MAX
); [WIN