SFML community forums

General => Feature requests => Topic started by: vincentrevelations on November 02, 2010, 08:24:13 pm

Title: parameter for nbSegments in Circle()
Post by: vincentrevelations on November 02, 2010, 08:24:13 pm
This is a simple one.

When using Circle() to define a shape, it always has 40 segments.
That's good for most circles, but way too much for small circles (slow performance) and way too few for big circles (looks ugly).

Why don't you add an overload for Circle with an extra parameter for the number of segments?

This should not cause any conflicts with existing projects.
Title: parameter for nbSegments in Circle()
Post by: Nexus on November 03, 2010, 09:11:58 pm
I have already wondered about the magic number 40, too. ;)

Another option would be to adapt the number of points to the radius. If one scales up a small circle, he probably accepts a worse appearance.
Title: parameter for nbSegments in Circle()
Post by: NoIdea on November 03, 2010, 09:41:58 pm
I think having a default parameter equal to 40 is good. However, I think the user should be able to decide how many he wants : what if you make a game and you set the number of sides depending on the FPS of the game : you put it to high/low quality. This lets you create a game that will work (but look ugly) on poor computers and the same game that will also work (and look great) on a good computer.
Title: parameter for nbSegments in Circle()
Post by: vincentrevelations on November 03, 2010, 10:37:25 pm
(dynamically or otherwise) changing the number of segments according to the radius or the performance is all stuff we can easely implement when there's that extra parameter overload ;)

if implemented correctly in the sfml libs, it's only about 5 more lines of code, and one extra function overload. you can easely do this yourself if you downloaded the sources for smfl and compiled it.
Title: parameter for nbSegments in Circle()
Post by: NoIdea on November 03, 2010, 10:39:17 pm
That's exactly what I mean...