delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/02/16/10:22:37

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
MIME-Version: 1.0
X-Mailer: MIME-tools 5.41 (Entity 5.404)
From: "Al E. B." <arjupt AT postmaster DOT co DOT uk>
Subject: Re: Graphics
To: djgpp AT delorie DOT com
Date: Sat, 16 Feb 2002 15:21:17 +0000
X-Postmaster: Sent from Postmaster http://www.postmaster.co.uk/, the
world's premier free web-based email service, based in London, England.
X-Postmaster-Trace: Account name: arjupt; Local time: Sat Feb 16 15:21:17
2002; Local host: pmweb8.uk1.bibliotech.net; Remote host: 212.137.206.18;
Referer site: www.postmaster.co.uk
X-Complaints-To: Administrator AT postmaster DOT co DOT uk
Message-Id: <PM.5485.1013872877@pmweb8.uk1.bibliotech.net>
Reply-To: djgpp AT delorie DOT com

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;

}


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019