]> git.cworth.org Git - apitrace/blob - d3d.py
Implement a bulk of trace saving.
[apitrace] / d3d.py
1 ##########################################################################
2 #
3 # Copyright 2008-2009 VMware, Inc.
4 # All Rights Reserved.
5 #
6 # Permission is hereby granted, free of charge, to any person obtaining a copy
7 # of this software and associated documentation files (the "Software"), to deal
8 # in the Software without restriction, including without limitation the rights
9 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 # copies of the Software, and to permit persons to whom the Software is
11 # furnished to do so, subject to the following conditions:
12 #
13 # The above copyright notice and this permission notice shall be included in
14 # all copies or substantial portions of the Software.
15 #
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 # THE SOFTWARE.
23 #
24 ##########################################################################/
25
26 """d3d.h"""
27
28 from winapi import *
29 from d3dtypes import *
30 from d3dcaps import *
31
32 D3DNEXT = Flags(DWORD, [
33     "D3DNEXT_NEXT",
34     "D3DNEXT_HEAD",
35     "D3DNEXT_TAIL",
36 ])
37
38 D3DDP = Flags(DWORD, [
39     "D3DDP_WAIT",
40     "D3DDP_OUTOFORDER",
41     "D3DDP_DONOTCLIP",
42     "D3DDP_DONOTUPDATEEXTENTS",
43     "D3DDP_DONOTLIGHT",
44 ])
45
46 HRESULT = Enum("HRESULT", [
47     "D3D_OK",
48     "D3DERR_BADMAJORVERSION",
49     "D3DERR_BADMINORVERSION",
50     "D3DERR_INVALID_DEVICE",
51     "D3DERR_INITFAILED",
52     "D3DERR_DEVICEAGGREGATED",
53     "D3DERR_EXECUTE_CREATE_FAILED",
54     "D3DERR_EXECUTE_DESTROY_FAILED",
55     "D3DERR_EXECUTE_LOCK_FAILED",
56     "D3DERR_EXECUTE_UNLOCK_FAILED",
57     "D3DERR_EXECUTE_LOCKED",
58     "D3DERR_EXECUTE_NOT_LOCKED",
59     "D3DERR_EXECUTE_FAILED",
60     "D3DERR_EXECUTE_CLIPPED_FAILED",
61     "D3DERR_TEXTURE_NO_SUPPORT",
62     "D3DERR_TEXTURE_CREATE_FAILED",
63     "D3DERR_TEXTURE_DESTROY_FAILED",
64     "D3DERR_TEXTURE_LOCK_FAILED",
65     "D3DERR_TEXTURE_UNLOCK_FAILED",
66     "D3DERR_TEXTURE_LOAD_FAILED",
67     "D3DERR_TEXTURE_SWAP_FAILED",
68     "D3DERR_TEXTURE_LOCKED",
69     "D3DERR_TEXTURE_NOT_LOCKED",
70     "D3DERR_TEXTURE_GETSURF_FAILED",
71     "D3DERR_MATRIX_CREATE_FAILED",
72     "D3DERR_MATRIX_DESTROY_FAILED",
73     "D3DERR_MATRIX_SETDATA_FAILED",
74     "D3DERR_MATRIX_GETDATA_FAILED",
75     "D3DERR_SETVIEWPORTDATA_FAILED",
76     "D3DERR_INVALIDCURRENTVIEWPORT",
77     "D3DERR_INVALIDPRIMITIVETYPE",
78     "D3DERR_INVALIDVERTEXTYPE",
79     "D3DERR_TEXTURE_BADSIZE",
80     "D3DERR_INVALIDRAMPTEXTURE",
81     "D3DERR_MATERIAL_CREATE_FAILED",
82     "D3DERR_MATERIAL_DESTROY_FAILED",
83     "D3DERR_MATERIAL_SETDATA_FAILED",
84     "D3DERR_MATERIAL_GETDATA_FAILED",
85     "D3DERR_INVALIDPALETTE",
86     "D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY",
87     "D3DERR_ZBUFF_NEEDS_VIDEOMEMORY",
88     "D3DERR_SURFACENOTINVIDMEM",
89     "D3DERR_LIGHT_SET_FAILED",
90     "D3DERR_LIGHTHASVIEWPORT",
91     "D3DERR_LIGHTNOTINTHISVIEWPORT",
92     "D3DERR_SCENE_IN_SCENE",
93     "D3DERR_SCENE_NOT_IN_SCENE",
94     "D3DERR_SCENE_BEGIN_FAILED",
95     "D3DERR_SCENE_END_FAILED",
96     "D3DERR_INBEGIN",
97     "D3DERR_NOTINBEGIN",
98     "D3DERR_NOVIEWPORTS",
99     "D3DERR_VIEWPORTDATANOTSET",
100     "D3DERR_VIEWPORTHASNODEVICE",
101     "D3DERR_NOCURRENTVIEWPORT",
102     "D3DERR_INVALIDVERTEXFORMAT",
103     "D3DERR_COLORKEYATTACHED",
104     "D3DERR_VERTEXBUFFEROPTIMIZED",
105     "D3DERR_VBUF_CREATE_FAILED",
106     "D3DERR_VERTEXBUFFERLOCKED",
107     "D3DERR_VERTEXBUFFERUNLOCKFAILED",
108     "D3DERR_ZBUFFER_NOTPRESENT",
109     "D3DERR_STENCILBUFFER_NOTPRESENT",
110     "D3DERR_WRONGTEXTUREFORMAT",
111     "D3DERR_UNSUPPORTEDCOLOROPERATION",
112     "D3DERR_UNSUPPORTEDCOLORARG",
113     "D3DERR_UNSUPPORTEDALPHAOPERATION",
114     "D3DERR_UNSUPPORTEDALPHAARG",
115     "D3DERR_TOOMANYOPERATIONS",
116     "D3DERR_CONFLICTINGTEXTUREFILTER",
117     "D3DERR_UNSUPPORTEDFACTORVALUE",
118     "D3DERR_CONFLICTINGRENDERSTATE",
119     "D3DERR_UNSUPPORTEDTEXTUREFILTER",
120     "D3DERR_TOOMANYPRIMITIVES",
121     "D3DERR_INVALIDMATRIX",
122     "D3DERR_TOOMANYVERTICES",
123     "D3DERR_CONFLICTINGTEXTUREPALETTE",
124     "D3DERR_INVALIDSTATEBLOCK",
125     "D3DERR_INBEGINSTATEBLOCK",
126     "D3DERR_NOTINBEGINSTATEBLOCK",
127 ])
128
129 IDirect3D = Interface("IDirect3D", IUnknown)
130 IDirect3D2 = Interface("IDirect3D2", IUnknown)
131 IDirect3D3 = Interface("IDirect3D3", IUnknown)
132 IDirect3D7 = Interface("IDirect3D7", IUnknown)
133 IDirect3DDevice = Interface("IDirect3DDevice", IUnknown)
134 IDirect3DDevice2 = Interface("IDirect3DDevice2", IUnknown)
135 IDirect3DDevice3 = Interface("IDirect3DDevice3", IUnknown)
136 IDirect3DDevice7 = Interface("IDirect3DDevice7", IUnknown)
137 IDirect3DExecuteBuffer = Interface("IDirect3DExecuteBuffer", IUnknown)
138 IDirect3DLight = Interface("IDirect3DLight", IUnknown)
139 IDirect3DMaterial = Interface("IDirect3DMaterial", IUnknown)
140 IDirect3DMaterial2 = Interface("IDirect3DMaterial2", IUnknown)
141 IDirect3DMaterial3 = Interface("IDirect3DMaterial3", IUnknown)
142 IDirect3DTexture = Interface("IDirect3DTexture", IUnknown)
143 IDirect3DTexture2 = Interface("IDirect3DTexture2", IUnknown)
144 IDirect3DViewport = Interface("IDirect3DViewport", IUnknown)
145 IDirect3DViewport2 = Interface("IDirect3DViewport2", IDirect3DViewport)
146 IDirect3DViewport3 = Interface("IDirect3DViewport3", IDirect3DViewport2)
147 IDirect3DVertexBuffer = Interface("IDirect3DVertexBuffer", IUnknown)
148 IDirect3DVertexBuffer7 = Interface("IDirect3DVertexBuffer7", IUnknown)
149
150 LPUNKNOWN = WrapPointer(IUnknown)
151
152 LPDIRECT3D = WrapPointer(IDirect3D)
153 LPDIRECT3DDEVICE = WrapPointer(IDirect3DDevice)
154 LPDIRECT3DEXECUTEBUFFER = WrapPointer(IDirect3DExecuteBuffer)
155 LPDIRECT3DLIGHT = WrapPointer(IDirect3DLight)
156 LPDIRECT3DMATERIAL = WrapPointer(IDirect3DMaterial)
157 LPDIRECT3DTEXTURE = WrapPointer(IDirect3DTexture)
158 LPDIRECT3DVIEWPORT = WrapPointer(IDirect3DViewport)
159
160 LPDIRECT3D2 = WrapPointer(IDirect3D2)
161 LPDIRECT3DDEVICE2 = WrapPointer(IDirect3DDevice2)
162 LPDIRECT3DMATERIAL2 = WrapPointer(IDirect3DMaterial2)
163 LPDIRECT3DTEXTURE2 = WrapPointer(IDirect3DTexture2)
164 LPDIRECT3DVIEWPORT2 = WrapPointer(IDirect3DViewport2)
165
166 LPDIRECT3D3 = WrapPointer(IDirect3D3)
167 LPDIRECT3DDEVICE3 = WrapPointer(IDirect3DDevice3)
168 LPDIRECT3DMATERIAL3 = WrapPointer(IDirect3DMaterial3)
169 LPDIRECT3DVIEWPORT3 = WrapPointer(IDirect3DViewport3)
170 LPDIRECT3DVERTEXBUFFER = WrapPointer(IDirect3DVertexBuffer)
171
172 LPDIRECT3D7 = WrapPointer(IDirect3D7)
173 LPDIRECT3DDEVICE7 = WrapPointer(IDirect3DDevice7)
174 LPDIRECT3DVERTEXBUFFER7 = WrapPointer(IDirect3DVertexBuffer7)
175
176 IDirect3D.methods += [
177     Method(HRESULT, "Initialize", [REFCLSID]),
178     Method(HRESULT, "EnumDevices", [LPD3DENUMDEVICESCALLBACK,LPVOID]),
179     Method(HRESULT, "CreateLight", [OutPointer(LPDIRECT3DLIGHT),LPUNKNOWN]),
180     Method(HRESULT, "CreateMaterial", [OutPointer(LPDIRECT3DMATERIAL),LPUNKNOWN]),
181     Method(HRESULT, "CreateViewport", [OutPointer(LPDIRECT3DVIEWPORT),LPUNKNOWN]),
182     Method(HRESULT, "FindDevice", [LPD3DFINDDEVICESEARCH,LPD3DFINDDEVICERESULT]),
183 ]
184
185 IDirect3D2.methods += [
186     Method(HRESULT, "EnumDevices", [LPD3DENUMDEVICESCALLBACK,LPVOID]),
187     Method(HRESULT, "CreateLight", [OutPointer(LPDIRECT3DLIGHT),LPUNKNOWN]),
188     Method(HRESULT, "CreateMaterial", [OutPointer(LPDIRECT3DMATERIAL2),LPUNKNOWN]),
189     Method(HRESULT, "CreateViewport", [OutPointer(LPDIRECT3DVIEWPORT2),LPUNKNOWN]),
190     Method(HRESULT, "FindDevice", [LPD3DFINDDEVICESEARCH,LPD3DFINDDEVICERESULT]),
191     Method(HRESULT, "CreateDevice", [REFCLSID,LPDIRECTDRAWSURFACE,OutPointer(LPDIRECT3DDEVICE2)]),
192 ]
193
194 IDirect3D3.methods += [
195     Method(HRESULT, "EnumDevices", [LPD3DENUMDEVICESCALLBACK,LPVOID]),
196     Method(HRESULT, "CreateLight", [OutPointer(LPDIRECT3DLIGHT),LPUNKNOWN]),
197     Method(HRESULT, "CreateMaterial", [OutPointer(LPDIRECT3DMATERIAL3),LPUNKNOWN]),
198     Method(HRESULT, "CreateViewport", [OutPointer(LPDIRECT3DVIEWPORT3),LPUNKNOWN]),
199     Method(HRESULT, "FindDevice", [LPD3DFINDDEVICESEARCH,LPD3DFINDDEVICERESULT]),
200     Method(HRESULT, "CreateDevice", [REFCLSID,LPDIRECTDRAWSURFACE4,OutPointer(LPDIRECT3DDEVICE3),LPUNKNOWN]),
201     Method(HRESULT, "CreateVertexBuffer", [LPD3DVERTEXBUFFERDESC,OutPointer(LPDIRECT3DVERTEXBUFFER),DWORD,LPUNKNOWN]),
202     Method(HRESULT, "EnumZBufferFormats", [REFCLSID,LPD3DENUMPIXELFORMATSCALLBACK,LPVOID]),
203     Method(HRESULT, "EvictManagedTextures", []),
204 ]
205
206 IDirect3D7.methods += [
207     Method(HRESULT, "EnumDevices", [LPD3DENUMDEVICESCALLBACK7,LPVOID]),
208     Method(HRESULT, "CreateDevice", [REFCLSID,LPDIRECTDRAWSURFACE7,OutPointer(LPDIRECT3DDEVICE7)]),
209     Method(HRESULT, "CreateVertexBuffer", [LPD3DVERTEXBUFFERDESC,OutPointer(LPDIRECT3DVERTEXBUFFER7),DWORD]),
210     Method(HRESULT, "EnumZBufferFormats", [REFCLSID,LPD3DENUMPIXELFORMATSCALLBACK,LPVOID]),
211     Method(HRESULT, "EvictManagedTextures", []),
212 ]
213
214 IDirect3DDevice.methods += [
215     Method(HRESULT, "Initialize", [LPDIRECT3D,LPGUID,LPD3DDEVICEDESC]),
216     Method(HRESULT, "GetCaps", [LPD3DDEVICEDESC,LPD3DDEVICEDESC]),
217     Method(HRESULT, "SwapTextureHandles", [LPDIRECT3DTEXTURE,LPDIRECT3DTEXTURE]),
218     Method(HRESULT, "CreateExecuteBuffer", [LPD3DEXECUTEBUFFERDESC,OutPointer(LPDIRECT3DEXECUTEBUFFER),LPUNKNOWN]),
219     Method(HRESULT, "GetStats", [LPD3DSTATS]),
220     Method(HRESULT, "Execute", [LPDIRECT3DEXECUTEBUFFER,LPDIRECT3DVIEWPORT,DWORD]),
221     Method(HRESULT, "AddViewport", [LPDIRECT3DVIEWPORT]),
222     Method(HRESULT, "DeleteViewport", [LPDIRECT3DVIEWPORT]),
223     Method(HRESULT, "NextViewport", [LPDIRECT3DVIEWPORT,OutPointer(LPDIRECT3DVIEWPORT),DWORD]),
224     Method(HRESULT, "Pick", [LPDIRECT3DEXECUTEBUFFER,LPDIRECT3DVIEWPORT,DWORD,LPD3DRECT]),
225     Method(HRESULT, "GetPickRecords", [LPDWORD,LPD3DPICKRECORD]),
226     Method(HRESULT, "EnumTextureFormats", [LPD3DENUMTEXTUREFORMATSCALLBACK,LPVOID]),
227     Method(HRESULT, "CreateMatrix", [LPD3DMATRIXHANDLE]),
228     Method(HRESULT, "SetMatrix", [D3DMATRIXHANDLE,Const(LPD3DMATRIX)]),
229     Method(HRESULT, "GetMatrix", [D3DMATRIXHANDLE,LPD3DMATRIX]),
230     Method(HRESULT, "DeleteMatrix", [D3DMATRIXHANDLE]),
231     Method(HRESULT, "BeginScene", []),
232     Method(HRESULT, "EndScene", []),
233     Method(HRESULT, "GetDirect3D", [OutPointer(LPDIRECT3D)]),
234 ]
235
236 IDirect3DDevice2.methods += [
237     Method(HRESULT, "GetCaps", [LPD3DDEVICEDESC,LPD3DDEVICEDESC]),
238     Method(HRESULT, "SwapTextureHandles", [LPDIRECT3DTEXTURE2,LPDIRECT3DTEXTURE2]),
239     Method(HRESULT, "GetStats", [LPD3DSTATS]),
240     Method(HRESULT, "AddViewport", [LPDIRECT3DVIEWPORT2]),
241     Method(HRESULT, "DeleteViewport", [LPDIRECT3DVIEWPORT2]),
242     Method(HRESULT, "NextViewport", [LPDIRECT3DVIEWPORT2,OutPointer(LPDIRECT3DVIEWPORT2),DWORD]),
243     Method(HRESULT, "EnumTextureFormats", [LPD3DENUMTEXTUREFORMATSCALLBACK,LPVOID]),
244     Method(HRESULT, "BeginScene", []),
245     Method(HRESULT, "EndScene", []),
246     Method(HRESULT, "GetDirect3D", [OutPointer(LPDIRECT3D2)]),
247     Method(HRESULT, "SetCurrentViewport", [LPDIRECT3DVIEWPORT2]),
248     Method(HRESULT, "GetCurrentViewport", [OutPointer(LPDIRECT3DVIEWPORT2)]),
249     Method(HRESULT, "SetRenderTarget", [LPDIRECTDRAWSURFACE,DWORD]),
250     Method(HRESULT, "GetRenderTarget", [OutPointer(LPDIRECTDRAWSURFACE)]),
251     Method(HRESULT, "Begin", [D3DPRIMITIVETYPE,D3DVERTEXTYPE,DWORD]),
252     Method(HRESULT, "BeginIndexed", [D3DPRIMITIVETYPE,D3DVERTEXTYPE,LPVOID,DWORD,DWORD]),
253     Method(HRESULT, "Vertex", [LPVOID]),
254     Method(HRESULT, "Index", [WORD]),
255     Method(HRESULT, "End", [DWORD]),
256     Method(HRESULT, "GetRenderState", [D3DRENDERSTATETYPE,LPDWORD]),
257     Method(HRESULT, "SetRenderState", [D3DRENDERSTATETYPE,DWORD]),
258     Method(HRESULT, "GetLightState", [D3DLIGHTSTATETYPE,LPDWORD]),
259     Method(HRESULT, "SetLightState", [D3DLIGHTSTATETYPE,DWORD]),
260     Method(HRESULT, "SetTransform", [D3DTRANSFORMSTATETYPE,LPD3DMATRIX]),
261     Method(HRESULT, "GetTransform", [D3DTRANSFORMSTATETYPE,LPD3DMATRIX]),
262     Method(HRESULT, "MultiplyTransform", [D3DTRANSFORMSTATETYPE,LPD3DMATRIX]),
263     Method(HRESULT, "DrawPrimitive", [D3DPRIMITIVETYPE,D3DVERTEXTYPE,LPVOID,DWORD,DWORD]),
264     Method(HRESULT, "DrawIndexedPrimitive", [D3DPRIMITIVETYPE,D3DVERTEXTYPE,LPVOID,DWORD,LPWORD,DWORD,DWORD]),
265     Method(HRESULT, "SetClipStatus", [LPD3DCLIPSTATUS]),
266     Method(HRESULT, "GetClipStatus", [LPD3DCLIPSTATUS]),
267 ]
268
269 IDirect3DDevice3.methods += [
270     Method(HRESULT, "GetCaps", [LPD3DDEVICEDESC,LPD3DDEVICEDESC]),
271     Method(HRESULT, "GetStats", [LPD3DSTATS]),
272     Method(HRESULT, "AddViewport", [LPDIRECT3DVIEWPORT3]),
273     Method(HRESULT, "DeleteViewport", [LPDIRECT3DVIEWPORT3]),
274     Method(HRESULT, "NextViewport", [LPDIRECT3DVIEWPORT3,OutPointer(LPDIRECT3DVIEWPORT3),DWORD]),
275     Method(HRESULT, "EnumTextureFormats", [LPD3DENUMPIXELFORMATSCALLBACK,LPVOID]),
276     Method(HRESULT, "BeginScene", []),
277     Method(HRESULT, "EndScene", []),
278     Method(HRESULT, "GetDirect3D", [OutPointer(LPDIRECT3D3)]),
279     Method(HRESULT, "SetCurrentViewport", [LPDIRECT3DVIEWPORT3]),
280     Method(HRESULT, "GetCurrentViewport", [OutPointer(LPDIRECT3DVIEWPORT3)]),
281     Method(HRESULT, "SetRenderTarget", [LPDIRECTDRAWSURFACE4,DWORD]),
282     Method(HRESULT, "GetRenderTarget", [OutPointer(LPDIRECTDRAWSURFACE4)]),
283     Method(HRESULT, "Begin", [D3DPRIMITIVETYPE,DWORD,DWORD]),
284     Method(HRESULT, "BeginIndexed", [D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,DWORD]),
285     Method(HRESULT, "Vertex", [LPVOID]),
286     Method(HRESULT, "Index", [WORD]),
287     Method(HRESULT, "End", [DWORD]),
288     Method(HRESULT, "GetRenderState", [D3DRENDERSTATETYPE,LPDWORD]),
289     Method(HRESULT, "SetRenderState", [D3DRENDERSTATETYPE,DWORD]),
290     Method(HRESULT, "GetLightState", [D3DLIGHTSTATETYPE,LPDWORD]),
291     Method(HRESULT, "SetLightState", [D3DLIGHTSTATETYPE,DWORD]),
292     Method(HRESULT, "SetTransform", [D3DTRANSFORMSTATETYPE,LPD3DMATRIX]),
293     Method(HRESULT, "GetTransform", [D3DTRANSFORMSTATETYPE,LPD3DMATRIX]),
294     Method(HRESULT, "MultiplyTransform", [D3DTRANSFORMSTATETYPE,LPD3DMATRIX]),
295     Method(HRESULT, "DrawPrimitive", [D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,DWORD]),
296     Method(HRESULT, "DrawIndexedPrimitive", [D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,LPWORD,DWORD,DWORD]),
297     Method(HRESULT, "SetClipStatus", [LPD3DCLIPSTATUS]),
298     Method(HRESULT, "GetClipStatus", [LPD3DCLIPSTATUS]),
299     Method(HRESULT, "DrawPrimitiveStrided", [D3DPRIMITIVETYPE,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,DWORD]),
300     Method(HRESULT, "DrawIndexedPrimitiveStrided", [D3DPRIMITIVETYPE,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,LPWORD,DWORD,DWORD]),
301     Method(HRESULT, "DrawPrimitiveVB", [D3DPRIMITIVETYPE,LPDIRECT3DVERTEXBUFFER,DWORD,DWORD,DWORD]),
302     Method(HRESULT, "DrawIndexedPrimitiveVB", [D3DPRIMITIVETYPE,LPDIRECT3DVERTEXBUFFER,LPWORD,DWORD,DWORD]),
303     Method(HRESULT, "ComputeSphereVisibility", [LPD3DVECTOR,LPD3DVALUE,DWORD,DWORD,LPDWORD]),
304     Method(HRESULT, "GetTexture", [DWORD,OutPointer(LPDIRECT3DTEXTURE2)]),
305     Method(HRESULT, "SetTexture", [DWORD,LPDIRECT3DTEXTURE2]),
306     Method(HRESULT, "GetTextureStageState", [DWORD,D3DTEXTURESTAGESTATETYPE,LPDWORD]),
307     Method(HRESULT, "SetTextureStageState", [DWORD,D3DTEXTURESTAGESTATETYPE,DWORD]),
308     Method(HRESULT, "ValidateDevice", [LPDWORD]),
309 ]
310
311 IDirect3DDevice7.methods += [
312     Method(HRESULT, "GetCaps", [LPD3DDEVICEDESC7]),
313     Method(HRESULT, "EnumTextureFormats", [LPD3DENUMPIXELFORMATSCALLBACK,LPVOID]),
314     Method(HRESULT, "BeginScene", []),
315     Method(HRESULT, "EndScene", []),
316     Method(HRESULT, "GetDirect3D", [OutPointer(LPDIRECT3D7)]),
317     Method(HRESULT, "SetRenderTarget", [LPDIRECTDRAWSURFACE7,DWORD]),
318     Method(HRESULT, "GetRenderTarget", [OutPointer(LPDIRECTDRAWSURFACE7)]),
319     Method(HRESULT, "Clear", [DWORD,LPD3DRECT,DWORD,D3DCOLOR,D3DVALUE,DWORD]),
320     Method(HRESULT, "SetTransform", [D3DTRANSFORMSTATETYPE,LPD3DMATRIX]),
321     Method(HRESULT, "GetTransform", [D3DTRANSFORMSTATETYPE,LPD3DMATRIX]),
322     Method(HRESULT, "SetViewport", [LPD3DVIEWPORT7]),
323     Method(HRESULT, "MultiplyTransform", [D3DTRANSFORMSTATETYPE,LPD3DMATRIX]),
324     Method(HRESULT, "GetViewport", [LPD3DVIEWPORT7]),
325     Method(HRESULT, "SetMaterial", [LPD3DMATERIAL7]),
326     Method(HRESULT, "GetMaterial", [LPD3DMATERIAL7]),
327     Method(HRESULT, "SetLight", [DWORD,LPD3DLIGHT7]),
328     Method(HRESULT, "GetLight", [DWORD,LPD3DLIGHT7]),
329     Method(HRESULT, "SetRenderState", [D3DRENDERSTATETYPE,DWORD]),
330     Method(HRESULT, "GetRenderState", [D3DRENDERSTATETYPE,LPDWORD]),
331     Method(HRESULT, "BeginStateBlock", []),
332     Method(HRESULT, "EndStateBlock", [LPDWORD]),
333     Method(HRESULT, "PreLoad", [LPDIRECTDRAWSURFACE7]),
334     Method(HRESULT, "DrawPrimitive", [D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,DWORD]),
335     Method(HRESULT, "DrawIndexedPrimitive", [D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,LPWORD,DWORD,DWORD]),
336     Method(HRESULT, "SetClipStatus", [LPD3DCLIPSTATUS]),
337     Method(HRESULT, "GetClipStatus", [LPD3DCLIPSTATUS]),
338     Method(HRESULT, "DrawPrimitiveStrided", [D3DPRIMITIVETYPE,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,DWORD]),
339     Method(HRESULT, "DrawIndexedPrimitiveStrided", [D3DPRIMITIVETYPE,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,LPWORD,DWORD,DWORD]),
340     Method(HRESULT, "DrawPrimitiveVB", [D3DPRIMITIVETYPE,LPDIRECT3DVERTEXBUFFER7,DWORD,DWORD,DWORD]),
341     Method(HRESULT, "DrawIndexedPrimitiveVB", [D3DPRIMITIVETYPE,LPDIRECT3DVERTEXBUFFER7,DWORD,DWORD,LPWORD,DWORD,DWORD]),
342     Method(HRESULT, "ComputeSphereVisibility", [LPD3DVECTOR,LPD3DVALUE,DWORD,DWORD,LPDWORD]),
343     Method(HRESULT, "GetTexture", [DWORD,OutPointer(LPDIRECTDRAWSURFACE7)]),
344     Method(HRESULT, "SetTexture", [DWORD,LPDIRECTDRAWSURFACE7]),
345     Method(HRESULT, "GetTextureStageState", [DWORD,D3DTEXTURESTAGESTATETYPE,LPDWORD]),
346     Method(HRESULT, "SetTextureStageState", [DWORD,D3DTEXTURESTAGESTATETYPE,DWORD]),
347     Method(HRESULT, "ValidateDevice", [LPDWORD]),
348     Method(HRESULT, "ApplyStateBlock", [DWORD]),
349     Method(HRESULT, "CaptureStateBlock", [DWORD]),
350     Method(HRESULT, "DeleteStateBlock", [DWORD]),
351     Method(HRESULT, "CreateStateBlock", [D3DSTATEBLOCKTYPE,LPDWORD]),
352     Method(HRESULT, "Load", [LPDIRECTDRAWSURFACE7,LPPOINT,LPDIRECTDRAWSURFACE7,LPRECT,DWORD]),
353     Method(HRESULT, "LightEnable", [DWORD,BOOL]),
354     Method(HRESULT, "GetLightEnable", [DWORD,OutPointer(BOOL)]),
355     Method(HRESULT, "SetClipPlane", [DWORD,OutPointer(D3DVALUE)]),
356     Method(HRESULT, "GetClipPlane", [DWORD,OutPointer(D3DVALUE)]),
357     Method(HRESULT, "GetInfo", [DWORD,LPVOID,DWORD]),
358 ]
359
360 IDirect3DExecuteBuffer.methods += [
361     Method(HRESULT, "Initialize", [LPDIRECT3DDEVICE,LPD3DEXECUTEBUFFERDESC]),
362     Method(HRESULT, "Lock", [LPD3DEXECUTEBUFFERDESC]),
363     Method(HRESULT, "Unlock", []),
364     Method(HRESULT, "SetExecuteData", [LPD3DEXECUTEDATA]),
365     Method(HRESULT, "GetExecuteData", [LPD3DEXECUTEDATA]),
366     Method(HRESULT, "Validate", [LPDWORD,LPD3DVALIDATECALLBACK,LPVOID,DWORD]),
367     Method(HRESULT, "Optimize", [DWORD]),
368 ]
369
370 IDirect3DLight.methods += [
371     Method(HRESULT, "Initialize", [LPDIRECT3D]),
372     Method(HRESULT, "SetLight", [LPD3DLIGHT]),
373     Method(HRESULT, "GetLight", [LPD3DLIGHT]),
374 ]
375
376 IDirect3DMaterial.methods += [
377     Method(HRESULT, "Initialize", [LPDIRECT3D]),
378     Method(HRESULT, "SetMaterial", [LPD3DMATERIAL]),
379     Method(HRESULT, "GetMaterial", [LPD3DMATERIAL]),
380     Method(HRESULT, "GetHandle", [LPDIRECT3DDEVICE,LPD3DMATERIALHANDLE]),
381     Method(HRESULT, "Reserve", []),
382     Method(HRESULT, "Unreserve", []),
383 ]
384
385 IDirect3DMaterial2.methods += [
386     Method(HRESULT, "SetMaterial", [LPD3DMATERIAL]),
387     Method(HRESULT, "GetMaterial", [LPD3DMATERIAL]),
388     Method(HRESULT, "GetHandle", [LPDIRECT3DDEVICE2,LPD3DMATERIALHANDLE]),
389 ]
390
391 IDirect3DMaterial3.methods += [
392     Method(HRESULT, "SetMaterial", [LPD3DMATERIAL]),
393     Method(HRESULT, "GetMaterial", [LPD3DMATERIAL]),
394     Method(HRESULT, "GetHandle", [LPDIRECT3DDEVICE3,LPD3DMATERIALHANDLE]),
395 ]
396
397 IDirect3DTexture.methods += [
398     Method(HRESULT, "Initialize", [LPDIRECT3DDEVICE,LPDIRECTDRAWSURFACE]),
399     Method(HRESULT, "GetHandle", [LPDIRECT3DDEVICE,LPD3DTEXTUREHANDLE]),
400     Method(HRESULT, "PaletteChanged", [DWORD,DWORD]),
401     Method(HRESULT, "Load", [LPDIRECT3DTEXTURE]),
402     Method(HRESULT, "Unload", []),
403 ]
404
405 IDirect3DTexture2.methods += [
406     Method(HRESULT, "GetHandle", [LPDIRECT3DDEVICE2,LPD3DTEXTUREHANDLE]),
407     Method(HRESULT, "PaletteChanged", [DWORD,DWORD]),
408     Method(HRESULT, "Load", [LPDIRECT3DTEXTURE2]),
409 ]
410
411 IDirect3DViewport.methods += [
412     Method(HRESULT, "Initialize", [LPDIRECT3D]),
413     Method(HRESULT, "GetViewport", [LPD3DVIEWPORT]),
414     Method(HRESULT, "SetViewport", [LPD3DVIEWPORT]),
415     Method(HRESULT, "TransformVertices", [DWORD,LPD3DTRANSFORMDATA,DWORD,LPDWORD]),
416     Method(HRESULT, "LightElements", [DWORD,LPD3DLIGHTDATA]),
417     Method(HRESULT, "SetBackground", [D3DMATERIALHANDLE]),
418     Method(HRESULT, "GetBackground", [LPD3DMATERIALHANDLE,LPBOOL]),
419     Method(HRESULT, "SetBackgroundDepth", [LPDIRECTDRAWSURFACE]),
420     Method(HRESULT, "GetBackgroundDepth", [OutPointer(LPDIRECTDRAWSURFACE),LPBOOL]),
421     Method(HRESULT, "Clear", [DWORD,LPD3DRECT,DWORD]),
422     Method(HRESULT, "AddLight", [LPDIRECT3DLIGHT]),
423     Method(HRESULT, "DeleteLight", [LPDIRECT3DLIGHT]),
424     Method(HRESULT, "NextLight", [LPDIRECT3DLIGHT,OutPointer(LPDIRECT3DLIGHT),DWORD]),
425 ]
426
427 IDirect3DViewport2.methods += [
428     Method(HRESULT, "GetViewport2", [LPD3DVIEWPORT2]),
429     Method(HRESULT, "SetViewport2", [LPD3DVIEWPORT2]),
430 ]
431
432 IDirect3DViewport3.methods += [
433     Method(HRESULT, "SetBackgroundDepth2", [LPDIRECTDRAWSURFACE4]),
434     Method(HRESULT, "GetBackgroundDepth2", [OutPointer(LPDIRECTDRAWSURFACE4),LPBOOL]),
435     Method(HRESULT, "Clear2", [DWORD,LPD3DRECT,DWORD,D3DCOLOR,D3DVALUE,DWORD]),
436 ]
437
438 IDirect3DVertexBuffer.methods += [
439     Method(HRESULT, "Lock", [DWORD,OutPointer(LPVOID),LPDWORD]),
440     Method(HRESULT, "Unlock", []),
441     Method(HRESULT, "ProcessVertices", [DWORD,DWORD,DWORD,LPDIRECT3DVERTEXBUFFER,DWORD,LPDIRECT3DDEVICE3,DWORD]),
442     Method(HRESULT, "GetVertexBufferDesc", [LPD3DVERTEXBUFFERDESC]),
443     Method(HRESULT, "Optimize", [LPDIRECT3DDEVICE3,DWORD]),
444 ]
445
446 IDirect3DVertexBuffer7.methods += [
447     Method(HRESULT, "Lock", [DWORD,OutPointer(LPVOID),LPDWORD]),
448     Method(HRESULT, "Unlock", []),
449     Method(HRESULT, "ProcessVertices", [DWORD,DWORD,DWORD,LPDIRECT3DVERTEXBUFFER7,DWORD,LPDIRECT3DDEVICE7,DWORD]),
450     Method(HRESULT, "GetVertexBufferDesc", [LPD3DVERTEXBUFFERDESC]),
451     Method(HRESULT, "Optimize", [LPDIRECT3DDEVICE7,DWORD]),
452     Method(HRESULT, "ProcessVerticesStrided", [DWORD,DWORD,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,LPDIRECT3DDEVICE7,DWORD]),
453 ]