Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Smooth a shape?  (Read 4090 times)

0 Members and 1 Guest are viewing this topic.

CL90

  • Newbie
  • *
  • Posts: 12
    • View Profile
Smooth a shape?
« 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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Smooth a shape?
« Reply #1 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.
Laurent Gomila - SFML developer

CL90

  • Newbie
  • *
  • Posts: 12
    • View Profile
Smooth a shape?
« Reply #2 on: February 08, 2012, 08:51:19 pm »
ah thanks!

blinry

  • Newbie
  • *
  • Posts: 1
    • View Profile
Smooth a shape?
« Reply #3 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!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Smooth a shape?
« Reply #4 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.
Laurent Gomila - SFML developer

 

anything