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

Author Topic: Is there a way to render SVG files with SFML?  (Read 7148 times)

0 Members and 1 Guest are viewing this topic.

louie

  • Newbie
  • *
  • Posts: 19
    • View Profile
    • Email
Is there a way to render SVG files with SFML?
« on: October 09, 2016, 10:55:45 am »
Or is there a library for that stuff that works well alongside SFML?

dabbertorres

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • website/blog
Re: Is there a way to render SVG files with SFML?
« Reply #1 on: October 09, 2016, 11:29:57 am »
You could use a svg parsing library like nanosvg, and then (using the data obtained from parsing) rasterize it to an SFML primitive.

It's relatively straightforward to do. It just needs to be done. ie: The hard part. :)

Otherwise, I don't know of anything that already does so.

louie

  • Newbie
  • *
  • Posts: 19
    • View Profile
    • Email
Re: Is there a way to render SVG files with SFML?
« Reply #2 on: October 09, 2016, 11:45:36 am »
Thanks, man! I think nanosvg will do just fine :)

korczurekk

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • Email
Re: Is there a way to render SVG files with SFML?
« Reply #3 on: October 09, 2016, 12:15:39 pm »
I attached my library to draw Bezier Curves in SFML. It wasn't meant to be published, so it lacks documentation, but it's pretty short.