It is currently Wed Dec 11, 2019 9:09 am


All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: C# bindings .dll is invalid
PostPosted: Tue Jan 15, 2013 7:13 pm 

Joined: Tue Jan 15, 2013 5:12 am
Posts: 2
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
---------------------------


Top
Offline Profile  
Reply with quote  
 Post subject: Re: C# bindings .dll is invalid
PostPosted: Tue Jan 15, 2013 10:05 pm 
Developer
User avatar

Joined: Sun May 11, 2008 4:29 pm
Posts: 198
Location: UK
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.

_________________
Matt Williams
Linux/CMake guy


Top
Offline Profile  
Reply with quote  
 Post subject: Re: C# bindings .dll is invalid
PostPosted: Wed Jan 16, 2013 12:54 am 

Joined: Tue Jan 15, 2013 5:12 am
Posts: 2
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?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: C# bindings .dll is invalid
PostPosted: Wed Jan 16, 2013 9:24 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
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).


Top
Offline Profile  
Reply with quote  
 Post subject: Re: C# bindings .dll is invalid
PostPosted: Wed Jan 16, 2013 10:20 am 
Developer
User avatar

Joined: Sun May 11, 2008 4:29 pm
Posts: 198
Location: UK
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 :)

_________________
Matt Williams
Linux/CMake guy


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net