Mail Archives: djgpp/2002/02/20/10:15:48
> "Al E. B." <arjupt AT postmaster DOT co DOT uk>
>
> > This program has been written in TurboC. I've heard
> > DJGPP uses different Refs. I'd be thankful, if you
> > can write in DJGPP.
> > Again, I'm looking forward,
> > Al.
> >
> >
> >
> >
> > /* Program to draw a Circle */
> >
> > #include <graphics.h>
> > #include <stdlib.h>
> > #include <stdio.h>
> > #include <conio.h>
> >
> > int main(void)
> > {
> >
> > /* request auto-detection */
> > int gdriver = DETECT, gmode, errorcode;
> > int midx, midy;
> > int radius = 100;
> >
> > /* initialise graphics and local variables */
> > initgraph(&gdriver, &gmode, "");
> >
> > /* read result of initialisation */
> > errorcode = graphresult();
> > if (errorcode != grOk) /* an error occurred */
> > {
> >
> > printf("Graphics error: %s\n",
> > grapherrormsg(errorcode));
> > printf("Press any key to halt:");
> > getch();
> > exit(1); /* terminate with an error code */
> >
> > }
> >
> > midx = getmaxx() / 2;
> > midy = getmaxy() / 2;
> > setcolor(getmaxcolor());
> >
> > /* draw the circle */
> > circle(midx, midy, radius);
> >
> > /* clean up */
> > getch();
> > closegraph();
> > return 0;
> >
> > }
> >
> >
you might try GRX and it's embedded BGI emulation.
check the docs on
http://grx.gnu.de
--
Gruss Waldemar Schultz. schultz AT ma DOT tum DOT de
Technische Universität München, Zentrum Mathematik M1, D 80290 München
Tel: +49 (0)89 2892 8226 FAX: +49 (0)89 2892 8228
- Raw text -