Volumes Of Fun
http://www.volumesoffun.com/phpBB3/

C# bindings .dll is invalid
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=15&t=473
Page 1 of 1

Author:  Jon [ Tue Jan 15, 2013 7:13 pm ]
Post subject:  C# bindings .dll is invalid

I cloned the develop branch, ran CMake, then compiled with VS 2010 (Build log), and tried to add PolyVoxCoreCSharp.dll as a reference but it gives me the error:

Quote:
---------------------------
Microsoft Visual Studio
---------------------------
A reference to 'C:\Projects\polyvox\polyvox\build\library\bindings\Release\PolyVoxCoreCSharp.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.
---------------------------
OK
---------------------------

Author:  milliams [ Tue Jan 15, 2013 10:05 pm ]
Post subject:  Re: C# bindings .dll is invalid

The output of the bindings generation process at the moment is not a C# DLL but rather a C++ (native) DLL (PolyVoxCoreCSharp.dll) and a bunch of .cs files. You can generate the C# DLL yourself by running something like:
Code:
csc.exe PolyVoxCorePINVOKE.cs Vector3Duint32_t.cs Region.cs SimpleVolumeuint8.cs SurfaceMeshPositionMaterialNormal.cs MarchingCubesSurfaceExtractorSimpleVolumeuint8.cs Vector3Dint32_t.cs BaseVolumeuint8.cs Vector3Dfloat.cs WrapMode.cs uint32Vector.cs PositionMaterialNormalVector.cs LodRecordVector.cs SWIGTYPE_p_PolyVox__DefaultMarchingCubesControllerT_unsigned_char_t.cs PositionMaterialNormal.cs LodRecord.cs -target:library -out:PolyVoxCoreActualCSharp.dll
which should create a PolyVoxCoreActualCSharp.dll which you can reference in your C# project.

One of my next tasks is to automate this process as part of the PolyVox build process but in the meantime, this should work.

Author:  Jon [ Wed Jan 16, 2013 12:54 am ]
Post subject:  Re: C# bindings .dll is invalid

That worked, however I had to rejigger it to:

Code:
csc.exe /target:library /out:PolyVoxCoreActualCSharp.dll PolyVoxCorePINVOKE.cs Vector3Duint32_t.cs Region.cs SimpleVolumeuint8.cs SurfaceMeshPositionMaterialNormal.cs MarchingCubesSurfaceExtractorSimpleVolumeuint8.cs Vector3Dint32_t.cs BaseVolumeuint8.cs Vector3Dfloat.cs WrapMode.cs uint32Vector.cs PositionMaterialNormalVector.cs LodRecordVector.cs SWIGTYPE_p_PolyVox__DefaultMarchingCubesControllerT_unsigned_char_t.cs PositionMaterialNormal.cs LodRecord.cs


Also, what is the C# library missing? Is it complete enough to make a Minecraft style game with different sized voxels?

Author:  David Williams [ Wed Jan 16, 2013 9:24 am ]
Post subject:  Re: C# bindings .dll is invalid

Jon wrote:
Also, what is the C# library missing? Is it complete enough to make a Minecraft style game...

Matt can confirm but I believe the SimpleVolume class and CubicSurfaceExtractor have been wrapped, and these are all you need to get started.

Jon wrote:
...with different sized voxels?

Be aware that PolyVox doesn't really handle different sized voxels for you. You can implement something on top of PolyVox (like we did here) but this will be some work on your part (and will depend on your exact needs).

Author:  milliams [ Wed Jan 16, 2013 10:20 am ]
Post subject:  Re: C# bindings .dll is invalid

David Williams wrote:
Jon wrote:
Also, what is the C# library missing? Is it complete enough to make a Minecraft style game...
Matt can confirm but I believe the SimpleVolume class and CubicSurfaceExtractor have been wrapped, and these are all you need to get started.

Right now only the MarchingCubesSurfaceExtractor has been wrapped but it's trivial for me to add the Cubic one too (I should be able to add this today). All the volume types are wrapped though so you can choose between SimpleVolume (probably good to start with for testing) and LargeVolume (probably what you will want to use long-term).

In addition to this, the bindings currently contain all the Vectors, Regions, VertexTypes and Meshes. The main things that are missing at the moment in the bindings are Raycast, AStarPathFinder and VolumeResampler but these will all be wrapped by the next release (some of them are difficult to wrap due to their use of callbacks).

Apart from those, the other main thing that is missing is binding-specific documentation. Almost all the classes and functions work exactly the same as their C++ counterparts but we at least need some docs saying that :)

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/