]> git.cworth.org Git - apitrace/blob - d3d8.py
Handle pointers correctly.
[apitrace] / d3d8.py
1 """d3d8.h"""
2
3 from windows import *
4 from d3d8types import *
5 from d3d8caps import *
6
7 IDirect3D8 = Interface("IDirect3D8", IUnknown)
8 IDirect3DDevice8 = Interface("IDirect3DDevice8", IUnknown)
9 IDirect3DSwapChain8 = Interface("IDirect3DSwapChain8", IUnknown)
10 IDirect3DResource8 = Interface("IDirect3DResource8", IUnknown)
11 IDirect3DBaseTexture8 = Interface("IDirect3DBaseTexture8", IDirect3DResource8)
12 IDirect3DTexture8 = Interface("IDirect3DTexture8", IDirect3DBaseTexture8)
13 IDirect3DVolumeTexture8 = Interface("IDirect3DVolumeTexture8", IDirect3DBaseTexture8)
14 IDirect3DCubeTexture8 = Interface("IDirect3DCubeTexture8", IDirect3DBaseTexture8)
15 IDirect3DVertexBuffer8 = Interface("IDirect3DVertexBuffer8", IDirect3DResource8)
16 IDirect3DIndexBuffer8 = Interface("IDirect3DIndexBuffer8", IDirect3DResource8)
17 IDirect3DSurface8 = Interface("IDirect3DSurface8", IUnknown)
18 IDirect3DVolume8 = Interface("IDirect3DVolume8", IUnknown)
19
20 PDIRECT3D8 = WrapPointer(IDirect3D8)
21 PDIRECT3DDEVICE8 = WrapPointer(IDirect3DDevice8)
22 PDIRECT3DSWAPCHAIN8 = WrapPointer(IDirect3DSwapChain8)
23 PDIRECT3DRESOURCE8 = WrapPointer(IDirect3DResource8)
24 PDIRECT3DBASETEXTURE8 = WrapPointer(IDirect3DBaseTexture8)
25 PDIRECT3DTEXTURE8 = WrapPointer(IDirect3DTexture8)
26 PDIRECT3DVOLUMETEXTURE8 = WrapPointer(IDirect3DVolumeTexture8)
27 PDIRECT3DCUBETEXTURE8 = WrapPointer(IDirect3DCubeTexture8)
28 PDIRECT3DVERTEXBUFFER8 = WrapPointer(IDirect3DVertexBuffer8)
29 PDIRECT3DINDEXBUFFER8 = WrapPointer(IDirect3DIndexBuffer8)
30 PDIRECT3DSURFACE8 = WrapPointer(IDirect3DSurface8)
31 PDIRECT3DVOLUME8 = WrapPointer(IDirect3DVolume8)
32
33 IDirect3D8.methods += [
34         Method(HRESULT, "RegisterSoftwareDevice", [(Pointer(Void), "pInitializeFunction")]),
35         Method(UINT, "GetAdapterCount", []),
36         Method(HRESULT, "GetAdapterIdentifier", [(UINT, "Adapter"), (DWORD, "Flags"), (Pointer(D3DADAPTER_IDENTIFIER8), "pIdentifier")]),
37         Method(UINT, "GetAdapterModeCount", [(UINT, "Adapter")]),
38         Method(HRESULT, "EnumAdapterModes", [(UINT, "Adapter"), (UINT, "Mode"), (Pointer(D3DDISPLAYMODE), "pMode")]),
39         Method(HRESULT, "GetAdapterDisplayMode", [(UINT, "Adapter"), (Pointer(D3DDISPLAYMODE), "pMode")]),
40         Method(HRESULT, "CheckDeviceType", [(UINT, "Adapter"), (D3DDEVTYPE, "CheckType"), (D3DFORMAT, "DisplayFormat"), (D3DFORMAT, "BackBufferFormat"), (BOOL, "Windowed")]),
41         Method(HRESULT, "CheckDeviceFormat", [(UINT, "Adapter"), (D3DDEVTYPE, "DeviceType"), (D3DFORMAT, "AdapterFormat"), (DWORD, "Usage"), (D3DRESOURCETYPE, "RType"), (D3DFORMAT, "CheckFormat")]),
42         Method(HRESULT, "CheckDeviceMultiSampleType", [(UINT, "Adapter"), (D3DDEVTYPE, "DeviceType"), (D3DFORMAT, "SurfaceFormat"), (BOOL, "Windowed"), (D3DMULTISAMPLE_TYPE, "MultiSampleType")]),
43         Method(HRESULT, "CheckDepthStencilMatch", [(UINT, "Adapter"), (D3DDEVTYPE, "DeviceType"), (D3DFORMAT, "AdapterFormat"), (D3DFORMAT, "RenderTargetFormat"), (D3DFORMAT, "DepthStencilFormat")]),
44         Method(HRESULT, "GetDeviceCaps", [(UINT, "Adapter"), (D3DDEVTYPE, "DeviceType"), (Pointer(D3DCAPS8), "pCaps")]),
45         Method(HMONITOR, "GetAdapterMonitor", [(UINT, "Adapter")]),
46         Method(HRESULT, "CreateDevice", [(UINT, "Adapter"), (D3DDEVTYPE, "DeviceType"), (HWND, "hFocusWindow"), (DWORD, "BehaviorFlags"), (Pointer(D3DPRESENT_PARAMETERS), "pPresentationParameters"), (OutPointer(PDIRECT3DDEVICE8), "ppReturnedDeviceInterface")]),
47 ]
48
49 IDirect3DDevice8.methods += [
50         Method(HRESULT, "TestCooperativeLevel", []),
51         Method(UINT, "GetAvailableTextureMem", []),
52         Method(HRESULT, "ResourceManagerDiscardBytes", [(DWORD, "Bytes")]),
53         Method(HRESULT, "GetDirect3D", [(OutPointer(PDIRECT3D8), "ppD3D8")]),
54         Method(HRESULT, "GetDeviceCaps", [(Pointer(D3DCAPS8), "pCaps")]),
55         Method(HRESULT, "GetDisplayMode", [(Pointer(D3DDISPLAYMODE), "pMode")]),
56         Method(HRESULT, "GetCreationParameters", [(Pointer(D3DDEVICE_CREATION_PARAMETERS), "pParameters")]),
57         Method(HRESULT, "SetCursorProperties", [(UINT, "XHotSpot"), (UINT, "YHotSpot"), (PDIRECT3DSURFACE8, "pCursorBitmap")]),
58         Method(Void, "SetCursorPosition", [(Int, "X"), (Int, "Y"), (DWORD, "Flags")]),
59         Method(BOOL, "ShowCursor", [(BOOL, "bShow")]),
60         Method(HRESULT, "CreateAdditionalSwapChain", [(Pointer(D3DPRESENT_PARAMETERS), "pPresentationParameters"), (OutPointer(PDIRECT3DSWAPCHAIN8), "pSwapChain")]),
61         Method(HRESULT, "Reset", [(Pointer(D3DPRESENT_PARAMETERS), "pPresentationParameters")]),
62         Method(HRESULT, "Present", [(Pointer(Const(RECT)), "pSourceRect"), (Pointer(Const(RECT)), "pDestRect"), (HWND, "hDestWindowOverride"), (Const(Pointer(RGNDATA)), "pDirtyRegion")]),
63         Method(HRESULT, "GetBackBuffer", [(UINT, "BackBuffer"), (D3DBACKBUFFER_TYPE, "Type"), (OutPointer(PDIRECT3DSURFACE8), "ppBackBuffer")]),
64         Method(HRESULT, "GetRasterStatus", [(Pointer(D3DRASTER_STATUS), "pRasterStatus")]),
65         Method(Void, "SetGammaRamp", [(DWORD, "Flags"), (Pointer(Const(D3DGAMMARAMP)), "pRamp")]),
66         Method(Void, "GetGammaRamp", [(Pointer(D3DGAMMARAMP), "pRamp")]),
67         Method(HRESULT, "CreateTexture", [(UINT, "Width"), (UINT, "Height"), (UINT, "Levels"), (DWORD, "Usage"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), (OutPointer(PDIRECT3DTEXTURE8), "ppTexture")]),
68         Method(HRESULT, "CreateVolumeTexture", [(UINT, "Width"), (UINT, "Height"), (UINT, "Depth"), (UINT, "Levels"), (DWORD, "Usage"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), (OutPointer(PDIRECT3DVOLUMETEXTURE8), "ppVolumeTexture")]),
69         Method(HRESULT, "CreateCubeTexture", [(UINT, "EdgeLength"), (UINT, "Levels"), (DWORD, "Usage"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), (OutPointer(PDIRECT3DCUBETEXTURE8), "ppCubeTexture")]),
70         Method(HRESULT, "CreateVertexBuffer", [(UINT, "Length"), (DWORD, "Usage"), (DWORD, "FVF"), (D3DPOOL, "Pool"), (OutPointer(PDIRECT3DVERTEXBUFFER8), "ppVertexBuffer")]),
71         Method(HRESULT, "CreateIndexBuffer", [(UINT, "Length"), (DWORD, "Usage"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), (OutPointer(PDIRECT3DINDEXBUFFER8), "ppIndexBuffer")]),
72         Method(HRESULT, "CreateRenderTarget", [(UINT, "Width"), (UINT, "Height"), (D3DFORMAT, "Format"), (D3DMULTISAMPLE_TYPE, "MultiSample"), (BOOL, "Lockable"), (OutPointer(PDIRECT3DSURFACE8), "ppSurface")]),
73         Method(HRESULT, "CreateDepthStencilSurface", [(UINT, "Width"), (UINT, "Height"), (D3DFORMAT, "Format"), (D3DMULTISAMPLE_TYPE, "MultiSample"), (OutPointer(PDIRECT3DSURFACE8), "ppSurface")]),
74         Method(HRESULT, "CreateImageSurface", [(UINT, "Width"), (UINT, "Height"), (D3DFORMAT, "Format"), (OutPointer(PDIRECT3DSURFACE8), "ppSurface")]),
75         Method(HRESULT, "CopyRects", [(PDIRECT3DSURFACE8, "pSourceSurface"), (Pointer(Const(RECT)), "pSourceRectsArray"), (UINT, "cRects"), (PDIRECT3DSURFACE8, "pDestinationSurface"), (Pointer(Const(POINT)), "pDestPointsArray")]),
76         Method(HRESULT, "UpdateTexture", [(PDIRECT3DBASETEXTURE8, "pSourceTexture"), (PDIRECT3DBASETEXTURE8, "pDestinationTexture")]),
77         Method(HRESULT, "GetFrontBuffer", [(PDIRECT3DSURFACE8, "pDestSurface")]),
78         Method(HRESULT, "SetRenderTarget", [(PDIRECT3DSURFACE8, "pRenderTarget"), (PDIRECT3DSURFACE8, "pNewZStencil")]),
79         Method(HRESULT, "GetRenderTarget", [(OutPointer(PDIRECT3DSURFACE8), "ppRenderTarget")]),
80         Method(HRESULT, "GetDepthStencilSurface", [(OutPointer(PDIRECT3DSURFACE8), "ppZStencilSurface")]),
81         Method(HRESULT, "BeginScene", []),
82         Method(HRESULT, "EndScene", []),
83         Method(HRESULT, "Clear", [(DWORD, "Count"), (Pointer(Const(D3DRECT)), "pRects"), (DWORD, "Flags"), (D3DCOLOR, "Color"), (Float, "Z"), (DWORD, "Stencil")]),
84         Method(HRESULT, "SetTransform", [(D3DTRANSFORMSTATETYPE, "State"), (Pointer(Const(D3DMATRIX)), "pMatrix")]),
85         Method(HRESULT, "GetTransform", [(D3DTRANSFORMSTATETYPE, "State"), (Pointer(D3DMATRIX), "pMatrix")]),
86         Method(HRESULT, "MultiplyTransform", [(D3DTRANSFORMSTATETYPE, "State"), (Pointer(Const(D3DMATRIX)), "pMatrix")]),
87         Method(HRESULT, "SetViewport", [(Pointer(Const(D3DVIEWPORT8)), "pViewport")]),
88         Method(HRESULT, "GetViewport", [(Pointer(D3DVIEWPORT8), "pViewport")]),
89         Method(HRESULT, "SetMaterial", [(Pointer(Const(D3DMATERIAL8)), "pMaterial")]),
90         Method(HRESULT, "GetMaterial", [(Pointer(D3DMATERIAL8), "pMaterial")]),
91         Method(HRESULT, "SetLight", [(DWORD, "Index"), (Pointer(Const(D3DLIGHT8)), "pLight")]),
92         Method(HRESULT, "GetLight", [(DWORD, "Index"), (Pointer(D3DLIGHT8), "pLight")]),
93         Method(HRESULT, "LightEnable", [(DWORD, "Index"), (BOOL, "Enable")]),
94         Method(HRESULT, "GetLightEnable", [(DWORD, "Index"), (Pointer(BOOL), "pEnable")]),
95         Method(HRESULT, "SetClipPlane", [(DWORD, "Index"), (Pointer(Const(Float)), "pPlane")]),
96         Method(HRESULT, "GetClipPlane", [(DWORD, "Index"), (Pointer(Float), "pPlane")]),
97         Method(HRESULT, "SetRenderState", [(D3DRENDERSTATETYPE, "State"), (DWORD, "Value")]),
98         Method(HRESULT, "GetRenderState", [(D3DRENDERSTATETYPE, "State"), (Pointer(DWORD), "pValue")]),
99         Method(HRESULT, "BeginStateBlock", []),
100         Method(HRESULT, "EndStateBlock", [(Pointer(DWORD), "pToken")]),
101         Method(HRESULT, "ApplyStateBlock", [(DWORD, "Token")]),
102         Method(HRESULT, "CaptureStateBlock", [(DWORD, "Token")]),
103         Method(HRESULT, "DeleteStateBlock", [(DWORD, "Token")]),
104         Method(HRESULT, "CreateStateBlock", [(D3DSTATEBLOCKTYPE, "Type"), (Pointer(DWORD), "pToken")]),
105         Method(HRESULT, "SetClipStatus", [(Pointer(Const(D3DCLIPSTATUS8)), "pClipStatus")]),
106         Method(HRESULT, "GetClipStatus", [(Pointer(D3DCLIPSTATUS8), "pClipStatus")]),
107         Method(HRESULT, "GetTexture", [(DWORD, "Stage"), (OutPointer(PDIRECT3DBASETEXTURE8), "ppTexture")]),
108         Method(HRESULT, "SetTexture", [(DWORD, "Stage"), (PDIRECT3DBASETEXTURE8, "pTexture")]),
109         Method(HRESULT, "GetTextureStageState", [(DWORD, "Stage"), (D3DTEXTURESTAGESTATETYPE, "Type"), (Pointer(DWORD), "pValue")]),
110         Method(HRESULT, "SetTextureStageState", [(DWORD, "Stage"), (D3DTEXTURESTAGESTATETYPE, "Type"), (DWORD, "Value")]),
111         Method(HRESULT, "ValidateDevice", [(Pointer(DWORD), "pNumPasses")]),
112         Method(HRESULT, "GetInfo", [(DWORD, "DevInfoID"), (Pointer(Void), "pDevInfoStruct"), (DWORD, "DevInfoStructSize")]),
113         Method(HRESULT, "SetPaletteEntries", [(UINT, "PaletteNumber"), (Pointer(Const(PALETTEENTRY)), "pEntries")]),
114         Method(HRESULT, "GetPaletteEntries", [(UINT, "PaletteNumber"), (Pointer(PALETTEENTRY), "pEntries")]),
115         Method(HRESULT, "SetCurrentTexturePalette", [(UINT, "PaletteNumber")]),
116         Method(HRESULT, "GetCurrentTexturePalette", [(Pointer(UINT), "PaletteNumber")]),
117         Method(HRESULT, "DrawPrimitive", [(D3DPRIMITIVETYPE, "PrimitiveType"), (UINT, "StartVertex"), (UINT, "PrimitiveCount")]),
118         Method(HRESULT, "DrawIndexedPrimitive", [(D3DPRIMITIVETYPE, "PrimitiveType"), (UINT, "minIndex"), (UINT, "NumVertices"), (UINT, "startIndex"), (UINT, "primCount")]),
119         Method(HRESULT, "DrawPrimitiveUP", [(D3DPRIMITIVETYPE, "PrimitiveType"), (UINT, "PrimitiveCount"), (Const(Pointer(Void)), "pVertexStreamZeroData"), (UINT, "VertexStreamZeroStride")]),
120         Method(HRESULT, "DrawIndexedPrimitiveUP", [(D3DPRIMITIVETYPE, "PrimitiveType"), (UINT, "MinVertexIndex"), (UINT, "NumVertexIndices"), (UINT, "PrimitiveCount"), (Const(Pointer(Void)), "pIndexData"), (D3DFORMAT, "IndexDataFormat"), (Const(Pointer(Void)), "pVertexStreamZeroData"), (UINT, "VertexStreamZeroStride")]),
121         Method(HRESULT, "ProcessVertices", [(UINT, "SrcStartIndex"), (UINT, "DestIndex"), (UINT, "VertexCount"), (PDIRECT3DVERTEXBUFFER8, "pDestBuffer"), (DWORD, "Flags")]),
122         Method(HRESULT, "CreateVertexShader", [(Pointer(Const(DWORD)), "pDeclaration"), (Pointer(Const(DWORD)), "pFunction"), (Pointer(DWORD), "pHandle"), (DWORD, "Usage")]),
123         Method(HRESULT, "SetVertexShader", [(DWORD, "Handle")]),
124         Method(HRESULT, "GetVertexShader", [(Pointer(DWORD), "pHandle")]),
125         Method(HRESULT, "DeleteVertexShader", [(DWORD, "Handle")]),
126         Method(HRESULT, "SetVertexShaderConstant", [(DWORD, "Register"), (Const(Pointer(Void)), "pConstantData"), (DWORD, "ConstantCount")]),
127         Method(HRESULT, "GetVertexShaderConstant", [(DWORD, "Register"), (Pointer(Void), "pConstantData"), (DWORD, "ConstantCount")]),
128         Method(HRESULT, "GetVertexShaderDeclaration", [(DWORD, "Handle"), (Pointer(Void), "pData"), (Pointer(DWORD), "pSizeOfData")]),
129         Method(HRESULT, "GetVertexShaderFunction", [(DWORD, "Handle"), (Pointer(Void), "pData"), (Pointer(DWORD), "pSizeOfData")]),
130         Method(HRESULT, "SetStreamSource", [(UINT, "StreamNumber"), (PDIRECT3DVERTEXBUFFER8, "pStreamData"), (UINT, "Stride")]),
131         Method(HRESULT, "GetStreamSource", [(UINT, "StreamNumber"), (OutPointer(PDIRECT3DVERTEXBUFFER8), "ppStreamData"), (Pointer(UINT), "pStride")]),
132         Method(HRESULT, "SetIndices", [(PDIRECT3DINDEXBUFFER8, "pIndexData"), (UINT, "BaseVertexIndex")]),
133         Method(HRESULT, "GetIndices", [(OutPointer(PDIRECT3DINDEXBUFFER8), "ppIndexData"), (Pointer(UINT), "pBaseVertexIndex")]),
134         Method(HRESULT, "CreatePixelShader", [(Pointer(Const(DWORD)), "pFunction"), (Pointer(DWORD), "pHandle")]),
135         Method(HRESULT, "SetPixelShader", [(DWORD, "Handle")]),
136         Method(HRESULT, "GetPixelShader", [(Pointer(DWORD), "pHandle")]),
137         Method(HRESULT, "DeletePixelShader", [(DWORD, "Handle")]),
138         Method(HRESULT, "SetPixelShaderConstant", [(DWORD, "Register"), (Const(Pointer(Void)), "pConstantData"), (DWORD, "ConstantCount")]),
139         Method(HRESULT, "GetPixelShaderConstant", [(DWORD, "Register"), (Pointer(Void), "pConstantData"), (DWORD, "ConstantCount")]),
140         Method(HRESULT, "GetPixelShaderFunction", [(DWORD, "Handle"), (Pointer(Void), "pData"), (Pointer(DWORD), "pSizeOfData")]),
141         Method(HRESULT, "DrawRectPatch", [(UINT, "Handle"), (Pointer(Const(Float)), "pNumSegs"), (Pointer(Const(D3DRECTPATCH_INFO)), "pRectPatchInfo")]),
142         Method(HRESULT, "DrawTriPatch", [(UINT, "Handle"), (Pointer(Const(Float)), "pNumSegs"), (Pointer(Const(D3DTRIPATCH_INFO)), "pTriPatchInfo")]),
143         Method(HRESULT, "DeletePatch", [(UINT, "Handle")]),
144 ]
145
146 IDirect3DSwapChain8.methods += [
147         Method(HRESULT, "Present", [(Pointer(Const(RECT)), "pSourceRect"), (Pointer(Const(RECT)), "pDestRect"), (HWND, "hDestWindowOverride"), (Const(Pointer(RGNDATA)), "pDirtyRegion")]),
148         Method(HRESULT, "GetBackBuffer", [(UINT, "BackBuffer"), (D3DBACKBUFFER_TYPE, "Type"), (OutPointer(PDIRECT3DSURFACE8), "ppBackBuffer")]),
149 ]
150
151 IDirect3DResource8.methods += [
152         Method(HRESULT, "GetDevice", [(OutPointer(PDIRECT3DDEVICE8), "ppDevice")]),
153         Method(HRESULT, "SetPrivateData", [(REFGUID, "refguid"), (Const(Pointer(Void)), "pData"), (DWORD, "SizeOfData"), (DWORD, "Flags")]),
154         Method(HRESULT, "GetPrivateData", [(REFGUID, "refguid"), (Pointer(Void), "pData"), (Pointer(DWORD), "pSizeOfData")]),
155         Method(HRESULT, "FreePrivateData", [(REFGUID, "refguid")]),
156         Method(DWORD, "SetPriority", [(DWORD, "PriorityNew")]),
157         Method(DWORD, "GetPriority", []),
158         Method(Void, "PreLoad", []),
159         Method(D3DRESOURCETYPE, "GetType", []),
160 ]
161
162 IDirect3DBaseTexture8.methods += [
163         Method(DWORD, "SetLOD", [(DWORD, "LODNew")]),
164         Method(DWORD, "GetLOD", []),
165         Method(DWORD, "GetLevelCount", []),
166 ]
167
168 IDirect3DTexture8.methods += [
169         Method(HRESULT, "GetLevelDesc", [(UINT, "Level"), (Pointer(D3DSURFACE_DESC), "pDesc")]),
170         Method(HRESULT, "GetSurfaceLevel", [(UINT, "Level"), (OutPointer(PDIRECT3DSURFACE8), "ppSurfaceLevel")]),
171         Method(HRESULT, "LockRect", [(UINT, "Level"), (Pointer(D3DLOCKED_RECT), "pLockedRect"), (Pointer(Const(RECT)), "pRect"), (DWORD, "Flags")]),
172         Method(HRESULT, "UnlockRect", [(UINT, "Level")]),
173         Method(HRESULT, "AddDirtyRect", [(Pointer(Const(RECT)), "pDirtyRect")]),
174 ]
175
176 IDirect3DVolumeTexture8.methods += [
177         Method(HRESULT, "GetLevelDesc", [(UINT, "Level"), (Pointer(D3DVOLUME_DESC), "pDesc")]),
178         Method(HRESULT, "GetVolumeLevel", [(UINT, "Level"), (OutPointer(PDIRECT3DVOLUME8), "ppVolumeLevel")]),
179         Method(HRESULT, "LockBox", [(UINT, "Level"), (Pointer(D3DLOCKED_BOX), "pLockedVolume"), (Pointer(Const(D3DBOX)), "pBox"), (DWORD, "Flags")]),
180         Method(HRESULT, "UnlockBox", [(UINT, "Level")]),
181         Method(HRESULT, "AddDirtyBox", [(Pointer(Const(D3DBOX)), "pDirtyBox")]),
182 ]
183
184 IDirect3DCubeTexture8.methods += [
185         Method(HRESULT, "GetLevelDesc", [(UINT, "Level"), (Pointer(D3DSURFACE_DESC), "pDesc")]),
186         Method(HRESULT, "GetCubeMapSurface", [(D3DCUBEMAP_FACES, "FaceType"), (UINT, "Level"), (OutPointer(PDIRECT3DSURFACE8), "ppCubeMapSurface")]),
187         Method(HRESULT, "LockRect", [(D3DCUBEMAP_FACES, "FaceType"), (UINT, "Level"), (Pointer(D3DLOCKED_RECT), "pLockedRect"), (Pointer(Const(RECT)), "pRect"), (DWORD, "Flags")]),
188         Method(HRESULT, "UnlockRect", [(D3DCUBEMAP_FACES, "FaceType"), (UINT, "Level")]),
189         Method(HRESULT, "AddDirtyRect", [(D3DCUBEMAP_FACES, "FaceType"), (Pointer(Const(RECT)), "pDirtyRect")]),
190 ]
191
192 IDirect3DVertexBuffer8.methods += [
193         Method(HRESULT, "Lock", [(UINT, "OffsetToLock"), (UINT, "SizeToLock"), (OutPointer(Pointer(BYTE)), "ppbData"), (DWORD, "Flags")]),
194         Method(HRESULT, "Unlock", []),
195         Method(HRESULT, "GetDesc", [(Pointer(D3DVERTEXBUFFER_DESC), "pDesc")]),
196 ]
197
198 IDirect3DIndexBuffer8.methods += [
199         Method(HRESULT, "Lock", [(UINT, "OffsetToLock"), (UINT, "SizeToLock"), (OutPointer(Pointer(BYTE)), "ppbData"), (DWORD, "Flags")]),
200         Method(HRESULT, "Unlock", []),
201         Method(HRESULT, "GetDesc", [(Pointer(D3DINDEXBUFFER_DESC), "pDesc")]),
202 ]
203
204 IDirect3DSurface8.methods += [
205         Method(HRESULT, "GetDevice", [(OutPointer(PDIRECT3DDEVICE8), "ppDevice")]),
206         Method(HRESULT, "SetPrivateData", [(REFGUID, "refguid"), (Const(Pointer(Void)), "pData"), (DWORD, "SizeOfData"), (DWORD, "Flags")]),
207         Method(HRESULT, "GetPrivateData", [(REFGUID, "refguid"), (Pointer(Void), "pData"), (Pointer(DWORD), "pSizeOfData")]),
208         Method(HRESULT, "FreePrivateData", [(REFGUID, "refguid")]),
209         Method(HRESULT, "GetContainer", [(REFIID, "riid"), (OutPointer(Pointer(Void)), "ppContainer")]),
210         Method(HRESULT, "GetDesc", [(Pointer(D3DSURFACE_DESC), "pDesc")]),
211         Method(HRESULT, "LockRect", [(Pointer(D3DLOCKED_RECT), "pLockedRect"), (Pointer(Const(RECT)), "pRect"), (DWORD, "Flags")]),
212         Method(HRESULT, "UnlockRect", []),
213 ]
214
215 IDirect3DVolume8.methods += [
216         Method(HRESULT, "GetDevice", [(OutPointer(PDIRECT3DDEVICE8), "ppDevice")]),
217         Method(HRESULT, "SetPrivateData", [(REFGUID, "refguid"), (Const(Pointer(Void)), "pData"), (DWORD, "SizeOfData"), (DWORD, "Flags")]),
218         Method(HRESULT, "GetPrivateData", [(REFGUID, "refguid"), (Pointer(Void), "pData"), (Pointer(DWORD), "pSizeOfData")]),
219         Method(HRESULT, "FreePrivateData", [(REFGUID, "refguid")]),
220         Method(HRESULT, "GetContainer", [(REFIID, "riid"), (OutPointer(Pointer(Void)), "ppContainer")]),
221         Method(HRESULT, "GetDesc", [(Pointer(D3DVOLUME_DESC), "pDesc")]),
222         Method(HRESULT, "LockBox", [(Pointer(D3DLOCKED_BOX), "pLockedVolume"), (Pointer(Const(D3DBOX)), "pBox"), (DWORD, "Flags")]),
223         Method(HRESULT, "UnlockBox", []),
224 ]
225
226 d3d8 = Dll("d3d8")
227 d3d8.functions += [
228     Function(PDIRECT3D8, "Direct3DCreate8", [(UINT, "SDKVersion")]),
229 ]
230
231 if __name__ == '__main__':
232     print '#include <windows.h>'
233     print '#include <tchar.h>'
234     print '#include <d3d8.h>'
235     print
236     print '#include "log.hpp"'
237     print
238     wrap()
239