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