home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
PJ8_3.ZIP
/
ELLIPSE2.C
< prev
next >
Wrap
Text File
|
1990-02-11
|
1KB
|
35 lines
/* *** Listing 2 ***
*
* Draws a series of concentric ellipses that should appear to be
* circles in the EGA's hi-res mode, mode 10h. (They may not appear
* to be circles on monitors that don't display mode 10h with the
* same aspect ratio as the Enhanced Color Display.)
* For EGA or VGA.
* Compile and link with listingX.c (where X is 1 or 4) with:
* tcc listingX listing2 (Turbo C)
* cl listingX.c listing2.c (MSC)
*/
#include <dos.h>
main() {
int BaseRadius, Temp, Color;
union REGS Regs;
/* Select EGA's hi-res 640x350 graphics mode, mode 10h */
Regs.x.ax = 0x0010;
int86(0x10, &Regs, &Regs);
/* Draw concentric ellipses */
for ( BaseRadius = 2, Color = 7; BaseRadius < 58; BaseRadius++ ) {
DrawEllipse(640/2, 350/2, BaseRadius*4, BaseRadius*3, Color);
Color = (Color + 1) & 0x0F; /* cycle through 16 colors */
}
/* Wait for a key, restore text mode, and done */
scanf("%c", &Temp);
Regs.x.ax = 0x0003;
int86(0x10, &Regs, &Regs);
}