Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 31 Mar 2014
Offline Last Active Sep 18 2016 09:23 PM

Posts I've Made

In Topic: SDL2 vector graphics image loader

02 April 2015 - 03:26 PM

Also because the second example does not display the image there is no need for the glfw linking along with gl. glfw is just a window manager.

Yeah, I know, I've just been lazy hitting 'up' and changing 1s to 2s in gcc command =)

Glad everything worked.

In Topic: SDL2 vector graphics image loader

02 April 2015 - 04:04 AM

Well this is the answer for your problem with compiling examples.




Go to http://www.glfw.org/, download source package.


Then go to console and type the following:

unzip glfw-3.1.1.zip
cd glfw-3.1.1/
mkdir curbuild && cd curbuild
cmake -G "Unix Makefiles" -DBUILD_SHARED_LIBS=ON ../
make -j3 
sudo make install

this will place your glfw headers and .so files in appropriate folders under the /usr/local ( you don't have to manually move anything ).


Then some part of magic takes effect.

It happened so, that nanosvg has some kind of unhealthy build system inside ( premake4 + pre-made makefiles + damaged ( ??? ) Makefile generated from premake4 ).

To build example do the following.


Download nanosvg as .zip from the official github page.

In your console:


unzip nanosvg-master.zip
cd nanosvg-master/example
cp ../src/nanosvg* .
gcc -O2 example1.c -L/usr/local/lib -lGL -lglfw -lm -Wl,-rpath=/usr/local/lib -o example1
gcc -O2 example2.c -L/usr/local/lib -lGL -lglfw -lm -Wl,-rpath=/usr/local/lib -o example2

After performing these actions I was able to launch both examples. Good luck to you, and if you need any further explanations ( i.e. makefiles, command line invocations ) feel free to ask.



I don't know if GLEW is really needed here, cause I have one installed in /usr/local, but it seems that GLFW and nanosvg have no dependencies on GLEW, and I was able to compile, link and run without linking against libGLEW.so.


btw, my current system is Linux Mint 17.

Linux host 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2

I have Debian 8 x64 at home, if you need, I can test this there too.


In Topic: SDL2 vector graphics image loader

02 April 2015 - 01:14 AM

I'm trying to build examples and getting the same errors.

I'll report my progress as I'll solve something.

In Topic: SDL2 vector graphics image loader

01 April 2015 - 04:08 PM

Hi there.

This topic contains a good bit of information about your question.

In shorts: you must obtain some kind of parser/rasterizer library ( such as nanosvg ), integrate it into your project, then use it to load & rasterize SVG image & then pass the results as a pixel data to your SDL_Surface. Then you are free to go with the creation of SDL_Texture or whatever.

Neither SDL1.2 nor SDL2 have direct support for SVG.



SVG format is a way far from being dead.

In Topic: LibGDX Box2D libraries

21 March 2015 - 02:53 PM

You can open them with anything that supports ZIP compression to see whats inside, you'll see the .dll for windows, .so for Linux and .dylib for OSX, x86 and x86_64 versions.

Wow, didn't know that, thanks.