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