Original Post
Hi, I am trying to write a c# wrapper for my engine. I have had some success. I have come across an issue which i am struggling to resolve. I have an array of vertices, position/color/texcoord i am passing the array to my managed c++ wrapper. I want to convert the array to an unmanaged array so native c++ can use it. For individual variables i have been using the 'GCHandle' class which freezes the managed variable and passes back an IntPtr where i can get a void* for my native c++. However this class doesnt have anything to do with arrays. I have been looking at the 'Marshal' class which has some information on it but its horrid and the documentation is crap. Can anyone help? here is my barebone managed c++ function. Thanks
UINT CreateVertexBuffer(UINT size,
UINT type,
UINT nVerts,
array<Object^> ^ verts ,
bool bDynamic)
{
UINT nVBID;
pPrimMan->CreateVertexBuffer(&nVBID,size,type,nVerts,***VERTS***,bDynamic);
return nVBID;
}