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