I am trying to use marshalling in C#. In C++ I have a this struct:
struct aiScene { unsigned int mFlags; C_STRUCT aiNode* mRootNode; unsigned int mNumMeshes; C_STRUCT aiMesh** mMeshes; unsigned int mNumMaterials; C_STRUCT aiMaterial** mMaterials; unsigned int mNumAnimations; C_STRUCT aiAnimation** mAnimations; unsigned int mNumTextures; C_STRUCT aiTexture** mTextures; unsigned int mNumLights; C_STRUCT aiLight** mLights; unsigned int mNumCameras; C_STRUCT aiCamera** mCameras; } So, C# eqvivalent is:
[StructLayout(LayoutKind.Sequential)] public struct aiScene { public uint mFlags; public unsafe aiNode* mRootNode; public uint mNumMeshes; public unsafe aiMesh** mMeshes; public uint mNumMaterials; public unsafe aiMaterial** mMaterials; public uint mNumAnimations; public unsafe aiAnimation** mAnimations; public uint mNumTextures; public unsafe aiTexture** mTextures; public uint mNumLights; public unsafe aiLight** mLights; public uint mNumCameras; public unsafe aiCamera** mCameras; } But many on this structs are managed ( aiNode, aiMesh, aiLight ) etc. So, I have this error:
Cannot take the address of, get the size of, or declare a pointer to a managed type ('Assimp.aiNode')
Any ideas on how to solve this issue?