ShivaVG C# Wrapper – Progress

So many enums!

This isn't even half the enums.

Enums, enums, enums!  OpenVG uses a boatload of ’em.

Instead of sleeping tonight I made some serious progress writing the C# wrapper for ShivaVG.  I’ve managed to convert all of the methods of the base OpenVG and the VG utility functions.  I’m going to go ahead and stick what I currently have up on in case anyone wants to take a look at it and maybe test it, it should all work but as of now it’s almost entirely untested.

To use it, you’ll basically just want to go grab the latest ShivaVG, compile it and put the libOpenVG.dll somewhere where your C# app can find it.  Everything is under the ShivaVG namespace, with most of the functions living under the VG class except for the utility drawing functions which are in VGU.

Looking back at the ShivaVG code, it looks like almost all the functions needed are there, so it should be possible to recreate some of the sample tests in C# now.

Stay tuned for the next post, where I’ll be posting screenies of the app running and hopefully rendering my artwork, loaded and parsed straight from the SVG file.

For those of you that may have missed the link above, here’s my C# ShivaVG wrapper!


4 responses to “ShivaVG C# Wrapper – Progress

    • It should work fine with Mono, but if you’re on a non-Windows platform you’ll need to recompile ShivaVG and update the references in my wrapper code to point to the .so instead of the .dll or whatnot.

      • I’ve never done native interop on mono, so I’m very unsure of how it works. Can you just call native functions by specifying a .so instead of a .dll under Unix? The same you do with regular .dlls on Windows?

      • Yeah I think you can do exactly that. I did a quick search and I think DLLImport works with Mono. You’ll see to recompile ShivaVG into a .so though and then just replace all the references to the .dll file in my wrapper code.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s