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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - VL-Impact

Pages: [1]
1
General discussions / Re: Limited SVG support - SVGTexture
« on: February 10, 2016, 08:53:37 pm »
goto error;
Agreed, it's a bad habit to mix in C-style error handling when RAII is available; now it's fixed.

Manual memory management with malloc and free is a no-no in C++, obviously...
Yup, fixed that too.

Quote
And the inheritance from sf::Texture is also a little worrying.
There's no need for it.
Yes, good point. I've removed inheritance and made load function static. Or maybe it will be even better to make it free function, like
bool loadTextureFromSvgFile (Texture& targetTexture, const std::string & filename,
                             const std::string & units = "px", float dpi = 96.0f);
?

Quote
I think I'd enjoy a way to get a triangle strip vertex array with right colors and all more than just rasterizing but I have no idea if that's possible with that nanosvg library.
Well, I've managed to get at least lines strip vertex array using nanosvg, so I have to think about that. :)

Quote
I mean, If I want to just rasterize an SVG I can do it offline
Yes, I know, but topics about SVG support appear time to time at forum, so I've decided to make some start :)

2
General discussions / Limited SVG support - SVGTexture
« on: February 09, 2016, 08:13:10 pm »
Hi folks!

I've found nice library named Nanosvg that provides both SVG parser and rasterizer;
so I've implemented small wrapper around it, that allows to load SFML Texture from '.svg' files.

According to Nanosvg's author, his library (and therefore SVGTexture) has limited support of SVG standart, but still, pretty complex images can be processed. I.e. it renders SFML SVG logo pretty well! :P

So, here's the code: https://github.com/VL-Impact/SFML-SVGTexture

Any feedback is welcome.

Pages: [1]
anything