source: trunk/Include/directx9/d3dx9shader.sbp@ 465

Last change on this file since 465 was 1, checked in by (none), 18 years ago
File size: 10.6 KB
Line 
1' d3dx9shader.sbp
2
3
4#ifndef _INC_D3DX9SHADER
5#define _INC_D3DX9SHADER
6
7
8TypeDef D3DXHANDLE = BytePtr
9
10
11Type D3DXMACRO
12 Name As BytePtr
13 Definition As BytePtr
14End Type
15
16Type D3DXSEMANTIC
17 Usage As DWord
18 UsageIndex As DWord
19End Type
20
21Type D3DXFRAGMENT_DESC
22 Name As BytePtr
23 Target As DWord
24End Type
25
26Const Enum D3DXREGISTER_SET
27 D3DXRS_BOOL = 0
28 D3DXRS_INT4 = 1
29 D3DXRS_FLOAT4 = 2
30 D3DXRS_SAMPLER = 3
31 D3DXRS_FORCE_DWORD = &H7FFFFFFF
32End Enum
33
34Const Enum D3DXPARAMETER_CLASS
35 D3DXPC_SCALAR = 0
36 D3DXPC_VECTOR = 1
37 D3DXPC_MATRIX_ROWS = 2
38 D3DXPC_MATRIX_COLUMNS = 3
39 D3DXPC_OBJECT = 4
40 D3DXPC_STRUCT = 5
41 D3DXPC_FORCE_DWORD = &H7FFFFFFF
42End Enum
43
44Const Enum D3DXPARAMETER_TYPE
45 D3DXPT_VOID = 0
46 D3DXPT_BOOL = 1
47 D3DXPT_INT = 2
48 D3DXPT_FLOAT = 3
49 D3DXPT_STRING = 4
50 D3DXPT_TEXTURE = 5
51 D3DXPT_TEXTURE1D = 6
52 D3DXPT_TEXTURE2D = 7
53 D3DXPT_TEXTURE3D = 8
54 D3DXPT_TEXTURECUBE = 9
55 D3DXPT_SAMPLER = 10
56 D3DXPT_SAMPLER1D = 11
57 D3DXPT_SAMPLER2D = 12
58 D3DXPT_SAMPLER3D = 13
59 D3DXPT_SAMPLERCUBE = 14
60 D3DXPT_PIXELSHADER = 15
61 D3DXPT_VERTEXSHADER = 16
62 D3DXPT_PIXELFRAGMENT = 17
63 D3DXPT_VERTEXFRAGMENT = 18
64 D3DXPT_FORCE_DWORD = &H7FFFFFFF
65End Enum
66
67Type D3DXCONSTANTTABLE_DESC
68 Creator As BytePtr
69 Version As DWord
70 Constants As DWord
71End Type
72
73Type D3DXCONSTANT_DESC
74 Name As BytePtr
75 RegisterSet As D3DXREGISTER_SET
76 RegisterIndex As DWord
77 RegisterCount As DWord
78 Class_ As D3DXPARAMETER_CLASS
79 Type_ As D3DXPARAMETER_TYPE
80 Rows As DWord
81 Columns As DWord
82 Elements As DWord
83 StructMembers As DWord
84 Bytes As DWord
85 DefaultValue As VoidPtr
86End Type
87
88
89Class ID3DXConstantTable
90 Inherits IUnknown
91Public
92 'Buffer
93 Abstract Function GetBufferPointer() As VoidPtr
94 Abstract Function GetBufferSize() As DWord
95
96 'Descs
97 Abstract Function GetDesc(pDesc As *D3DXCONSTANTTABLE_DESC) As DWord
98 Abstract Function GetConstantDesc(hConstant As D3DXHANDLE, pConstantDesc As *D3DXCONSTANT_DESC, pCount As DWordPtr) As DWord
99 Abstract Function GetSamplerIndex(hConstant As D3DXHANDLE) As DWord
100
101 'Handle operations
102 Abstract Function GetConstant(hConstant As D3DXHANDLE, Index As DWord) As D3DXHANDLE
103 Abstract Function GetConstantByName(hConstant As D3DXHANDLE, pName As BytePtr) As D3DXHANDLE
104 Abstract Function GetConstantElement(hConstant As D3DXHANDLE, Index As DWord) As D3DXHANDLE
105
106 'Set Constants
107 Abstract Function SetDefaults(pDevice As LPDIRECT3DDEVICE9) As DWord
108 Abstract Function SetValue(pDevice As LPDIRECT3DDEVICE9, hConstant As D3DXHANDLE, pData As VoidPtr, Bytes As DWord) As DWord
109 Abstract Function SetBool(pDevice As LPDIRECT3DDEVICE9, hConstant As D3DXHANDLE, b As Long) As DWord
110 Abstract Function SetBoolArray(pDevice As LPDIRECT3DDEVICE9, hConstant As D3DXHANDLE, pb As *Long, Count As DWord) As DWord
111 Abstract Function SetInt(pDevice As LPDIRECT3DDEVICE9, hConstant As D3DXHANDLE, n As Long) As DWord
112 Abstract Function SetIntArray(pDevice As LPDIRECT3DDEVICE9, hConstant As D3DXHANDLE, pn As *Long, Count As DWord) As DWord
113 Abstract Function SetFloat(pDevice As LPDIRECT3DDEVICE9, hConstant As D3DXHANDLE, f As Single) As DWord
114 Abstract Function SetFloatArray(pDevice As LPDIRECT3DDEVICE9, hConstant As D3DXHANDLE, pf As SinglePtr, Count As DWord) As DWord
115 Abstract Function SetVector(pDevice As LPDIRECT3DDEVICE9, hConstant As D3DXHANDLE, pVector As *D3DXVECTOR4) As DWord
116 Abstract Function SetVectorArray(pDevice As LPDIRECT3DDEVICE9, hConstant As D3DXHANDLE, pVector As *D3DXVECTOR4, Count As DWord) As DWord
117 Abstract Function SetMatrix(pDevice As LPDIRECT3DDEVICE9, hConstant As D3DXHANDLE, pMatrix As *D3DXMATRIX) As DWord
118 Abstract Function SetMatrixArray(pDevice As LPDIRECT3DDEVICE9, hConstant As D3DXHANDLE, pMatrix As *D3DXMATRIX, Count As DWord) As DWord
119 Abstract Function SetMatrixPointerArray(pDevice As LPDIRECT3DDEVICE9, hConstant As D3DXHANDLE, ppMatrix As **D3DXMATRIX, Count As DWord) As DWord
120 Abstract Function SetMatrixTranspose(pDevice As LPDIRECT3DDEVICE9, hConstant As D3DXHANDLE, pMatrix As *D3DXMATRIX) As DWord
121 Abstract Function SetMatrixTransposeArray(pDevice As LPDIRECT3DDEVICE9, hConstant As D3DXHANDLE, pMatrix As *D3DXMATRIX, Count As DWord) As DWord
122 Abstract Function SetMatrixTransposePointerArray(pDevice As LPDIRECT3DDEVICE9, hConstant As D3DXHANDLE, ppMatrix As **D3DXMATRIX, Count As DWord) As DWord
123End Class
124TypeDef LPD3DXCONSTANTTABLE = *ID3DXConstantTable
125
126
127Class ID3DXTextureShader
128 Inherits IUnknown
129Public
130 'Gets
131 Abstract Function GetFunction(ppFunction As *LPD3DXBUFFER) As DWord
132 Abstract Function GetConstantBuffer(ppConstantBuffer As *LPD3DXBUFFER) As DWord
133
134 'Descs
135 Abstract Function GetDesc(pDesc As *D3DXCONSTANTTABLE_DESC) As DWord
136 Abstract Function GetConstantDesc(hConstant As D3DXHANDLE, pConstantDesc As *D3DXCONSTANT_DESC, pCount As DWordPtr) As DWord
137
138 'Handle operations
139 Abstract Function GetConstant(hConstant As D3DXHANDLE, Index As DWord) As D3DXHANDLE
140 Abstract Function GetConstantByName(hConstant As D3DXHANDLE, pName As BytePtr) As D3DXHANDLE
141 Abstract Function GetConstantElement(hConstant As D3DXHANDLE, Index As DWord) As D3DXHANDLE
142
143 'Set Constants
144 Abstract Function SetDefaults() As DWord
145 Abstract Function SetValue(hConstant As D3DXHANDLE, pData As VoidPtr, Bytes As DWord) As DWord
146 Abstract Function SetBool(hConstant As D3DXHANDLE, b As Long) As DWord
147 Abstract Function SetBoolArray(hConstant As D3DXHANDLE, pb As *Long, Count As DWord) As DWord
148 Abstract Function SetInt(hConstant As D3DXHANDLE, n As Long) As DWord
149 Abstract Function SetIntArray(hConstant As D3DXHANDLE, pn As *Long, Count As DWord) As DWord
150 Abstract Function SetFloat(hConstant As D3DXHANDLE, f As Single) As DWord
151 Abstract Function SetFloatArray(hConstant As D3DXHANDLE, pf As SinglePtr, Count As DWord) As DWord
152 Abstract Function SetVector(hConstant As D3DXHANDLE, pVector As *D3DXVECTOR4) As DWord
153 Abstract Function SetVectorArray(hConstant As D3DXHANDLE, pVector As *D3DXVECTOR4, Count As DWord) As DWord
154 Abstract Function SetMatrix(hConstant As D3DXHANDLE, pMatrix As *D3DXMATRIX) As DWord
155 Abstract Function SetMatrixArray(hConstant As D3DXHANDLE, pMatrix As *D3DXMATRIX, Count As DWord) As DWord
156 Abstract Function SetMatrixPointerArray(hConstant As D3DXHANDLE, ppMatrix As **D3DXMATRIX, Count As DWord) As DWord
157 Abstract Function SetMatrixTranspose(hConstant As D3DXHANDLE, pMatrix As *D3DXMATRIX) As DWord
158 Abstract Function SetMatrixTransposeArray(hConstant As D3DXHANDLE, pMatrix As *D3DXMATRIX, Count As DWord) As DWord
159 Abstract Function SetMatrixTransposePointerArray(hConstant As D3DXHANDLE, ppMatrix As **D3DXMATRIX, Count As DWord) As DWord
160End Class
161TypeDef LPD3DXTEXTURESHADER = *ID3DXTextureShader
162
163
164Class ID3DXFragmentLinker
165 Inherits IUnknown
166Public
167 'fragment access and information retrieval functions
168 Abstract Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
169 Abstract Function GetNumberOfFragments() As DWord
170
171 Abstract Function GetFragmentHandleByIndex(Index As DWord) As D3DXHANDLE
172 Abstract Function GetFragmentHandleByName(Name As BytePtr) As D3DXHANDLE
173 Abstract Function GetFragmentDesc(Name As D3DXHANDLE, FragDesc As *D3DXFRAGMENT_DESC) As DWord
174
175 'add the fragments in the buffer to the linker
176 Abstract Function AddFragments(Fragments As DWordPtr) As DWord
177
178 'Create a buffer containing the fragments. Suitable for saving to disk
179 Abstract Function GetAllFragments(ppBuffer As *LPD3DXBUFFER) As DWord
180 Abstract Function GetFragment(Name As D3DXHANDLE, ppBuffer As *LPD3DXBUFFER) As DWord
181
182 Abstract Function LinkShader(pProfile As BytePtr, Flags As DWord, rgFragmentHandles As *D3DXHANDLE, cFragments As DWord, ppBuffer As *LPD3DXBUFFER, ppErrorMsgs As *LPD3DXBUFFER) As DWord
183 Abstract Function LinkVertexShader(pProfile As BytePtr, Flags As DWord, rgFragmentHandles As *D3DXHANDLE, cFragments As DWord, pVShader As *LPDIRECT3DVERTEXSHADER9, ppErrorMsgs As *LPD3DXBUFFER) As DWord
184 Abstract Function LinkPixelShader(pProfile As BytePtr, Flags As DWord, rgFragmentHandles As *D3DXHANDLE, cFragments As DWord, pPShader As *LPDIRECT3DPIXELSHADER9, ppErrorMsgs As *LPD3DXBUFFER) As DWord
185
186 Abstract Function ClearCache() As DWord
187End Class
188TypeDef LPD3DXFRAGMENTLINKER = *ID3DXFragmentLinker
189
190
191Const Enum D3DXINCLUDE_TYPE
192 D3DXINC_LOCAL = 0
193 D3DXINC_SYSTEM = 1
194
195 D3DXINC_FORCE_DWORD = &H7FFFFFFF
196End Enum
197
198Class ID3DXInclude
199 Abstract Function Open(IncludeType As D3DXINCLUDE_TYPE, pFileName As BytePtr, pParentData As VoidPtr, ppData As DWordPtr, pBytes As DWordPtr) As DWord
200 Abstract Function Close(pData As VoidPtr) As DWord
201End Class
202TypeDef LPD3DXINCLUDE = *ID3DXInclude
203
204
205'--------------------
206' D3DXAssembleShader
207'--------------------
208Declare Function D3DXAssembleShaderFromFile Lib "dx9abm" Alias "D3DXAssembleShaderFromFile_abm" (pSrcFile As BytePtr, pDefines As *D3DXMACRO, pInclude As LPD3DXINCLUDE, Flags As DWord, ppShader As *LPD3DXBUFFER, ppErrorMsgs As *LPD3DXBUFFER) As DWord
209Declare Function D3DXAssembleShaderFromResource Lib "dx9abm" Alias "D3DXAssembleShaderFromResource_abm" (hSrcModule As HINSTANCE, pSrcResource As BytePtr, pDefines As *D3DXMACRO, pInclude As LPD3DXINCLUDE, Flags As DWord, ppShader As *LPD3DXBUFFER, ppErrorMsgs As *LPD3DXBUFFER) As DWord
210Declare Function D3DXAssembleShader Lib "dx9abm" Alias "D3DXAssembleShader_abm" (pSrcData As BytePtr, SrcDataLen As DWord, pDefines As *D3DXMACRO, pInclude As LPD3DXINCLUDE, Flags As DWord, ppShader As *LPD3DXBUFFER, ppErrorMsgs As *LPD3DXBUFFER) As DWord
211
212
213'-------------------
214' D3DXCompileShader
215'-------------------
216Declare Function D3DXCompileShaderFromFile Lib "dx9abm" Alias "D3DXCompileShaderFromFile_abm" (pSrcFile As BytePtr, pDefines As *D3DXMACRO, pInclude As LPD3DXINCLUDE, pFunctionName As BytePtr, pProfile As BytePtr, Flags As DWord, ppShader As *LPD3DXBUFFER, ppErrorMsgs As *LPD3DXBUFFER, ppConstantTable As *LPD3DXCONSTANTTABLE) As DWord
217Declare Function D3DXCompileShaderFromResource Lib "dx9abm" Alias "D3DXCompileShaderFromResource_abm" (hSrcModule As HINSTANCE, pSrcResource As BytePtr, pDefines As *D3DXMACRO, pInclude As LPD3DXINCLUDE, pFunctionName As BytePtr, pProfile As BytePtr, Flags As DWord, ppShader As *LPD3DXBUFFER, ppErrorMsgs As *LPD3DXBUFFER, ppConstantTable As *LPD3DXCONSTANTTABLE) As DWord
218Declare Function D3DXCompileShader Lib "dx9abm" Alias "D3DXCompileShader_abm" (pSrcData As BytePtr, SrcDataLen As DWord, pDefines As *D3DXMACRO, pInclude As LPD3DXINCLUDE, pFunctionName As BytePtr, pProfile As BytePtr, Flags As DWord, ppShader As *LPD3DXBUFFER, ppErrorMsgs As *LPD3DXBUFFER, ppConstantTable As *LPD3DXCONSTANTTABLE) As DWord
219
220
221#endif '_INC_D3DX9SHADER
Note: See TracBrowser for help on using the repository browser.