Mail Archives: djgpp/2002/02/18/07:04:32
I think you should look for info about GFX and
Allegro in DJGPP's home page.
I've heard that there is a more or less automatic
conversion from TurboC to GFX.
--- "Al E. B." <arjupt AT postmaster DOT co DOT uk> escribió: >
Hi,
> 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;
>
> }
>
>
_______________________________________________________________
Do You Yahoo!?
Yahoo! Messenger
Comunicación instantánea gratis con tu gente.
http://messenger.yahoo.es
- Raw text -