blob: 9a11ec5244f668c2754af451f5a682bac29d31d0 [file] [log] [blame]
José Fonseca7ad40262009-09-30 17:17:12 +01001##########################################################################
José Fonseca95442442008-07-08 10:32:53 +09002#
José Fonseca7ad40262009-09-30 17:17:12 +01003# Copyright 2008-2009 VMware, Inc.
4# All Rights Reserved.
José Fonseca95442442008-07-08 10:32:53 +09005#
José Fonseca7ad40262009-09-30 17:17:12 +01006# 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:
José Fonseca95442442008-07-08 10:32:53 +090012#
José Fonseca7ad40262009-09-30 17:17:12 +010013# The above copyright notice and this permission notice shall be included in
14# all copies or substantial portions of the Software.
José Fonseca95442442008-07-08 10:32:53 +090015#
José Fonseca7ad40262009-09-30 17:17:12 +010016# 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.
José Fonseca95442442008-07-08 10:32:53 +090023#
José Fonseca7ad40262009-09-30 17:17:12 +010024##########################################################################/
José Fonseca95442442008-07-08 10:32:53 +090025
José Fonsecad626cf42008-07-07 07:43:16 +090026"""d3d8.h"""
27
José Fonsecaf20c1262010-11-25 11:39:57 +000028from winapi import *
José Fonsecad626cf42008-07-07 07:43:16 +090029from d3d8types import *
30from d3d8caps import *
31
José Fonseca73841ad2012-04-16 20:47:56 +010032HRESULT = MAKE_HRESULT(ok = "D3D_OK", errors = [
José Fonsecaebc661d2008-07-09 08:21:10 +090033 "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",
45 "D3DERR_NOTFOUND",
46 "D3DERR_MOREDATA",
47 "D3DERR_DEVICELOST",
48 "D3DERR_DEVICENOTRESET",
49 "D3DERR_NOTAVAILABLE",
50 "D3DERR_OUTOFVIDEOMEMORY",
51 "D3DERR_INVALIDDEVICE",
52 "D3DERR_INVALIDCALL",
53 "D3DERR_DRIVERINVALIDCALL",
54])
55
José Fonseca0f3195f2012-05-03 14:22:26 +010056D3DADAPTER = FakeEnum(UINT, [
57 "D3DADAPTER_DEFAULT",
58])
59
60D3DCREATE = 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",
68])
69
José Fonsecad626cf42008-07-07 07:43:16 +090070IDirect3D8 = Interface("IDirect3D8", IUnknown)
71IDirect3DDevice8 = Interface("IDirect3DDevice8", IUnknown)
72IDirect3DSwapChain8 = Interface("IDirect3DSwapChain8", IUnknown)
73IDirect3DResource8 = Interface("IDirect3DResource8", IUnknown)
74IDirect3DBaseTexture8 = Interface("IDirect3DBaseTexture8", IDirect3DResource8)
75IDirect3DTexture8 = Interface("IDirect3DTexture8", IDirect3DBaseTexture8)
76IDirect3DVolumeTexture8 = Interface("IDirect3DVolumeTexture8", IDirect3DBaseTexture8)
77IDirect3DCubeTexture8 = Interface("IDirect3DCubeTexture8", IDirect3DBaseTexture8)
78IDirect3DVertexBuffer8 = Interface("IDirect3DVertexBuffer8", IDirect3DResource8)
79IDirect3DIndexBuffer8 = Interface("IDirect3DIndexBuffer8", IDirect3DResource8)
80IDirect3DSurface8 = Interface("IDirect3DSurface8", IUnknown)
81IDirect3DVolume8 = Interface("IDirect3DVolume8", IUnknown)
82
José Fonseca9782b292012-04-14 22:02:42 +010083PDIRECT3D8 = ObjPointer(IDirect3D8)
84PDIRECT3DDEVICE8 = ObjPointer(IDirect3DDevice8)
85PDIRECT3DSWAPCHAIN8 = ObjPointer(IDirect3DSwapChain8)
86PDIRECT3DRESOURCE8 = ObjPointer(IDirect3DResource8)
87PDIRECT3DBASETEXTURE8 = ObjPointer(IDirect3DBaseTexture8)
88PDIRECT3DTEXTURE8 = ObjPointer(IDirect3DTexture8)
89PDIRECT3DVOLUMETEXTURE8 = ObjPointer(IDirect3DVolumeTexture8)
90PDIRECT3DCUBETEXTURE8 = ObjPointer(IDirect3DCubeTexture8)
91PDIRECT3DVERTEXBUFFER8 = ObjPointer(IDirect3DVertexBuffer8)
92PDIRECT3DINDEXBUFFER8 = ObjPointer(IDirect3DIndexBuffer8)
93PDIRECT3DSURFACE8 = ObjPointer(IDirect3DSurface8)
94PDIRECT3DVOLUME8 = ObjPointer(IDirect3DVolume8)
José Fonsecad626cf42008-07-07 07:43:16 +090095
96IDirect3D8.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +000097 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")]),
José Fonsecad626cf42008-07-07 07:43:16 +0900110]
111
112IDirect3DDevice8.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000113 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")]),
José Fonseca0187fac2011-05-24 20:16:37 +0100121 # XXX: There are different signatures of
122 # IDirect3DDevice8::SetCursorPosition depending on the DXSDK version
José Fonseca43aa19f2012-11-10 09:29:38 +0000123 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")]),
José Fonsecad626cf42008-07-07 07:43:16 +0900210]
211
212IDirect3DSwapChain8.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000213 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")]),
José Fonsecad626cf42008-07-07 07:43:16 +0900215]
216
217IDirect3DResource8.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000218 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", []),
José Fonsecad626cf42008-07-07 07:43:16 +0900226]
227
228IDirect3DBaseTexture8.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000229 StdMethod(DWORD, "SetLOD", [(DWORD, "LODNew")]),
230 StdMethod(DWORD, "GetLOD", []),
231 StdMethod(DWORD, "GetLevelCount", []),
José Fonsecad626cf42008-07-07 07:43:16 +0900232]
233
234IDirect3DTexture8.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000235 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")]),
José Fonsecad626cf42008-07-07 07:43:16 +0900240]
241
242IDirect3DVolumeTexture8.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000243 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")]),
José Fonsecad626cf42008-07-07 07:43:16 +0900248]
249
250IDirect3DCubeTexture8.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000251 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")]),
José Fonsecad626cf42008-07-07 07:43:16 +0900256]
257
258IDirect3DVertexBuffer8.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000259 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")]),
José Fonsecad626cf42008-07-07 07:43:16 +0900262]
263
264IDirect3DIndexBuffer8.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000265 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")]),
José Fonsecad626cf42008-07-07 07:43:16 +0900268]
269
270IDirect3DSurface8.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000271 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", []),
José Fonsecad626cf42008-07-07 07:43:16 +0900279]
280
281IDirect3DVolume8.methods += [
José Fonseca43aa19f2012-11-10 09:29:38 +0000282 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", []),
José Fonsecad626cf42008-07-07 07:43:16 +0900290]
291
José Fonseca4c5621e2011-04-28 08:56:23 +0100292d3d8 = API("d3d8")
José Fonseca54f304a2012-01-14 19:33:08 +0000293d3d8.addFunctions([
José Fonseca90dd97e2010-11-23 21:35:55 +0000294 StdFunction(PDIRECT3D8, "Direct3DCreate8", [(UINT, "SDKVersion")]),
José Fonseca4c5621e2011-04-28 08:56:23 +0100295])