Ada计算机图形DirectX之D3DX10mesh

----------------------------------------
-- File : D3DX10mesh.ads              --
-- Translator:Dongfeng.Gu,2018/10/25  --
-- Mail: 515639@qq.com                --
-- Progress:100%                      --
----------------------------------------

with win32;                                use win32;
with win32.windef;                         use win32.windef;
with win32.rpcdce;                         use win32.rpcdce;
with win32.objbase;                        use win32.Objbase;
with win32.Wingdi;
with win32.Winerror;

with DXGI;                                 use DXGI;
with d3d10;                                use d3d10;
with D3D10_1;                              use D3D10_1;
with d3d10misc;                            use d3d10misc;
with d3dx10core;                           use d3dx10core;

package D3DX10mesh is

   IID_ID3DX10BaseMesh:constant win32.rpcdce.GUID:=(16#7ed943dd#,16#52e8#,16#40b5#,(16#a8#,16#d8#,16#76#,16#68#,16#5c#,16#40#,16#63#,16#30#));
   IID_ID3DX10MeshBuffer:constant win32.rpcdce.GUID:=(16#4b0d117#,16#1041#,16#46b1#,(16#aa#,16#8a#,16#39#,16#52#,16#84#,16#8b#,16#a2#,16#2e#));
   IID_ID3DX10Mesh:constant win32.rpcdce.GUID:=(16#4020e5c2#,16#1403#,16#4929#,(16#88#,16#3f#,16#e2#,16#e8#,16#49#,16#fa#,16#c1#,16#95#));
   IID_ID3DX10PMesh:constant win32.rpcdce.GUID:=(16#8875769a#,16#d579#,16#4088#,(16#aa#,16#eb#,16#53#,16#4d#,16#1a#,16#d8#,16#4e#,16#96#));
   IID_ID3DX10SPMesh:constant win32.rpcdce.GUID:=(16#667ea4c7#,16#f1cd#,16#4386#,(16#b5#,16#23#,16#7c#,16#2#,16#90#,16#b8#,16#3c#,16#c5#));
   IID_ID3DX10PatchMesh:constant win32.rpcdce.GUID:=(16#3ce6cc22#,16#dbf2#,16#44f4#,(16#89#,16#4d#,16#f9#,16#c3#,16#4a#,16#33#,16#71#,16#39#));
   type tagD3DX10_MESH is (D3DX10_MESH_32_BIT,
                           D3DX10_MESH_GS_ADJACENCY);
   for tagD3DX10_MESH use (D3DX10_MESH_32_BIT=>16#001#,
                           D3DX10_MESH_GS_ADJACENCY=>16#004#);

   subtype D3DX10_MESH is tagD3DX10_MESH;

   type LPD3DX10_MESH is access tagD3DX10_MESH;

   type tagD3DX10_ATTRIBUTE_RANGE is record
      AttribId: UINT;
      FaceStart: UINT;
      FaceCount: UINT;
      VertexStart: UINT;
      VertexCount: UINT;
   end record;

   subtype D3DX10_ATTRIBUTE_RANGE is tagD3DX10_ATTRIBUTE_RANGE;

   type LPD3DX10_ATTRIBUTE_RANGE is access all tagD3DX10_ATTRIBUTE_RANGE;
   type LPCD3DX10_ATTRIBUTE_RANGE is access constant D3DX10_ATTRIBUTE_RANGE;


   type tagD3DX10_MESH_DISCARD_FLAGS is (D3DX10_MESH_DISCARD_ATTRIBUTE_BUFFER,
                                         D3DX10_MESH_DISCARD_ATTRIBUTE_TABLE,
                                         D3DX10_MESH_DISCARD_POINTREPS,
                                         D3DX10_MESH_DISCARD_ADJACENCY,
                                         D3DX10_MESH_DISCARD_DEVICE_BUFFERS);
   for tagD3DX10_MESH_DISCARD_FLAGS use (D3DX10_MESH_DISCARD_ATTRIBUTE_BUFFER=>16#01#,
                                         D3DX10_MESH_DISCARD_ATTRIBUTE_TABLE=>16#02#,
                                         D3DX10_MESH_DISCARD_POINTREPS=>16#04#,
                                         D3DX10_MESH_DISCARD_ADJACENCY=>16#08#,
                                         D3DX10_MESH_DISCARD_DEVICE_BUFFERS=>16#10#);

   subtype D3DX10_MESH_DISCARD_FLAGS is tagD3DX10_MESH_DISCARD_FLAGS;

   type LPD3DX10_MESH_DISCARD_FLAGS is access tagD3DX10_MESH_DISCARD_FLAGS;

   type tagD3DX10_WELD_EPSILONS is record
      Position: FLOAT;
      BlendWeights: FLOAT;
      Normal: FLOAT;
      PSize: FLOAT;
      Specular: FLOAT;
      Diffuse: FLOAT;
      Texcoord: FLOAT_Array(0..8-1);
      Tangent: FLOAT;
      Binormal: FLOAT;
      TessFactor: FLOAT;
   end record;

   subtype D3DX10_WELD_EPSILONS is tagD3DX10_WELD_EPSILONS;

   type LPD3DX10_WELD_EPSILONS is access all tagD3DX10_WELD_EPSILONS;


   type tagD3DX10_INTERSECT_INFO is record
      FaceIndex: UINT;
      U: FLOAT;
      V: FLOAT;
      Dist: FLOAT;
   end record;

   subtype D3DX10_INTERSECT_INFO is tagD3DX10_INTERSECT_INFO;

   type LPD3DX10_INTERSECT_INFO is access all tagD3DX10_INTERSECT_INFO;

   type ID3DX10MeshBuffer;
   type LPID3DX10MeshBuffer is access all ID3DX10MeshBuffer;
   type LPLPID3DX10MeshBuffer is access all LPID3DX10MeshBuffer;
   subtype LPD3DX10MeshBuffer is LPID3DX10MeshBuffer;
   subtype LPLPD3DX10MeshBuffer is LPLPID3DX10MeshBuffer;

   type ID3DX10Mesh;
   type LPID3DX10Mesh is access all ID3DX10Mesh;
   type LPLPID3DX10Mesh is access all LPID3DX10Mesh;
   subtype LPD3DX10Mesh is LPID3DX10Mesh;
   subtype LPLPD3DX10Mesh is LPLPID3DX10Mesh;





   type ID3DX10MeshBuffer is record
      QueryInterface:access procedure(THIS:LPID3DX10MeshBuffer;iid:REFIID;ppv:LPLPVOID) with Convention=>Stdcall;
      AddRef:access function(THIS:LPID3DX10MeshBuffer) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPID3DX10MeshBuffer) return ULONG with Convention=>Stdcall;
      Map:access procedure(THIS:LPID3DX10MeshBuffer;ppData:LPLPvoid;pSize:LPSIZE_T) with Convention=>Stdcall;
      Unmap:access procedure(THIS:LPID3DX10MeshBuffer) with Convention=>Stdcall;
      GetSize:access function(THIS:LPID3DX10MeshBuffer) return SIZE_T with Convention=>Stdcall;
   end record;

   type ID3DX10Mesh is record
      QueryInterface:access procedure(THIS:LPID3DX10Mesh;iid:REFIID;ppv:LPLPVOID) with Convention=>Stdcall;
      AddRef:access function(THIS:LPID3DX10Mesh) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPID3DX10Mesh) return ULONG with Convention=>Stdcall;
      GetFaceCount:access function(THIS:LPID3DX10Mesh) return UINT with Convention=>Stdcall;
      GetVertexCount:access function(THIS:LPID3DX10Mesh) return UINT with Convention=>Stdcall;
      GetVertexBufferCount:access function(THIS:LPID3DX10Mesh) return UINT with Convention=>Stdcall;
      GetFlags:access function(THIS:LPID3DX10Mesh) return UINT with Convention=>Stdcall;
      GetVertexDescription:access procedure(THIS:LPID3DX10Mesh;ppDesc:LPLPD3D10_INPUT_ELEMENT_DESC;pDeclCount:LPUINT) with Convention=>Stdcall;
      SetVertexData:access procedure(THIS:LPID3DX10Mesh;iBuffer:UINT;pData:LPCvoid) with Convention=>Stdcall;
      GetVertexBuffer:access procedure(THIS:LPID3DX10Mesh;iBuffer:UINT;ppVertexBuffer:LPLPID3DX10MeshBuffer) with Convention=>Stdcall;
      SetIndexData:access procedure(THIS:LPID3DX10Mesh;pData:LPCvoid;cIndices:UINT) with Convention=>Stdcall;
      GetIndexBuffer:access procedure(THIS:LPID3DX10Mesh;ppIndexBuffer:LPLPID3DX10MeshBuffer) with Convention=>Stdcall;
      SetAttributeData:access procedure(THIS:LPID3DX10Mesh;pData:LPCUINT) with Convention=>Stdcall;
      GetAttributeBuffer:access procedure(THIS:LPID3DX10Mesh;ppAttributeBuffer:LPLPID3DX10MeshBuffer) with Convention=>Stdcall;
      SetAttributeTable:access procedure(THIS:LPID3DX10Mesh;pAttribTable:LPCD3DX10_ATTRIBUTE_RANGE;cAttribTableSize:UINT) with Convention=>Stdcall;
      GetAttributeTable:access procedure(THIS:LPID3DX10Mesh;pAttribTable:LPD3DX10_ATTRIBUTE_RANGE;pAttribTableSize:LPUINT) with Convention=>Stdcall;
      GenerateAdjacencyAndPointReps:access procedure(THIS:LPID3DX10Mesh;Epsilon:FLOAT) with Convention=>Stdcall;
      GenerateGSAdjacency:access procedure(THIS:LPID3DX10Mesh) with Convention=>Stdcall;
      SetAdjacencyData:access procedure(THIS:LPID3DX10Mesh;pAdjacency:LPCUINT) with Convention=>Stdcall;
      GetAdjacencyBuffer:access procedure(THIS:LPID3DX10Mesh;ppAdjacency:LPLPID3DX10MeshBuffer) with Convention=>Stdcall;
      SetPointRepData:access procedure(THIS:LPID3DX10Mesh;pPointReps:LPCUINT) with Convention=>Stdcall;
      GetPointRepBuffer:access procedure(THIS:LPID3DX10Mesh;ppPointReps:LPLPID3DX10MeshBuffer) with Convention=>Stdcall;
      Discard:access procedure(THIS:LPID3DX10Mesh;dwDiscard:D3DX10_MESH_DISCARD_FLAGS) with Convention=>Stdcall;
      CloneMesh:access procedure(THIS:LPID3DX10Mesh;Flags:UINT;pPosSemantic:LPCSTR;pDesc:LPCD3D10_INPUT_ELEMENT_DESC;DeclCount:UINT;ppCloneMesh:LPLPID3DX10Mesh) with Convention=>Stdcall;
      Optimize:access procedure(THIS:LPID3DX10Mesh;Flags:UINT;pFaceRemap:LPUINT;ppVertexRemap:LPLPD3D10BLOB) with Convention=>Stdcall;
      GenerateAttributeBufferFromTable:access procedure(THIS:LPID3DX10Mesh) with Convention=>Stdcall;
      Intersect:access procedure(THIS:LPID3DX10Mesh;pRayPos:LPD3DXVECTOR3;pRayDir:LPD3DXVECTOR3;pHitCount:LPUINT;pFaceIndex:LPUINT;pU:LPfloat;pV:LPfloat;pDist:LPfloat;ppAllHits:LPLPID3D10Blob) with Convention=>Stdcall;
      IntersectSubset:access procedure(THIS:LPID3DX10Mesh;AttribId:UINT;pRayPos:LPD3DXVECTOR3;pRayDir:LPD3DXVECTOR3;pHitCount:LPUINT;pFaceIndex:LPUINT;pU:LPfloat;pV:LPfloat;pDist:LPfloat;ppAllHits:LPLPID3D10Blob) with Convention=>Stdcall;
      CommitToDevice:access procedure(THIS:LPID3DX10Mesh) with Convention=>Stdcall;
      DrawSubset:access procedure(THIS:LPID3DX10Mesh;AttribId:UINT) with Convention=>Stdcall;
      DrawSubsetInstanced:access procedure(THIS:LPID3DX10Mesh;AttribId:UINT;InstanceCount:UINT;StartInstanceLocation:UINT) with Convention=>Stdcall;
      GetDeviceVertexBuffer:access procedure(THIS:LPID3DX10Mesh;iBuffer:UINT;ppVertexBuffer:LPLPID3D10Buffer) with Convention=>Stdcall;
      GetDeviceIndexBuffer:access procedure(THIS:LPID3DX10Mesh;ppIndexBuffer:LPLPID3D10Buffer) with Convention=>Stdcall;
   end record;

   function D3DX10CreateMesh(pDevice:LPID3D10Device;pDeclaration:LPCD3D10_INPUT_ELEMENT_DESC;DeclCount:UINT;pPositionSemantic:LPCSTR;VertexCount:UINT;FaceCount:UINT;Options:UINT;ppMesh:LPLPID3DX10Mesh) return HRESULT with Import,Convention=>stdcall,external_name=>"D3DX10CreateMesh";

   type tagD3DX10_MESHOPT is (D3DX10_MESHOPT_DEVICE_INDEPENDENT,
                              D3DX10_MESHOPT_COMPACT,
                              D3DX10_MESHOPT_ATTR_SORT,
                              D3DX10_MESHOPT_VERTEX_CACHE,
                              D3DX10_MESHOPT_STRIP_REORDER,
                              D3DX10_MESHOPT_IGNORE_VERTS,
                              D3DX10_MESHOPT_DO_NOT_SPLIT
                              );
   for tagD3DX10_MESHOPT use (D3DX10_MESHOPT_DEVICE_INDEPENDENT=>16#00400000#,
                              D3DX10_MESHOPT_COMPACT=>           16#01000000#,
                              D3DX10_MESHOPT_ATTR_SORT=>         16#02000000#,
                              D3DX10_MESHOPT_VERTEX_CACHE=>      16#04000000#,
                              D3DX10_MESHOPT_STRIP_REORDER=>     16#08000000#,
                              D3DX10_MESHOPT_IGNORE_VERTS=>      16#10000000#,
                              D3DX10_MESHOPT_DO_NOT_SPLIT=>      16#20000000#
                              );

   subtype D3DX10_MESHOPT is tagD3DX10_MESHOPT;

   type LPD3DX10_MESHOPT is access tagD3DX10_MESHOPT;

   IID_ID3DX10SkinInfo:constant win32.rpcdce.GUID:=(16#420bd604#,16#1c76#,16#4a34#,(16#a4#,16#66#,16#e4#,16#5d#,16#6#,16#58#,16#a3#,16#2c#));
   D3DX10_SKININFO_NO_SCALING : constant := 0;

   D3DX10_SKININFO_SCALE_TO_1 : constant := 1;

   D3DX10_SKININFO_SCALE_TO_TOTAL : constant := 2;

   type tagD3DX10_SKINNING_CHANNEL is record
      SrcOffset: UINT;
      DestOffset: UINT;
      IsNormal: BOOL;
   end record;

   subtype D3DX10_SKINNING_CHANNEL is tagD3DX10_SKINNING_CHANNEL;

   type LPD3DX10_SKINNING_CHANNEL is access all tagD3DX10_SKINNING_CHANNEL;

   type ID3DX10SkinInfo;
   type LPID3DX10SkinInfo is access all ID3DX10SkinInfo;
   type LPLPID3DX10SkinInfo is access all LPID3DX10SkinInfo;
   subtype LPD3DX10SkinInfo is LPID3DX10SkinInfo;
   subtype LPLPD3DX10SkinInfo is LPLPID3DX10SkinInfo;

   type ID3DX10SkinInfo is record
      QueryInterface:access procedure(THIS:LPID3DX10SkinInfo;iid:REFIID;ppv:LPLPVOID) with Convention=>Stdcall;
      AddRef:access function(THIS:LPID3DX10SkinInfo) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPID3DX10SkinInfo) return ULONG with Convention=>Stdcall;
      GetNumVertices:access function(THIS:LPID3DX10SkinInfo) return UINT with Convention=>Stdcall;
      GetNumBones:access function(THIS:LPID3DX10SkinInfo) return UINT with Convention=>Stdcall;
      GetMaxBoneInfluences:access function(THIS:LPID3DX10SkinInfo) return UINT with Convention=>Stdcall;
      AddVertices:access procedure(THIS:LPID3DX10SkinInfo;Count:UINT) with Convention=>Stdcall;
      RemapVertices:access procedure(THIS:LPID3DX10SkinInfo;NewVertexCount:UINT;pVertexRemap:LPUINT) with Convention=>Stdcall;
      AddBones:access procedure(THIS:LPID3DX10SkinInfo;Count:UINT) with Convention=>Stdcall;
      RemoveBone:access procedure(THIS:LPID3DX10SkinInfo;Index:UINT) with Convention=>Stdcall;
      RemapBones:access procedure(THIS:LPID3DX10SkinInfo;NewBoneCount:UINT;pBoneRemap:LPUINT) with Convention=>Stdcall;
      AddBoneInfluences:access procedure(THIS:LPID3DX10SkinInfo;BoneIndex:UINT;InfluenceCount:UINT;pIndices:LPUINT;pWeights:LPfloat) with Convention=>Stdcall;
      ClearBoneInfluences:access procedure(THIS:LPID3DX10SkinInfo;BoneIndex:UINT) with Convention=>Stdcall;
      GetBoneInfluenceCount:access function(THIS:LPID3DX10SkinInfo;BoneIndex:UINT) return UINT with Convention=>Stdcall;
      GetBoneInfluences:access procedure(THIS:LPID3DX10SkinInfo;BoneIndex:UINT;Offset:UINT;Count:UINT;pDestIndices:LPUINT;pDestWeights:LPfloat) with Convention=>Stdcall;
      FindBoneInfluenceIndex:access procedure(THIS:LPID3DX10SkinInfo;BoneIndex:UINT;VertexIndex:UINT;pInfluenceIndex:LPUINT) with Convention=>Stdcall;
      SetBoneInfluence:access procedure(THIS:LPID3DX10SkinInfo;BoneIndex:UINT;InfluenceIndex:UINT;Weight:float) with Convention=>Stdcall;
      GetBoneInfluence:access procedure(THIS:LPID3DX10SkinInfo;BoneIndex:UINT;InfluenceIndex:UINT;pWeight:LPfloat) with Convention=>Stdcall;
      Compact:access procedure(THIS:LPID3DX10SkinInfo;MaxPerVertexInfluences:UINT;ScaleMode:UINT;MinWeight:float) with Convention=>Stdcall;
      DoSoftwareSkinning:access procedure(StartVertex:UINT;VertexCount:UINT;pSrcVertices:LPvoid;SrcStride:UINT;pDestVertices:LPvoid;DestStride:UINT;pBoneMatrices:LPD3DXMATRIX;pInverseTransposeBoneMatrices:LPD3DXMATRIX;pChannelDescs:LPD3DX10_SKINNING_CHANNEL;NumChannels:UINT) with Convention=>Stdcall;
   end record;

   function D3DX10CreateSkinInfo(ppSkinInfo:LPLPD3DX10SKININFO) return HRESULT with Import,Convention=>stdcall,external_name=>"D3DX10CreateSkinInfo";

   type tagD3DX10_ATTRIBUTE_WEIGHTS is record
      Position: FLOAT;
      Boundary: FLOAT;
      Normal: FLOAT;
      Diffuse: FLOAT;
      Specular: FLOAT;
      Texcoord: FLOAT_Array(0..8-1);
      Tangent: FLOAT;
      Binormal: FLOAT;
   end record;

   subtype D3DX10_ATTRIBUTE_WEIGHTS is tagD3DX10_ATTRIBUTE_WEIGHTS;

   type LPD3DX10_ATTRIBUTE_WEIGHTS is access all tagD3DX10_ATTRIBUTE_WEIGHTS;




end D3DX10mesh;

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值