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

Author Topic: Scalable vector graphic support in SFML?  (Read 5122 times)

0 Members and 1 Guest are viewing this topic.

starkhorn

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • Email
Scalable vector graphic support in SFML?
« on: June 03, 2015, 02:52:06 am »
Hi Folks,

I tried loading in a Scalable vector graphic (SVG) file into a texture using the loadfromFile method.
I get:-
Reason: Image not of any known type, or corrupt
Failed to create texture, invalid size (0x0)
 

So then I tried to search to see if SFML supports SVG. I found the change log but no mention of SVG support.
http://www.sfml-dev.org/changelog.php

In addition searches in this forum suggest this isn't supported. I found the below thread from 2012.

http://en.sfml-dev.org/forums/index.php?topic=7667.0

As this is a few years old now, I thought to re-ask the question. I'm assuming the answer is still no but wondering if this was a feature to be included later?

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Scalable vector graphic support in SFML?
« Reply #1 on: June 03, 2015, 03:51:36 am »
No SFML doesn't support it and no there isn't plans to implement it (unless something is planned that nobody has been talking about). Nobody has even bothered yet to implement it as a addon project to SFML that I am aware of so as you can see its not a big deal for most people.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Scalable vector graphic support in SFML?
« Reply #2 on: June 03, 2015, 07:37:33 am »
Your post is not clear. Do you just want to be able to load (rasterize) SVG files into textures, or do you want full vector graphics support into SFML?
Laurent Gomila - SFML developer

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Scalable vector graphic support in SFML?
« Reply #3 on: June 04, 2015, 01:09:44 pm »
I'd love being able to read SVG images as some kind of sf::GraphicsShape or whatever (or maybe even just sf::VertexArray), but lack of time, other things to do first, and a such big/complex file format/standard. :(

starkhorn

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • Email
Re: Scalable vector graphic support in SFML?
« Reply #4 on: June 05, 2015, 01:46:18 am »
Your post is not clear. Do you just want to be able to load (rasterize) SVG files into textures, or do you want full vector graphics support into SFML?

Sorry if I was not clear.

I was simply trying to load SVG files into textures, i.e. I used the texture loadfromFile method and I got that file format unknown error.

This led me to confirm whether loading in SVG was supported - hence this post.

I was not trying to do anything SVG specific - I was simply given an image in this format and I tried to load it as I would a PNG or JPEG etc.

I want to zoom right in on an image and a friend suggested using a SVG to reduce it looking pixelated on zooms in.
« Last Edit: June 05, 2015, 02:30:57 am by starkhorn »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Scalable vector graphic support in SFML?
« Reply #5 on: June 05, 2015, 08:01:35 am »
Quote
I want to zoom right in on an image and a friend suggested using a SVG to reduce it looking pixelated on zooms in.
That requires real vector graphics rendering. Simply loading a SVG file won't make any difference compared to any other format, after loading it's just an array or RGBA pixels, no matter which file format it was loaded from.
Laurent Gomila - SFML developer

 

anything