SFML community forums

Help => Graphics => Topic started by: CL90 on February 08, 2012, 06:04:27 pm

Title: Smooth a shape?
Post by: CL90 on February 08, 2012, 06:04:27 pm
Hi there!

is there a way to smooth a circle?
if smooth is the wrong discription. i mean Anti Aliasing.

shapes like this:
Code: [Select]
App.Draw(10,10, 55, sf::Color(0, 0, 0, 0), 2, sf::Color(251, 169, 89, 150)));
looks a bit edgy =(

i'm about to create some Png wich looks nicer.
btw, what costs more performance? drawing a circle, or including a image?
Depens on size?
Title: Smooth a shape?
Post by: Laurent on February 08, 2012, 07:10:34 pm
You must turn antialiasing on when you create the window.

Quote
btw, what costs more performance? drawing a circle, or including a image?

It depends, it's hard to give a generic answer.
Title: Smooth a shape?
Post by: CL90 on February 08, 2012, 08:51:19 pm
ah thanks!
Title: Smooth a shape?
Post by: blinry on February 09, 2012, 05:26:51 pm
Is it correct that this doesn't work under Linux right now?

If so, is there anything I can do to enable antialiasing for primitives? I'm willing to hack the source and stuff ;-)
If not: How would I do this exactly?

Thanks!
Title: Smooth a shape?
Post by: Laurent on February 09, 2012, 06:55:12 pm
Quote
Is it correct that this doesn't work under Linux right now?

Yes.

Quote
If so, is there anything I can do to enable antialiasing for primitives?

You can render your primitives to a smoothed render texture, and draw it with a sprite. If it's not smooth enough, you can try to use a smaller render texture and scale it when it's drawn.