[SDL] "Perfect" circles

Alan Wolfe Atrix2 at cox.net
Wed Nov 8 08:02:09 PST 2006


Ahh.... thanks, gonna update the old memory banks :P

-----Original Message-----
From: sdl-bounces+atrix2=cox.net at libsdl.org
[mailto:sdl-bounces+atrix2=cox.net at libsdl.org] On Behalf Of Mike Shal
Sent: Wednesday, November 08, 2006 7:29 AM
To: A list for developers using the SDL library. (includes SDL-announce)
Subject: Re: [SDL] "Perfect" circles

On 11/8/06, Alan Wolfe <Atrix2 at cox.net> wrote:
> Maybe this doesn't apply any more but I think that it does...someone
correct
> these statements if they are wrong please
>
> Using the circle equation to draw circles doesn't give a perfect circle,
it
> gives an ellipse.  The reason is because the pixels in your monitor
> themselves aren't perfect squares (unless you are on a Macintosh I
believe).
>
> So what you need to do is use the ellipse function to reverse the effects
of
> the monitor being distorted.
>
> Is this archaic information which is no longer true or is it still
relevant?
> I'm not sure so please someone else help me out :P

I think you're thinking of the old-school 320x200 (256 color) mode,
which has an 8:5 aspect ratio. This doesn't quite match up with your
monitor's typical 4:3 aspect ratio. I think this video mode was
popular because of the fact that it fit in a single segment in memory
in those 16bit days (320 * 200 = 64000, and a segment could access
65536 bytes). Of course, the fact that your squares were rectangles
and circles were ellipses led to the infamous "Mode X", which was
320x240 (4:3 ratio), but still 256 colors.

Nowadays if your monitor is 4:3 you're probably running at 640x480,
800x600, 1024x768, 1600x1200, etc. - all of these modes are 4:3, so if
you try to draw a circle it should look like a circle (well, a
pixelated circle, but not elongated into an ellipse).

-Mike

_______________________________________________
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl





More information about the SDL mailing list