Mercurial > projects > ddbg_continued
comparison win32/directx/d3dx10mesh.d @ 1:4a9dcbd9e54f
-files of 0.13 beta
-fixes so that it now compiles with the current dmd version
author | marton@basel.hu |
---|---|
date | Tue, 05 Apr 2011 20:44:01 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:586e4a649642 | 1:4a9dcbd9e54f |
---|---|
1 /***********************************************************************\ | |
2 * d3dx10mesh.d * | |
3 * * | |
4 * Windows API header module * | |
5 * * | |
6 * Placed into public domain * | |
7 \***********************************************************************/ | |
8 module win32.directx.d3dx10mesh; | |
9 | |
10 private import win32.windows; | |
11 private import win32.directx.d3d10; | |
12 private import win32.directx.d3dx10; | |
13 | |
14 extern(C) const GUID IID_ID3DX10BaseMesh = {0x7ed943dd, 0x52e8, 0x40b5, [0xa8, 0xd8, 0x76, 0x68, 0x5c, 0x40, 0x63, 0x30]}; | |
15 extern(C) const GUID IID_ID3DX10MeshBuffer = {0x4b0d117, 0x1041, 0x46b1, [0xaa, 0x8a, 0x39, 0x52, 0x84, 0x8b, 0xa2, 0x2e]}; | |
16 extern(C) const GUID IID_ID3DX10Mesh = {0x4020e5c2, 0x1403, 0x4929, [0x88, 0x3f, 0xe2, 0xe8, 0x49, 0xfa, 0xc1, 0x95]}; | |
17 extern(C) const GUID IID_ID3DX10PMesh = {0x8875769a, 0xd579, 0x4088, [0xaa, 0xeb, 0x53, 0x4d, 0x1a, 0xd8, 0x4e, 0x96]}; | |
18 extern(C) const GUID IID_ID3DX10SPMesh = {0x667ea4c7, 0xf1cd, 0x4386, [0xb5, 0x23, 0x7c, 0x2, 0x90, 0xb8, 0x3c, 0xc5]}; | |
19 extern(C) const GUID IID_ID3DX10PatchMesh = {0x3ce6cc22, 0xdbf2, 0x44f4, [0x89, 0x4d, 0xf9, 0xc3, 0x4a, 0x33, 0x71, 0x39]}; | |
20 | |
21 enum D3DX10_MESH { | |
22 D3DX10_MESH_32_BIT = 0x001, | |
23 D3DX10_MESH_GS_ADJACENCY = 0x004 | |
24 } | |
25 | |
26 struct D3DX10_ATTRIBUTE_RANGE { | |
27 UINT AttribId; | |
28 UINT FaceStart; | |
29 UINT FaceCount; | |
30 UINT VertexStart; | |
31 UINT VertexCount; | |
32 } | |
33 | |
34 enum D3DX10_MESH_DISCARD_FLAGS { | |
35 D3DX10_MESH_DISCARD_ATTRIBUTE_BUFFER = 0x01, | |
36 D3DX10_MESH_DISCARD_ATTRIBUTE_TABLE = 0x02, | |
37 D3DX10_MESH_DISCARD_POINTREPS = 0x04, | |
38 D3DX10_MESH_DISCARD_ADJACENCY = 0x08, | |
39 D3DX10_MESH_DISCARD_DEVICE_BUFFERS = 0x10 | |
40 } | |
41 | |
42 struct D3DX10_WELD_EPSILONS { | |
43 FLOAT Position; | |
44 FLOAT BlendWeights; | |
45 FLOAT Normal; | |
46 FLOAT PSize; | |
47 FLOAT Specular; | |
48 FLOAT Diffuse; | |
49 FLOAT[8] Texcoord; | |
50 FLOAT Tangent; | |
51 FLOAT Binormal; | |
52 FLOAT TessFactor; | |
53 } | |
54 | |
55 struct D3DX10_INTERSECT_INFO { | |
56 UINT FaceIndex; | |
57 FLOAT U; | |
58 FLOAT V; | |
59 FLOAT Dist; | |
60 } | |
61 | |
62 interface ID3DX10MeshBuffer : IUnknown { | |
63 extern(Windows) : | |
64 HRESULT Map(void** ppData, SIZE_T* pSize); | |
65 HRESULT Unmap(); | |
66 SIZE_T GetSize(); | |
67 } | |
68 | |
69 interface ID3DX10Mesh : IUnknown { | |
70 extern(Windows) : | |
71 UINT GetFaceCount(); | |
72 UINT GetVertexCount(); | |
73 UINT GetVertexBufferCount(); | |
74 UINT GetFlags(); | |
75 HRESULT GetVertexDescription(D3D10_INPUT_ELEMENT_DESC** ppDesc, UINT* pDeclCount); | |
76 HRESULT SetVertexData(UINT iBuffer, void* pData); | |
77 HRESULT GetVertexBuffer(UINT iBuffer, ID3DX10MeshBuffer** ppVertexBuffer); | |
78 HRESULT SetIndexData(void* pData, UINT cIndices); | |
79 HRESULT GetIndexBuffer(ID3DX10MeshBuffer** ppIndexBuffer); | |
80 HRESULT SetAttributeData(UINT* pData); | |
81 HRESULT GetAttributeBuffer(ID3DX10MeshBuffer** ppAttributeBuffer); | |
82 HRESULT SetAttributeTable(D3DX10_ATTRIBUTE_RANGE* pAttribTable, UINT cAttribTableSize); | |
83 HRESULT GetAttributeTable(D3DX10_ATTRIBUTE_RANGE* pAttribTable, UINT* pAttribTableSize); | |
84 HRESULT GenerateAdjacencyAndPointReps(FLOAT Epsilon); | |
85 HRESULT GenerateGSAdjacency(); | |
86 HRESULT SetAdjacencyData(UINT* pAdjacency); | |
87 HRESULT GetAdjacencyBuffer(ID3DX10MeshBuffer** ppAdjacency); | |
88 HRESULT SetPointRepData(UINT* pPointReps); | |
89 HRESULT GetPointRepBuffer(ID3DX10MeshBuffer** ppPointReps); | |
90 HRESULT Discard(D3DX10_MESH_DISCARD_FLAGS dwDiscard); | |
91 HRESULT CloneMesh(UINT Flags, LPCSTR pPosSemantic, D3D10_INPUT_ELEMENT_DESC* pDesc, UINT DeclCount, ID3DX10Mesh** ppCloneMesh); | |
92 HRESULT Optimize(UINT Flags, UINT * pFaceRemap, ID3D10Blob* ppVertexRemap); | |
93 HRESULT GenerateAttributeBufferFromTable(); | |
94 HRESULT Intersect(D3DXVECTOR3* pRayPos, D3DXVECTOR3* pRayDir, UINT* pHitCount, UINT* pFaceIndex, float* pU, float* pV, float* pDist, ID3D10Blob* ppAllHits); | |
95 HRESULT IntersectSubset(UINT AttribId, D3DXVECTOR3* pRayPos, D3DXVECTOR3* pRayDir, UINT* pHitCount, UINT* pFaceIndex, float* pU, float* pV, float* pDist, ID3D10Blob* ppAllHits); | |
96 HRESULT CommitToDevice(); | |
97 HRESULT DrawSubset(UINT AttribId); | |
98 HRESULT DrawSubsetInstanced(UINT AttribId, UINT InstanceCount, UINT StartInstanceLocation); | |
99 HRESULT GetDeviceVertexBuffer(UINT iBuffer, ID3D10Buffer** ppVertexBuffer); | |
100 HRESULT GetDeviceIndexBuffer(ID3D10Buffer** ppIndexBuffer); | |
101 } | |
102 | |
103 HRESULT D3DX10CreateMesh(ID3D10Device* pDevice, D3D10_INPUT_ELEMENT_DESC* pDeclaration, UINT DeclCount, LPCSTR pPositionSemantic, UINT VertexCount, UINT FaceCount, UINT Options, ID3DX10Mesh** ppMesh); | |
104 | |
105 enum D3DX10_MESHOPT { | |
106 D3DX10_MESHOPT_COMPACT = 0x01000000, | |
107 D3DX10_MESHOPT_ATTR_SORT = 0x02000000, | |
108 D3DX10_MESHOPT_VERTEX_CACHE = 0x04000000, | |
109 D3DX10_MESHOPT_STRIP_REORDER = 0x08000000, | |
110 D3DX10_MESHOPT_IGNORE_VERTS = 0x10000000, | |
111 D3DX10_MESHOPT_DO_NOT_SPLIT = 0x20000000, | |
112 D3DX10_MESHOPT_DEVICE_INDEPENDENT = 0x00400000 | |
113 } | |
114 | |
115 extern(C) const GUID IID_ID3DX10SkinInfo = {0x420bd604, 0x1c76, 0x4a34, [0xa4, 0x66, 0xe4, 0x5d, 0x6, 0x58, 0xa3, 0x2c]}; | |
116 | |
117 const D3DX10_SKININFO_NO_SCALING = 0; | |
118 const D3DX10_SKININFO_SCALE_TO_1 = 1; | |
119 const D3DX10_SKININFO_SCALE_TO_TOTAL = 2; | |
120 | |
121 struct D3DX10_SKINNING_CHANNEL { | |
122 UINT SrcOffset; | |
123 UINT DestOffset; | |
124 BOOL IsNormal; | |
125 } | |
126 | |
127 interface ID3DX10SkinInfo : IUnknown { | |
128 extern(Windows) : | |
129 HRESULT QueryInterface(REFIID iid, LPVOID* ppv); | |
130 ULONG AddRef(); | |
131 ULONG Release(); | |
132 UINT GetNumVertices(); | |
133 UINT GetNumBones(); | |
134 UINT GetMaxBoneInfluences(); | |
135 HRESULT AddVertices(UINT Count); | |
136 HRESULT RemapVertices(UINT NewVertexCount, UINT* pVertexRemap); | |
137 HRESULT AddBones(UINT Count); | |
138 HRESULT RemoveBone(UINT Index); | |
139 HRESULT RemapBones(UINT NewBoneCount, UINT* pBoneRemap); | |
140 HRESULT AddBoneInfluences(UINT BoneIndex, UINT InfluenceCount, UINT* pIndices, float* pWeights); | |
141 HRESULT ClearBoneInfluences(UINT BoneIndex); | |
142 UINT GetBoneInfluenceCount(UINT BoneIndex); | |
143 HRESULT GetBoneInfluences(UINT BoneIndex, UINT Offset, UINT Count, UINT* pDestIndices, float* pDestWeights); | |
144 HRESULT FindBoneInfluenceIndex(UINT BoneIndex, UINT VertexIndex, UINT* pInfluenceIndex); | |
145 HRESULT SetBoneInfluence(UINT BoneIndex, UINT InfluenceIndex, float Weight); | |
146 HRESULT GetBoneInfluence(UINT BoneIndex, UINT InfluenceIndex, float* pWeight); | |
147 HRESULT Compact(UINT MaxPerVertexInfluences, UINT ScaleMode, float MinWeight); | |
148 HRESULT DoSoftwareSkinning(UINT StartVertex, UINT VertexCount, void* pSrcVertices, UINT SrcStride, void* pDestVertices, UINT DestStride, D3DXMATRIX* pBoneMatrices, D3DXMATRIX* pInverseTransposeBoneMatrices, D3DX10_SKINNING_CHANNEL* pChannelDescs, UINT NumChannels); | |
149 } | |
150 | |
151 HRESULT D3DX10CreateSkinInfo(ID3DX10SkinInfo* ppSkinInfo); | |
152 | |
153 struct D3DX10_ATTRIBUTE_WEIGHTS { | |
154 FLOAT Position; | |
155 FLOAT Boundary; | |
156 FLOAT Normal; | |
157 FLOAT Diffuse; | |
158 FLOAT Specular; | |
159 FLOAT[8] Texcoord; | |
160 FLOAT Tangent; | |
161 FLOAT Binormal; | |
162 } | |
163 |