Yeah, I'm working with visual studio 2010 on windows 7. I managed to get some .cs classes generated and a PolyVoxCore_wrap.cxx to include in the dll by using
Code:
swig -csharp -c++ -I../PolyVoxCore/include PolyVoxCore.i
There are a few warnings e.g.
Quote:
../PolyVoxCore/include\Density.h(69) : Warning 503: Can't wrap 'operator <' unless renamed to a valid identifier.
../PolyVoxCore/include\Vector.h(78) : Warning 503: Can't wrap 'operator =' unless renamed to a valid identifier.
../PolyVoxCore/include\Vector.h(80) : Warning 503: Can't wrap 'operator ==' unless renamed to a valid identifier.
../PolyVoxCore/include\Vector.h(82) : Warning 503: Can't wrap 'operator <' unless renamed to a valid identifier.
Hopefully the proxy classes will still work, going to try it out in a few min. If it works I'll try making some more .i files for the mesh generation classes so I can get some actual stuff rendering in xna
edit:
Apparently I have to rename all these operators or something
Quote:
(iii) SWIG will no longer wrap a declaration if its symbol
table name contains illegal identifier characters. If
illegal characters are detected, you will see an error
like this:
Warning. Can't wrap operator* unless renamed to a valid identifier.
The only way to fix this is to use %rename or %name to bind
the operator to a nice name like "add" or something. Note:
the legal identifier characters are determined by the target
language.
edit2: Okay, got it generating the proxies with no warnings. I haven't tested it yet in c# but here is the modified PolyVoxCore.i:
Code:
%module PolyVoxCore
#define POLYVOX_API
%rename(equals) operator==;
%rename(notEqualTo) operator!=;
%rename(lessThan) operator<;
%rename(greaterThan) operator>;
%rename(lessThanOrEqual) operator<=;
%rename(greaterThanOrEqual) operator>=;
%rename(assignment) operator=;
%rename(additionAssignment) operator+=;
%rename(subtractionAssignment) operator-=;
%rename(multiplicationAssignment) operator*=;
%rename(divisionAssignment) operator/=;
%include "stdint.i"
%include "Material.i"
%include "Density.i"
%include "Vector.i"
%include "Region.i"
%include "Volume.i"
edit3: Got interfaces made for SurfaceMesh and SurfaceExtractor, but I'm having trouble with VertexTypes because it doesn't know what POLYVOXCORE_API is.
Quote:
../PolyVoxCore/include\VertexTypes.h(35) : Error: Syntax error in input(1).