José Fonseca | 7ad4026 | 2009-09-30 17:17:12 +0100 | [diff] [blame] | 1 | ########################################################################## |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 2 | # |
José Fonseca | 7ad4026 | 2009-09-30 17:17:12 +0100 | [diff] [blame] | 3 | # Copyright 2008-2009 VMware, Inc. |
| 4 | # All Rights Reserved. |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 5 | # |
José Fonseca | 7ad4026 | 2009-09-30 17:17:12 +0100 | [diff] [blame] | 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: |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 12 | # |
José Fonseca | 7ad4026 | 2009-09-30 17:17:12 +0100 | [diff] [blame] | 13 | # The above copyright notice and this permission notice shall be included in |
| 14 | # all copies or substantial portions of the Software. |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 15 | # |
José Fonseca | 7ad4026 | 2009-09-30 17:17:12 +0100 | [diff] [blame] | 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 |
| 22 | # THE SOFTWARE. |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 23 | # |
José Fonseca | 7ad4026 | 2009-09-30 17:17:12 +0100 | [diff] [blame] | 24 | ##########################################################################/ |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 25 | |
| 26 | """d3d9.h""" |
| 27 | |
Piotr Podsiadły | 0b8b019 | 2019-01-03 20:39:55 +0100 | [diff] [blame] | 28 | from .winapi import * |
| 29 | from .d3d9types import * |
| 30 | from .d3d9caps import * |
José Fonseca | 4106eb4 | 2011-09-21 08:12:39 +0100 | [diff] [blame] | 31 | |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 32 | |
José Fonseca | 112a132 | 2012-04-27 17:15:32 +0100 | [diff] [blame] | 33 | D3DSHADER9 = Blob(Const(DWORD), "_shaderSize(pFunction)") |
José Fonseca | e75aef4 | 2009-07-22 18:14:52 +0100 | [diff] [blame] | 34 | |
José Fonseca | 1fa566d | 2011-04-29 10:08:13 +0100 | [diff] [blame] | 35 | D3DSPD = Flags(DWORD, [ |
| 36 | "D3DSPD_IUNKNOWN", |
| 37 | ]) |
| 38 | |
José Fonseca | 01de501 | 2012-05-03 11:04:22 +0100 | [diff] [blame] | 39 | D3DADAPTER = FakeEnum(UINT, [ |
José Fonseca | 1fa566d | 2011-04-29 10:08:13 +0100 | [diff] [blame] | 40 | "D3DADAPTER_DEFAULT", |
| 41 | ]) |
| 42 | |
| 43 | D3DENUM = FakeEnum(DWORD, [ |
| 44 | "D3DENUM_WHQL_LEVEL", |
| 45 | ]) |
| 46 | |
| 47 | D3DSGR = Flags(DWORD, [ |
| 48 | "D3DSGR_NO_CALIBRATION", |
| 49 | "D3DSGR_CALIBRATE", |
| 50 | ]) |
| 51 | |
| 52 | D3DCURSOR = Flags(DWORD, [ |
| 53 | "D3DCURSOR_IMMEDIATE_UPDATE", |
| 54 | ]) |
| 55 | |
| 56 | D3DPRESENT = Flags(DWORD, [ |
| 57 | "D3DPRESENT_DONOTWAIT", |
| 58 | "D3DPRESENT_LINEAR_CONTENT", |
| 59 | "D3DPRESENT_DONOTFLIP", |
| 60 | "D3DPRESENT_FLIPRESTART", |
| 61 | "D3DPRESENT_VIDEO_RESTRICT_TO_MONITOR", |
| 62 | ]) |
| 63 | |
José Fonseca | 73841ad | 2012-04-16 20:47:56 +0100 | [diff] [blame] | 64 | HRESULT = MAKE_HRESULT(ok = "D3D_OK", errors = [ |
José Fonseca | ebc661d | 2008-07-09 08:21:10 +0900 | [diff] [blame] | 65 | "D3DERR_WRONGTEXTUREFORMAT", |
| 66 | "D3DERR_UNSUPPORTEDCOLOROPERATION", |
| 67 | "D3DERR_UNSUPPORTEDCOLORARG", |
| 68 | "D3DERR_UNSUPPORTEDALPHAOPERATION", |
| 69 | "D3DERR_UNSUPPORTEDALPHAARG", |
| 70 | "D3DERR_TOOMANYOPERATIONS", |
| 71 | "D3DERR_CONFLICTINGTEXTUREFILTER", |
| 72 | "D3DERR_UNSUPPORTEDFACTORVALUE", |
| 73 | "D3DERR_CONFLICTINGRENDERSTATE", |
| 74 | "D3DERR_UNSUPPORTEDTEXTUREFILTER", |
| 75 | "D3DERR_CONFLICTINGTEXTUREPALETTE", |
| 76 | "D3DERR_DRIVERINTERNALERROR", |
| 77 | "D3DERR_NOTFOUND", |
| 78 | "D3DERR_MOREDATA", |
| 79 | "D3DERR_DEVICELOST", |
| 80 | "D3DERR_DEVICENOTRESET", |
| 81 | "D3DERR_NOTAVAILABLE", |
| 82 | "D3DERR_OUTOFVIDEOMEMORY", |
| 83 | "D3DERR_INVALIDDEVICE", |
| 84 | "D3DERR_INVALIDCALL", |
| 85 | "D3DERR_DRIVERINVALIDCALL", |
| 86 | "D3DERR_WASSTILLDRAWING", |
| 87 | "D3DOK_NOAUTOGEN", |
| 88 | "D3DERR_DEVICEREMOVED", |
| 89 | "S_NOT_RESIDENT", |
| 90 | "S_RESIDENT_IN_SHARED_MEMORY", |
| 91 | "S_PRESENT_MODE_CHANGED", |
| 92 | "S_PRESENT_OCCLUDED", |
| 93 | "D3DERR_DEVICEHUNG", |
| 94 | ]) |
| 95 | |
Jose Fonseca | 614c5da | 2016-02-19 12:32:45 +0000 | [diff] [blame] | 96 | # If we ever swizzle shared handles, it will have to be done manually |
| 97 | SHARED_HANDLE = RAW_HANDLE |
| 98 | |
| 99 | # System memory textures |
| 100 | # https://msdn.microsoft.com/en-us/library/windows/desktop/bb219800.aspx#Textures |
| 101 | SHARED_HANDLE_SYSMEM = Polymorphic('Pool', [ |
| 102 | ('D3DPOOL_SYSTEMMEM', Blob(Void, '_getLockSize(Format, false, Width, Height)')) |
| 103 | ], SHARED_HANDLE, contextLess=False) |
| 104 | |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 105 | IDirect3D9 = Interface("IDirect3D9", IUnknown) |
| 106 | IDirect3DDevice9 = Interface("IDirect3DDevice9", IUnknown) |
| 107 | IDirect3DStateBlock9 = Interface("IDirect3DStateBlock9", IUnknown) |
| 108 | IDirect3DSwapChain9 = Interface("IDirect3DSwapChain9", IUnknown) |
| 109 | IDirect3DResource9 = Interface("IDirect3DResource9", IUnknown) |
| 110 | IDirect3DVertexDeclaration9 = Interface("IDirect3DVertexDeclaration9", IUnknown) |
| 111 | IDirect3DVertexShader9 = Interface("IDirect3DVertexShader9", IUnknown) |
| 112 | IDirect3DPixelShader9 = Interface("IDirect3DPixelShader9", IUnknown) |
| 113 | IDirect3DBaseTexture9 = Interface("IDirect3DBaseTexture9", IDirect3DResource9) |
| 114 | IDirect3DTexture9 = Interface("IDirect3DTexture9", IDirect3DBaseTexture9) |
| 115 | IDirect3DVolumeTexture9 = Interface("IDirect3DVolumeTexture9", IDirect3DBaseTexture9) |
| 116 | IDirect3DCubeTexture9 = Interface("IDirect3DCubeTexture9", IDirect3DBaseTexture9) |
| 117 | IDirect3DVertexBuffer9 = Interface("IDirect3DVertexBuffer9", IDirect3DResource9) |
| 118 | IDirect3DIndexBuffer9 = Interface("IDirect3DIndexBuffer9", IDirect3DResource9) |
| 119 | IDirect3DSurface9 = Interface("IDirect3DSurface9", IDirect3DResource9) |
| 120 | IDirect3DVolume9 = Interface("IDirect3DVolume9", IUnknown) |
| 121 | IDirect3DQuery9 = Interface("IDirect3DQuery9", IUnknown) |
| 122 | IDirect3D9Ex = Interface("IDirect3D9Ex", IDirect3D9) |
| 123 | IDirect3DDevice9Ex = Interface("IDirect3DDevice9Ex", IDirect3DDevice9) |
| 124 | IDirect3DSwapChain9Ex = Interface("IDirect3DSwapChain9Ex", IDirect3DSwapChain9) |
| 125 | |
José Fonseca | fbcf683 | 2012-04-05 07:10:30 +0100 | [diff] [blame] | 126 | PDIRECT3D9 = ObjPointer(IDirect3D9) |
| 127 | PDIRECT3DDEVICE9 = ObjPointer(IDirect3DDevice9) |
| 128 | PDIRECT3DSTATEBLOCK9 = ObjPointer(IDirect3DStateBlock9) |
| 129 | PDIRECT3DSWAPCHAIN9 = ObjPointer(IDirect3DSwapChain9) |
| 130 | PDIRECT3DRESOURCE9 = ObjPointer(IDirect3DResource9) |
| 131 | PDIRECT3DVERTEXDECLARATION9 = ObjPointer(IDirect3DVertexDeclaration9) |
| 132 | PDIRECT3DVERTEXSHADER9 = ObjPointer(IDirect3DVertexShader9) |
| 133 | PDIRECT3DPIXELSHADER9 = ObjPointer(IDirect3DPixelShader9) |
| 134 | PDIRECT3DBASETEXTURE9 = ObjPointer(IDirect3DBaseTexture9) |
| 135 | PDIRECT3DTEXTURE9 = ObjPointer(IDirect3DTexture9) |
| 136 | PDIRECT3DVOLUMETEXTURE9 = ObjPointer(IDirect3DVolumeTexture9) |
| 137 | PDIRECT3DCUBETEXTURE9 = ObjPointer(IDirect3DCubeTexture9) |
| 138 | PDIRECT3DVERTEXBUFFER9 = ObjPointer(IDirect3DVertexBuffer9) |
| 139 | PDIRECT3DINDEXBUFFER9 = ObjPointer(IDirect3DIndexBuffer9) |
| 140 | PDIRECT3DSURFACE9 = ObjPointer(IDirect3DSurface9) |
| 141 | PDIRECT3DVOLUME9 = ObjPointer(IDirect3DVolume9) |
| 142 | PDIRECT3DQUERY9 = ObjPointer(IDirect3DQuery9) |
| 143 | PDIRECT3D9EX = ObjPointer(IDirect3D9Ex) |
| 144 | PDIRECT3DDEVICE9EX = ObjPointer(IDirect3DDevice9Ex) |
| 145 | PDIRECT3DSWAPCHAIN9EX = ObjPointer(IDirect3DSwapChain9Ex) |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 146 | |
| 147 | IDirect3D9.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 148 | StdMethod(HRESULT, "RegisterSoftwareDevice", [(OpaquePointer(Void), "pInitializeFunction")], sideeffects=False), |
| 149 | StdMethod(UINT, "GetAdapterCount", [], sideeffects=False), |
| 150 | StdMethod(HRESULT, "GetAdapterIdentifier", [(D3DADAPTER, "Adapter"), (D3DENUM, "Flags"), Out(Pointer(D3DADAPTER_IDENTIFIER9), "pIdentifier")], sideeffects=False), |
| 151 | StdMethod(UINT, "GetAdapterModeCount", [(D3DADAPTER, "Adapter"), (D3DFORMAT, "Format")], sideeffects=False), |
| 152 | StdMethod(HRESULT, "EnumAdapterModes", [(D3DADAPTER, "Adapter"), (D3DFORMAT, "Format"), (UINT, "Mode"), Out(Pointer(D3DDISPLAYMODE), "pMode")], sideeffects=False), |
| 153 | StdMethod(HRESULT, "GetAdapterDisplayMode", [(D3DADAPTER, "Adapter"), Out(Pointer(D3DDISPLAYMODE), "pMode")], sideeffects=False), |
| 154 | StdMethod(HRESULT, "CheckDeviceType", [(D3DADAPTER, "Adapter"), (D3DDEVTYPE, "DevType"), (D3DFORMAT, "AdapterFormat"), (D3DFORMAT, "BackBufferFormat"), (BOOL, "bWindowed")], sideeffects=False), |
| 155 | StdMethod(HRESULT, "CheckDeviceFormat", [(D3DADAPTER, "Adapter"), (D3DDEVTYPE, "DeviceType"), (D3DFORMAT, "AdapterFormat"), (D3DUSAGE, "Usage"), (D3DRESOURCETYPE, "RType"), (D3DFORMAT, "CheckFormat")], sideeffects=False), |
| 156 | StdMethod(HRESULT, "CheckDeviceMultiSampleType", [(D3DADAPTER, "Adapter"), (D3DDEVTYPE, "DeviceType"), (D3DFORMAT, "SurfaceFormat"), (BOOL, "Windowed"), (D3DMULTISAMPLE_TYPE, "MultiSampleType"), Out(Pointer(DWORD), "pQualityLevels")], sideeffects=False), |
| 157 | StdMethod(HRESULT, "CheckDepthStencilMatch", [(D3DADAPTER, "Adapter"), (D3DDEVTYPE, "DeviceType"), (D3DFORMAT, "AdapterFormat"), (D3DFORMAT, "RenderTargetFormat"), (D3DFORMAT, "DepthStencilFormat")], sideeffects=False), |
| 158 | StdMethod(HRESULT, "CheckDeviceFormatConversion", [(D3DADAPTER, "Adapter"), (D3DDEVTYPE, "DeviceType"), (D3DFORMAT, "SourceFormat"), (D3DFORMAT, "TargetFormat")], sideeffects=False), |
| 159 | StdMethod(HRESULT, "GetDeviceCaps", [(D3DADAPTER, "Adapter"), (D3DDEVTYPE, "DeviceType"), Out(Pointer(D3DCAPS9), "pCaps")], sideeffects=False), |
| 160 | StdMethod(HMONITOR, "GetAdapterMonitor", [(D3DADAPTER, "Adapter")], sideeffects=False), |
| 161 | StdMethod(HRESULT, "CreateDevice", [(D3DADAPTER, "Adapter"), (D3DDEVTYPE, "DeviceType"), (HWND, "hFocusWindow"), (D3DCREATE, "BehaviorFlags"), InOut(Pointer(D3DPRESENT_PARAMETERS), "pPresentationParameters"), Out(Pointer(PDIRECT3DDEVICE9), "ppReturnedDeviceInterface")]), |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 162 | ] |
| 163 | |
| 164 | IDirect3DDevice9.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 165 | StdMethod(HRESULT, "TestCooperativeLevel", []), |
| 166 | StdMethod(UINT, "GetAvailableTextureMem", [], sideeffects=False), |
| 167 | StdMethod(HRESULT, "EvictManagedResources", []), |
| 168 | StdMethod(HRESULT, "GetDirect3D", [Out(Pointer(PDIRECT3D9), "ppD3D9")]), |
| 169 | StdMethod(HRESULT, "GetDeviceCaps", [Out(Pointer(D3DCAPS9), "pCaps")], sideeffects=False), |
| 170 | StdMethod(HRESULT, "GetDisplayMode", [(UINT, "iSwapChain"), Out(Pointer(D3DDISPLAYMODE), "pMode")], sideeffects=False), |
| 171 | StdMethod(HRESULT, "GetCreationParameters", [Out(Pointer(D3DDEVICE_CREATION_PARAMETERS), "pParameters")], sideeffects=False), |
| 172 | StdMethod(HRESULT, "SetCursorProperties", [(UINT, "XHotSpot"), (UINT, "YHotSpot"), (PDIRECT3DSURFACE9, "pCursorBitmap")]), |
| 173 | StdMethod(Void, "SetCursorPosition", [(Int, "X"), (Int, "Y"), (D3DCURSOR, "Flags")]), |
| 174 | StdMethod(BOOL, "ShowCursor", [(BOOL, "bShow")]), |
| 175 | StdMethod(HRESULT, "CreateAdditionalSwapChain", [InOut(Pointer(D3DPRESENT_PARAMETERS), "pPresentationParameters"), Out(Pointer(PDIRECT3DSWAPCHAIN9), "pSwapChain")]), |
| 176 | StdMethod(HRESULT, "GetSwapChain", [(UINT, "iSwapChain"), Out(Pointer(PDIRECT3DSWAPCHAIN9), "pSwapChain")]), |
| 177 | StdMethod(UINT, "GetNumberOfSwapChains", [], sideeffects=False), |
| 178 | StdMethod(HRESULT, "Reset", [InOut(Pointer(D3DPRESENT_PARAMETERS), "pPresentationParameters")]), |
| 179 | StdMethod(HRESULT, "Present", [(ConstPointer(RECT), "pSourceRect"), (ConstPointer(RECT), "pDestRect"), (HWND, "hDestWindowOverride"), (ConstPointer(RGNDATA), "pDirtyRegion")]), |
| 180 | StdMethod(HRESULT, "GetBackBuffer", [(UINT, "iSwapChain"), (UINT, "iBackBuffer"), (D3DBACKBUFFER_TYPE, "Type"), Out(Pointer(PDIRECT3DSURFACE9), "ppBackBuffer")]), |
| 181 | StdMethod(HRESULT, "GetRasterStatus", [(UINT, "iSwapChain"), Out(Pointer(D3DRASTER_STATUS), "pRasterStatus")], sideeffects=False), |
| 182 | StdMethod(HRESULT, "SetDialogBoxMode", [(BOOL, "bEnableDialogs")]), |
| 183 | StdMethod(Void, "SetGammaRamp", [(UINT, "iSwapChain"), (D3DSGR, "Flags"), (ConstPointer(D3DGAMMARAMP), "pRamp")]), |
| 184 | StdMethod(Void, "GetGammaRamp", [(UINT, "iSwapChain"), Out(Pointer(D3DGAMMARAMP), "pRamp")], sideeffects=False), |
Jose Fonseca | 614c5da | 2016-02-19 12:32:45 +0000 | [diff] [blame] | 185 | StdMethod(HRESULT, "CreateTexture", [(UINT, "Width"), (UINT, "Height"), (UINT, "Levels"), (D3DUSAGE, "Usage"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), Out(Pointer(PDIRECT3DTEXTURE9), "ppTexture"), InOut(Pointer(SHARED_HANDLE_SYSMEM), "pSharedHandle")]), |
| 186 | StdMethod(HRESULT, "CreateVolumeTexture", [(UINT, "Width"), (UINT, "Height"), (UINT, "Depth"), (UINT, "Levels"), (D3DUSAGE, "Usage"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), Out(Pointer(PDIRECT3DVOLUMETEXTURE9), "ppVolumeTexture"), InOut(Pointer(SHARED_HANDLE), "pSharedHandle")]), |
| 187 | StdMethod(HRESULT, "CreateCubeTexture", [(UINT, "EdgeLength"), (UINT, "Levels"), (D3DUSAGE, "Usage"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), Out(Pointer(PDIRECT3DCUBETEXTURE9), "ppCubeTexture"), InOut(Pointer(SHARED_HANDLE), "pSharedHandle")]), |
| 188 | StdMethod(HRESULT, "CreateVertexBuffer", [(UINT, "Length"), (D3DUSAGE, "Usage"), (D3DFVF, "FVF"), (D3DPOOL, "Pool"), Out(Pointer(PDIRECT3DVERTEXBUFFER9), "ppVertexBuffer"), InOut(Pointer(SHARED_HANDLE), "pSharedHandle")]), |
| 189 | StdMethod(HRESULT, "CreateIndexBuffer", [(UINT, "Length"), (D3DUSAGE, "Usage"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), Out(Pointer(PDIRECT3DINDEXBUFFER9), "ppIndexBuffer"), InOut(Pointer(SHARED_HANDLE), "pSharedHandle")]), |
| 190 | StdMethod(HRESULT, "CreateRenderTarget", [(UINT, "Width"), (UINT, "Height"), (D3DFORMAT, "Format"), (D3DMULTISAMPLE_TYPE, "MultiSample"), (DWORD, "MultisampleQuality"), (BOOL, "Lockable"), Out(Pointer(PDIRECT3DSURFACE9), "ppSurface"), InOut(Pointer(SHARED_HANDLE), "pSharedHandle")]), |
| 191 | StdMethod(HRESULT, "CreateDepthStencilSurface", [(UINT, "Width"), (UINT, "Height"), (D3DFORMAT, "Format"), (D3DMULTISAMPLE_TYPE, "MultiSample"), (DWORD, "MultisampleQuality"), (BOOL, "Discard"), Out(Pointer(PDIRECT3DSURFACE9), "ppSurface"), InOut(Pointer(SHARED_HANDLE), "pSharedHandle")]), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 192 | StdMethod(HRESULT, "UpdateSurface", [(PDIRECT3DSURFACE9, "pSourceSurface"), (ConstPointer(RECT), "pSourceRect"), (PDIRECT3DSURFACE9, "pDestinationSurface"), (ConstPointer(POINT), "pDestPoint")]), |
| 193 | StdMethod(HRESULT, "UpdateTexture", [(PDIRECT3DBASETEXTURE9, "pSourceTexture"), (PDIRECT3DBASETEXTURE9, "pDestinationTexture")]), |
José Fonseca | 221bcae | 2014-01-10 18:33:23 +0000 | [diff] [blame] | 194 | StdMethod(HRESULT, "GetRenderTargetData", [(PDIRECT3DSURFACE9, "pRenderTarget"), (PDIRECT3DSURFACE9, "pDestSurface")]), |
| 195 | StdMethod(HRESULT, "GetFrontBufferData", [(UINT, "iSwapChain"), (PDIRECT3DSURFACE9, "pDestSurface")]), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 196 | StdMethod(HRESULT, "StretchRect", [(PDIRECT3DSURFACE9, "pSourceSurface"), (ConstPointer(RECT), "pSourceRect"), (PDIRECT3DSURFACE9, "pDestSurface"), (ConstPointer(RECT), "pDestRect"), (D3DTEXTUREFILTERTYPE, "Filter")]), |
| 197 | StdMethod(HRESULT, "ColorFill", [(PDIRECT3DSURFACE9, "pSurface"), (ConstPointer(RECT), "pRect"), (D3DCOLOR, "color")]), |
Jose Fonseca | 614c5da | 2016-02-19 12:32:45 +0000 | [diff] [blame] | 198 | StdMethod(HRESULT, "CreateOffscreenPlainSurface", [(UINT, "Width"), (UINT, "Height"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), Out(Pointer(PDIRECT3DSURFACE9), "ppSurface"), InOut(Pointer(SHARED_HANDLE), "pSharedHandle")]), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 199 | StdMethod(HRESULT, "SetRenderTarget", [(DWORD, "RenderTargetIndex"), (PDIRECT3DSURFACE9, "pRenderTarget")]), |
| 200 | StdMethod(HRESULT, "GetRenderTarget", [(DWORD, "RenderTargetIndex"), Out(Pointer(PDIRECT3DSURFACE9), "ppRenderTarget")]), |
| 201 | StdMethod(HRESULT, "SetDepthStencilSurface", [(PDIRECT3DSURFACE9, "pNewZStencil")]), |
| 202 | StdMethod(HRESULT, "GetDepthStencilSurface", [Out(Pointer(PDIRECT3DSURFACE9), "ppZStencilSurface")]), |
| 203 | StdMethod(HRESULT, "BeginScene", []), |
| 204 | StdMethod(HRESULT, "EndScene", []), |
Jose Fonseca | 4ccc877 | 2015-05-20 17:18:31 +0100 | [diff] [blame] | 205 | StdMethod(HRESULT, "Clear", [(DWORD, "Count"), (Array(Const(D3DRECT), "Count"), "pRects"), (D3DCLEAR, "Flags"), (D3DCOLOR, "Color"), (Float, "Z"), (DWORD, "Stencil")]), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 206 | StdMethod(HRESULT, "SetTransform", [(D3DTRANSFORMSTATETYPE, "State"), (ConstPointer(D3DMATRIX), "pMatrix")]), |
| 207 | StdMethod(HRESULT, "GetTransform", [(D3DTRANSFORMSTATETYPE, "State"), Out(Pointer(D3DMATRIX), "pMatrix")], sideeffects=False), |
| 208 | StdMethod(HRESULT, "MultiplyTransform", [(D3DTRANSFORMSTATETYPE, "State"), (ConstPointer(D3DMATRIX), "pMatrix")]), |
| 209 | StdMethod(HRESULT, "SetViewport", [(ConstPointer(D3DVIEWPORT9), "pViewport")]), |
| 210 | StdMethod(HRESULT, "GetViewport", [Out(Pointer(D3DVIEWPORT9), "pViewport")], sideeffects=False), |
| 211 | StdMethod(HRESULT, "SetMaterial", [(ConstPointer(D3DMATERIAL9), "pMaterial")]), |
| 212 | StdMethod(HRESULT, "GetMaterial", [Out(Pointer(D3DMATERIAL9), "pMaterial")], sideeffects=False), |
| 213 | StdMethod(HRESULT, "SetLight", [(DWORD, "Index"), (ConstPointer(D3DLIGHT9), "pLight")]), |
| 214 | StdMethod(HRESULT, "GetLight", [(DWORD, "Index"), Out(Pointer(D3DLIGHT9), "pLight")], sideeffects=False), |
| 215 | StdMethod(HRESULT, "LightEnable", [(DWORD, "Index"), (BOOL, "Enable")]), |
| 216 | StdMethod(HRESULT, "GetLightEnable", [(DWORD, "Index"), Out(Pointer(BOOL), "pEnable")], sideeffects=False), |
Jose Fonseca | cf51935 | 2015-05-20 17:17:32 +0100 | [diff] [blame] | 217 | StdMethod(HRESULT, "SetClipPlane", [(DWORD, "Index"), (Array(Const(Float), 4), "pPlane")]), |
| 218 | StdMethod(HRESULT, "GetClipPlane", [(DWORD, "Index"), Out(Array(Float, 4), "pPlane")], sideeffects=False), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 219 | StdMethod(HRESULT, "SetRenderState", [(D3DRENDERSTATETYPE, "State"), (D3DRENDERSTATEVALUE, "Value")]), |
| 220 | StdMethod(HRESULT, "GetRenderState", [(D3DRENDERSTATETYPE, "State"), Out(Pointer(D3DRENDERSTATEVALUE), "pValue")], sideeffects=False), |
| 221 | StdMethod(HRESULT, "CreateStateBlock", [(D3DSTATEBLOCKTYPE, "Type"), Out(Pointer(PDIRECT3DSTATEBLOCK9), "ppSB")]), |
| 222 | StdMethod(HRESULT, "BeginStateBlock", []), |
| 223 | StdMethod(HRESULT, "EndStateBlock", [Out(Pointer(PDIRECT3DSTATEBLOCK9), "ppSB")]), |
| 224 | StdMethod(HRESULT, "SetClipStatus", [(ConstPointer(D3DCLIPSTATUS9), "pClipStatus")]), |
| 225 | StdMethod(HRESULT, "GetClipStatus", [Out(Pointer(D3DCLIPSTATUS9), "pClipStatus")], sideeffects=False), |
| 226 | StdMethod(HRESULT, "GetTexture", [(DWORD, "Stage"), Out(Pointer(PDIRECT3DBASETEXTURE9), "ppTexture")]), |
| 227 | StdMethod(HRESULT, "SetTexture", [(DWORD, "Stage"), (PDIRECT3DBASETEXTURE9, "pTexture")]), |
| 228 | StdMethod(HRESULT, "GetTextureStageState", [(DWORD, "Stage"), (D3DTEXTURESTAGESTATETYPE, "Type"), Out(Pointer(D3DTEXTURESTAGESTATEVALUE), "pValue")], sideeffects=False), |
| 229 | StdMethod(HRESULT, "SetTextureStageState", [(DWORD, "Stage"), (D3DTEXTURESTAGESTATETYPE, "Type"), (D3DTEXTURESTAGESTATEVALUE, "Value")]), |
| 230 | StdMethod(HRESULT, "GetSamplerState", [(DWORD, "Sampler"), (D3DSAMPLERSTATETYPE, "Type"), Out(Pointer(D3DSAMPLERSTATEVALUE), "pValue")], sideeffects=False), |
| 231 | StdMethod(HRESULT, "SetSamplerState", [(DWORD, "Sampler"), (D3DSAMPLERSTATETYPE, "Type"), (D3DSAMPLERSTATEVALUE, "Value")]), |
| 232 | StdMethod(HRESULT, "ValidateDevice", [Out(Pointer(DWORD), "pNumPasses")]), |
Jose Fonseca | deb1d68 | 2015-05-20 17:19:18 +0100 | [diff] [blame] | 233 | StdMethod(HRESULT, "SetPaletteEntries", [(UINT, "PaletteNumber"), (Array(Const(PALETTEENTRY), 256), "pEntries")]), |
| 234 | StdMethod(HRESULT, "GetPaletteEntries", [(UINT, "PaletteNumber"), Out(Array(PALETTEENTRY, 256), "pEntries")], sideeffects=False), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 235 | StdMethod(HRESULT, "SetCurrentTexturePalette", [(UINT, "PaletteNumber")]), |
| 236 | StdMethod(HRESULT, "GetCurrentTexturePalette", [Out(Pointer(UINT), "PaletteNumber")], sideeffects=False), |
| 237 | StdMethod(HRESULT, "SetScissorRect", [(ConstPointer(RECT), "pRect")]), |
| 238 | StdMethod(HRESULT, "GetScissorRect", [Out(Pointer(RECT), "pRect")]), |
| 239 | StdMethod(HRESULT, "SetSoftwareVertexProcessing", [(BOOL, "bSoftware")]), |
| 240 | StdMethod(BOOL, "GetSoftwareVertexProcessing", [], sideeffects=False), |
| 241 | StdMethod(HRESULT, "SetNPatchMode", [(Float, "nSegments")]), |
| 242 | StdMethod(Float, "GetNPatchMode", [], sideeffects=False), |
| 243 | StdMethod(HRESULT, "DrawPrimitive", [(D3DPRIMITIVETYPE, "PrimitiveType"), (UINT, "StartVertex"), (UINT, "PrimitiveCount")]), |
| 244 | StdMethod(HRESULT, "DrawIndexedPrimitive", [(D3DPRIMITIVETYPE, "PrimitiveType"), (INT, "BaseVertexIndex"), (UINT, "MinVertexIndex"), (UINT, "NumVertices"), (UINT, "startIndex"), (UINT, "primCount")]), |
| 245 | StdMethod(HRESULT, "DrawPrimitiveUP", [(D3DPRIMITIVETYPE, "PrimitiveType"), (UINT, "PrimitiveCount"), (Blob(Const(Void), "_vertexDataSize(PrimitiveType, PrimitiveCount, VertexStreamZeroStride)"), "pVertexStreamZeroData"), (UINT, "VertexStreamZeroStride")]), |
Jose Fonseca | b167941 | 2017-08-28 19:52:57 +0100 | [diff] [blame] | 246 | StdMethod(HRESULT, "DrawIndexedPrimitiveUP", [(D3DPRIMITIVETYPE, "PrimitiveType"), (UINT, "MinVertexIndex"), (UINT, "NumVertices"), (UINT, "PrimitiveCount"), (Blob(Const(Void), "_indexDataSize(PrimitiveType, PrimitiveCount, IndexDataFormat)"), "pIndexData"), (D3DFORMAT, "IndexDataFormat"), (Blob(Const(Void), "(MinVertexIndex + NumVertices)*VertexStreamZeroStride"), "pVertexStreamZeroData"), (UINT, "VertexStreamZeroStride")]), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 247 | StdMethod(HRESULT, "ProcessVertices", [(UINT, "SrcStartIndex"), (UINT, "DestIndex"), (UINT, "VertexCount"), (PDIRECT3DVERTEXBUFFER9, "pDestBuffer"), (PDIRECT3DVERTEXDECLARATION9, "pVertexDecl"), (D3DPV, "Flags")]), |
| 248 | StdMethod(HRESULT, "CreateVertexDeclaration", [(Array(Const(D3DVERTEXELEMENT9), "_declCount(pVertexElements)"), "pVertexElements"), Out(Pointer(PDIRECT3DVERTEXDECLARATION9), "ppDecl")]), |
| 249 | StdMethod(HRESULT, "SetVertexDeclaration", [(PDIRECT3DVERTEXDECLARATION9, "pDecl")]), |
| 250 | StdMethod(HRESULT, "GetVertexDeclaration", [Out(Pointer(PDIRECT3DVERTEXDECLARATION9), "ppDecl")]), |
| 251 | StdMethod(HRESULT, "SetFVF", [(D3DFVF, "FVF")]), |
| 252 | StdMethod(HRESULT, "GetFVF", [Out(Pointer(D3DFVF), "pFVF")], sideeffects=False), |
| 253 | StdMethod(HRESULT, "CreateVertexShader", [(D3DSHADER9, "pFunction"), Out(Pointer(PDIRECT3DVERTEXSHADER9), "ppShader")]), |
| 254 | StdMethod(HRESULT, "SetVertexShader", [(PDIRECT3DVERTEXSHADER9, "pShader")]), |
| 255 | StdMethod(HRESULT, "GetVertexShader", [Out(Pointer(PDIRECT3DVERTEXSHADER9), "ppShader")]), |
| 256 | StdMethod(HRESULT, "SetVertexShaderConstantF", [(UINT, "StartRegister"), (Array(Const(Float), "4*Vector4fCount"), "pConstantData"), (UINT, "Vector4fCount")]), |
| 257 | StdMethod(HRESULT, "GetVertexShaderConstantF", [(UINT, "StartRegister"), Out(Array(Float, "4*Vector4fCount"), "pConstantData"), (UINT, "Vector4fCount")], sideeffects=False), |
| 258 | StdMethod(HRESULT, "SetVertexShaderConstantI", [(UINT, "StartRegister"), (Array(Const(Int), "4*Vector4iCount"), "pConstantData"), (UINT, "Vector4iCount")]), |
| 259 | StdMethod(HRESULT, "GetVertexShaderConstantI", [(UINT, "StartRegister"), Out(Array(Int, "4*Vector4iCount"), "pConstantData"), (UINT, "Vector4iCount")], sideeffects=False), |
| 260 | StdMethod(HRESULT, "SetVertexShaderConstantB", [(UINT, "StartRegister"), (Array(Const(BOOL), "BoolCount"), "pConstantData"), (UINT, "BoolCount")]), |
| 261 | StdMethod(HRESULT, "GetVertexShaderConstantB", [(UINT, "StartRegister"), Out(Array(BOOL, "BoolCount"), "pConstantData"), (UINT, "BoolCount")], sideeffects=False), |
| 262 | StdMethod(HRESULT, "SetStreamSource", [(UINT, "StreamNumber"), (PDIRECT3DVERTEXBUFFER9, "pStreamData"), (UINT, "OffsetInBytes"), (UINT, "Stride")]), |
| 263 | StdMethod(HRESULT, "GetStreamSource", [(UINT, "StreamNumber"), Out(Pointer(PDIRECT3DVERTEXBUFFER9), "ppStreamData"), Out(Pointer(UINT), "pOffsetInBytes"), Out(Pointer(UINT), "pStride")]), |
| 264 | StdMethod(HRESULT, "SetStreamSourceFreq", [(UINT, "StreamNumber"), (UINT, "Setting")]), |
| 265 | StdMethod(HRESULT, "GetStreamSourceFreq", [(UINT, "StreamNumber"), Out(Pointer(UINT), "pSetting")], sideeffects=False), |
| 266 | StdMethod(HRESULT, "SetIndices", [(PDIRECT3DINDEXBUFFER9, "pIndexData")]), |
| 267 | StdMethod(HRESULT, "GetIndices", [Out(Pointer(PDIRECT3DINDEXBUFFER9), "ppIndexData")]), |
| 268 | StdMethod(HRESULT, "CreatePixelShader", [(D3DSHADER9, "pFunction"), Out(Pointer(PDIRECT3DPIXELSHADER9), "ppShader")]), |
| 269 | StdMethod(HRESULT, "SetPixelShader", [(PDIRECT3DPIXELSHADER9, "pShader")]), |
| 270 | StdMethod(HRESULT, "GetPixelShader", [Out(Pointer(PDIRECT3DPIXELSHADER9), "ppShader")]), |
| 271 | StdMethod(HRESULT, "SetPixelShaderConstantF", [(UINT, "StartRegister"), (Array(Const(Float), "4*Vector4fCount"), "pConstantData"), (UINT, "Vector4fCount")]), |
| 272 | StdMethod(HRESULT, "GetPixelShaderConstantF", [(UINT, "StartRegister"), Out(Array(Float, "4*Vector4fCount"), "pConstantData"), (UINT, "Vector4fCount")], sideeffects=False), |
| 273 | StdMethod(HRESULT, "SetPixelShaderConstantI", [(UINT, "StartRegister"), (Array(Const(Int), "4*Vector4iCount"), "pConstantData"), (UINT, "Vector4iCount")]), |
| 274 | StdMethod(HRESULT, "GetPixelShaderConstantI", [(UINT, "StartRegister"), Out(Array(Int, "4*Vector4iCount"), "pConstantData"), (UINT, "Vector4iCount")], sideeffects=False), |
| 275 | StdMethod(HRESULT, "SetPixelShaderConstantB", [(UINT, "StartRegister"), (Array(Const(BOOL), "BoolCount"), "pConstantData"), (UINT, "BoolCount")]), |
| 276 | StdMethod(HRESULT, "GetPixelShaderConstantB", [(UINT, "StartRegister"), Out(Array(BOOL, "BoolCount"), "pConstantData"), (UINT, "BoolCount")], sideeffects=False), |
| 277 | StdMethod(HRESULT, "DrawRectPatch", [(UINT, "Handle"), (ConstPointer(Float), "pNumSegs"), (ConstPointer(D3DRECTPATCH_INFO), "pRectPatchInfo")]), |
| 278 | StdMethod(HRESULT, "DrawTriPatch", [(UINT, "Handle"), (ConstPointer(Float), "pNumSegs"), (ConstPointer(D3DTRIPATCH_INFO), "pTriPatchInfo")]), |
| 279 | StdMethod(HRESULT, "DeletePatch", [(UINT, "Handle")]), |
| 280 | StdMethod(HRESULT, "CreateQuery", [(D3DQUERYTYPE, "Type"), Out(Pointer(PDIRECT3DQUERY9), "ppQuery")]), |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 281 | ] |
| 282 | |
| 283 | IDirect3DStateBlock9.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 284 | StdMethod(HRESULT, "GetDevice", [Out(Pointer(PDIRECT3DDEVICE9), "ppDevice")]), |
| 285 | StdMethod(HRESULT, "Capture", []), |
| 286 | StdMethod(HRESULT, "Apply", []), |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 287 | ] |
| 288 | |
| 289 | IDirect3DSwapChain9.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 290 | StdMethod(HRESULT, "Present", [(ConstPointer(RECT), "pSourceRect"), (ConstPointer(RECT), "pDestRect"), (HWND, "hDestWindowOverride"), (ConstPointer(RGNDATA), "pDirtyRegion"), (D3DPRESENT, "dwFlags")]), |
José Fonseca | 221bcae | 2014-01-10 18:33:23 +0000 | [diff] [blame] | 291 | StdMethod(HRESULT, "GetFrontBufferData", [(PDIRECT3DSURFACE9, "pDestSurface")]), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 292 | StdMethod(HRESULT, "GetBackBuffer", [(UINT, "iBackBuffer"), (D3DBACKBUFFER_TYPE, "Type"), Out(Pointer(PDIRECT3DSURFACE9), "ppBackBuffer")]), |
| 293 | StdMethod(HRESULT, "GetRasterStatus", [Out(Pointer(D3DRASTER_STATUS), "pRasterStatus")], sideeffects=False), |
| 294 | StdMethod(HRESULT, "GetDisplayMode", [Out(Pointer(D3DDISPLAYMODE), "pMode")], sideeffects=False), |
| 295 | StdMethod(HRESULT, "GetDevice", [Out(Pointer(PDIRECT3DDEVICE9), "ppDevice")]), |
| 296 | StdMethod(HRESULT, "GetPresentParameters", [Out(Pointer(D3DPRESENT_PARAMETERS), "pPresentationParameters")], sideeffects=False), |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 297 | ] |
| 298 | |
| 299 | IDirect3DResource9.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 300 | StdMethod(HRESULT, "GetDevice", [Out(Pointer(PDIRECT3DDEVICE9), "ppDevice")]), |
| 301 | StdMethod(HRESULT, "SetPrivateData", [(REFGUID, "refguid"), (OpaqueBlob(Const(Void), "SizeOfData"), "pData"), (DWORD, "SizeOfData"), (D3DSPD, "Flags")], sideeffects=False), |
José Fonseca | 9eec934 | 2014-10-03 22:24:50 +0100 | [diff] [blame] | 302 | StdMethod(HRESULT, "GetPrivateData", [(REFGUID, "refguid"), Out(OpaqueBlob(Void, "*pSizeOfData"), "pData"), InOut(Pointer(DWORD), "pSizeOfData")], sideeffects=False), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 303 | StdMethod(HRESULT, "FreePrivateData", [(REFGUID, "refguid")], sideeffects=False), |
| 304 | StdMethod(D3D9_RESOURCE_PRIORITY, "SetPriority", [(D3D9_RESOURCE_PRIORITY, "PriorityNew")]), |
| 305 | StdMethod(D3D9_RESOURCE_PRIORITY, "GetPriority", [], sideeffects=False), |
| 306 | StdMethod(Void, "PreLoad", []), |
| 307 | StdMethod(D3DRESOURCETYPE, "GetType", [], sideeffects=False), |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 308 | ] |
| 309 | |
| 310 | IDirect3DVertexDeclaration9.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 311 | StdMethod(HRESULT, "GetDevice", [Out(Pointer(PDIRECT3DDEVICE9), "ppDevice")]), |
José Fonseca | 9eec934 | 2014-10-03 22:24:50 +0100 | [diff] [blame] | 312 | StdMethod(HRESULT, "GetDeclaration", [Out(Array(D3DVERTEXELEMENT9, "*pNumElements"), "pElement"), InOut(Pointer(UINT), "pNumElements")], sideeffects=False), |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 313 | ] |
| 314 | |
| 315 | IDirect3DVertexShader9.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 316 | StdMethod(HRESULT, "GetDevice", [Out(Pointer(PDIRECT3DDEVICE9), "ppDevice")]), |
| 317 | StdMethod(HRESULT, "GetFunction", [Out(OpaqueBlob(Void, "*pSizeOfData"), "pData"), Out(Pointer(UINT), "pSizeOfData")], sideeffects=False), |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 318 | ] |
| 319 | |
| 320 | IDirect3DPixelShader9.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 321 | StdMethod(HRESULT, "GetDevice", [Out(Pointer(PDIRECT3DDEVICE9), "ppDevice")]), |
| 322 | StdMethod(HRESULT, "GetFunction", [Out(OpaqueBlob(Void, "*pSizeOfData"), "pData"), Out(Pointer(UINT), "pSizeOfData")], sideeffects=False), |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 323 | ] |
| 324 | |
| 325 | IDirect3DBaseTexture9.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 326 | StdMethod(DWORD, "SetLOD", [(DWORD, "LODNew")]), |
| 327 | StdMethod(DWORD, "GetLOD", [], sideeffects=False), |
| 328 | StdMethod(DWORD, "GetLevelCount", [], sideeffects=False), |
| 329 | StdMethod(HRESULT, "SetAutoGenFilterType", [(D3DTEXTUREFILTERTYPE, "FilterType")]), |
| 330 | StdMethod(D3DTEXTUREFILTERTYPE, "GetAutoGenFilterType", [], sideeffects=False), |
| 331 | StdMethod(Void, "GenerateMipSubLevels", []), |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 332 | ] |
| 333 | |
| 334 | IDirect3DTexture9.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 335 | StdMethod(HRESULT, "GetLevelDesc", [(UINT, "Level"), Out(Pointer(D3DSURFACE_DESC), "pDesc")], sideeffects=False), |
| 336 | StdMethod(HRESULT, "GetSurfaceLevel", [(UINT, "Level"), Out(Pointer(PDIRECT3DSURFACE9), "ppSurfaceLevel")]), |
| 337 | StdMethod(HRESULT, "LockRect", [(UINT, "Level"), Out(Pointer(D3DLOCKED_RECT), "pLockedRect"), (ConstPointer(RECT), "pRect"), (D3DLOCK, "Flags")]), |
| 338 | StdMethod(HRESULT, "UnlockRect", [(UINT, "Level")]), |
| 339 | StdMethod(HRESULT, "AddDirtyRect", [(ConstPointer(RECT), "pDirtyRect")]), |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 340 | ] |
| 341 | |
| 342 | IDirect3DVolumeTexture9.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 343 | StdMethod(HRESULT, "GetLevelDesc", [(UINT, "Level"), Out(Pointer(D3DVOLUME_DESC), "pDesc")], sideeffects=False), |
| 344 | StdMethod(HRESULT, "GetVolumeLevel", [(UINT, "Level"), Out(Pointer(PDIRECT3DVOLUME9), "ppVolumeLevel")]), |
| 345 | StdMethod(HRESULT, "LockBox", [(UINT, "Level"), Out(Pointer(D3DLOCKED_BOX), "pLockedVolume"), (ConstPointer(D3DBOX), "pBox"), (D3DLOCK, "Flags")]), |
| 346 | StdMethod(HRESULT, "UnlockBox", [(UINT, "Level")]), |
| 347 | StdMethod(HRESULT, "AddDirtyBox", [(ConstPointer(D3DBOX), "pDirtyBox")]), |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 348 | ] |
| 349 | |
| 350 | IDirect3DCubeTexture9.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 351 | StdMethod(HRESULT, "GetLevelDesc", [(UINT, "Level"), Out(Pointer(D3DSURFACE_DESC), "pDesc")], sideeffects=False), |
| 352 | StdMethod(HRESULT, "GetCubeMapSurface", [(D3DCUBEMAP_FACES, "FaceType"), (UINT, "Level"), Out(Pointer(PDIRECT3DSURFACE9), "ppCubeMapSurface")]), |
| 353 | StdMethod(HRESULT, "LockRect", [(D3DCUBEMAP_FACES, "FaceType"), (UINT, "Level"), Out(Pointer(D3DLOCKED_RECT), "pLockedRect"), (ConstPointer(RECT), "pRect"), (D3DLOCK, "Flags")]), |
| 354 | StdMethod(HRESULT, "UnlockRect", [(D3DCUBEMAP_FACES, "FaceType"), (UINT, "Level")]), |
| 355 | StdMethod(HRESULT, "AddDirtyRect", [(D3DCUBEMAP_FACES, "FaceType"), (ConstPointer(RECT), "pDirtyRect")]), |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 356 | ] |
| 357 | |
| 358 | IDirect3DVertexBuffer9.methods += [ |
José Fonseca | 2b4fc3f | 2012-11-11 00:39:53 +0000 | [diff] [blame] | 359 | StdMethod(HRESULT, "Lock", [(UINT, "OffsetToLock"), (UINT, "SizeToLock"), Out(Pointer(LinearPointer(Void, "_MappedSize")), "ppbData"), (D3DLOCK, "Flags")]), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 360 | StdMethod(HRESULT, "Unlock", []), |
| 361 | StdMethod(HRESULT, "GetDesc", [Out(Pointer(D3DVERTEXBUFFER_DESC), "pDesc")], sideeffects=False), |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 362 | ] |
| 363 | |
| 364 | IDirect3DIndexBuffer9.methods += [ |
José Fonseca | 2b4fc3f | 2012-11-11 00:39:53 +0000 | [diff] [blame] | 365 | StdMethod(HRESULT, "Lock", [(UINT, "OffsetToLock"), (UINT, "SizeToLock"), Out(Pointer(LinearPointer(Void, "_MappedSize")), "ppbData"), (D3DLOCK, "Flags")]), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 366 | StdMethod(HRESULT, "Unlock", []), |
| 367 | StdMethod(HRESULT, "GetDesc", [Out(Pointer(D3DINDEXBUFFER_DESC), "pDesc")], sideeffects=False), |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 368 | ] |
| 369 | |
| 370 | IDirect3DSurface9.methods += [ |
José Fonseca | cccdffb | 2012-11-18 09:21:48 +0000 | [diff] [blame] | 371 | StdMethod(HRESULT, "GetContainer", [(REFIID, "riid"), Out(Pointer(ObjPointer(Void)), "ppContainer")]), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 372 | StdMethod(HRESULT, "GetDesc", [Out(Pointer(D3DSURFACE_DESC), "pDesc")], sideeffects=False), |
| 373 | StdMethod(HRESULT, "LockRect", [Out(Pointer(D3DLOCKED_RECT), "pLockedRect"), (ConstPointer(RECT), "pRect"), (D3DLOCK, "Flags")]), |
| 374 | StdMethod(HRESULT, "UnlockRect", []), |
Jose Fonseca | 84eac25 | 2015-06-25 12:34:43 +0100 | [diff] [blame] | 375 | StdMethod(HRESULT, "GetDC", [Out(Pointer(HDC), "phdc")], sideeffects=False), |
| 376 | StdMethod(HRESULT, "ReleaseDC", [(HDC, "hdc")], sideeffects=False), |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 377 | ] |
| 378 | |
| 379 | IDirect3DVolume9.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 380 | StdMethod(HRESULT, "GetDevice", [Out(Pointer(PDIRECT3DDEVICE9), "ppDevice")]), |
| 381 | StdMethod(HRESULT, "SetPrivateData", [(REFGUID, "refguid"), (OpaqueBlob(Const(Void), "SizeOfData"), "pData"), (DWORD, "SizeOfData"), (D3DSPD, "Flags")], sideeffects=False), |
José Fonseca | 9eec934 | 2014-10-03 22:24:50 +0100 | [diff] [blame] | 382 | StdMethod(HRESULT, "GetPrivateData", [(REFGUID, "refguid"), Out(OpaqueBlob(Void, "*pSizeOfData"), "pData"), InOut(Pointer(DWORD), "pSizeOfData")], sideeffects=False), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 383 | StdMethod(HRESULT, "FreePrivateData", [(REFGUID, "refguid")], sideeffects=False), |
José Fonseca | cccdffb | 2012-11-18 09:21:48 +0000 | [diff] [blame] | 384 | StdMethod(HRESULT, "GetContainer", [(REFIID, "riid"), Out(Pointer(ObjPointer(Void)), "ppContainer")]), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 385 | StdMethod(HRESULT, "GetDesc", [Out(Pointer(D3DVOLUME_DESC), "pDesc")], sideeffects=False), |
| 386 | StdMethod(HRESULT, "LockBox", [Out(Pointer(D3DLOCKED_BOX), "pLockedVolume"), (ConstPointer(D3DBOX), "pBox"), (D3DLOCK, "Flags")]), |
| 387 | StdMethod(HRESULT, "UnlockBox", []), |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 388 | ] |
| 389 | |
| 390 | IDirect3DQuery9.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 391 | StdMethod(HRESULT, "GetDevice", [Out(Pointer(PDIRECT3DDEVICE9), "ppDevice")]), |
| 392 | StdMethod(D3DQUERYTYPE, "GetType", [], sideeffects=False), |
| 393 | StdMethod(DWORD, "GetDataSize", [], sideeffects=False), |
| 394 | StdMethod(HRESULT, "Issue", [(D3DISSUE, "dwIssueFlags")]), |
José Fonseca | 1b066c3 | 2014-01-09 17:00:00 +0000 | [diff] [blame] | 395 | StdMethod(HRESULT, "GetData", [Out(D3DQUERYDATA, "pData"), (DWORD, "dwSize"), (D3DGETDATA, "dwGetDataFlags")], sideeffects=False), |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 396 | ] |
| 397 | |
| 398 | IDirect3D9Ex.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 399 | StdMethod(UINT, "GetAdapterModeCountEx", [(D3DADAPTER, "Adapter"), (ConstPointer(D3DDISPLAYMODEFILTER), "pFilter") ], sideeffects=False), |
| 400 | StdMethod(HRESULT, "EnumAdapterModesEx", [(D3DADAPTER, "Adapter"), (ConstPointer(D3DDISPLAYMODEFILTER), "pFilter"), (UINT, "Mode"), Out(Pointer(D3DDISPLAYMODEEX), "pMode")], sideeffects=False), |
| 401 | StdMethod(HRESULT, "GetAdapterDisplayModeEx", [(D3DADAPTER, "Adapter"), Out(Pointer(D3DDISPLAYMODEEX), "pMode"), Out(Pointer(D3DDISPLAYROTATION), "pRotation")], sideeffects=False), |
| 402 | StdMethod(HRESULT, "CreateDeviceEx", [(D3DADAPTER, "Adapter"), (D3DDEVTYPE, "DeviceType"), (HWND, "hFocusWindow"), (D3DCREATE, "BehaviorFlags"), InOut(Pointer(D3DPRESENT_PARAMETERS), "pPresentationParameters"), Out(Pointer(D3DDISPLAYMODEEX), "pFullscreenDisplayMode"), Out(Pointer(PDIRECT3DDEVICE9EX), "ppReturnedDeviceInterface")]), |
| 403 | StdMethod(HRESULT, "GetAdapterLUID", [(D3DADAPTER, "Adapter"), Out(Pointer(LUID), "pLUID")], sideeffects=False), |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 404 | ] |
| 405 | |
| 406 | IDirect3DDevice9Ex.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 407 | StdMethod(HRESULT, "SetConvolutionMonoKernel", [(UINT, "width"), (UINT, "height"), (Array(Float, "width"), "rows"), (Array(Float, "height"), "columns")]), |
| 408 | StdMethod(HRESULT, "ComposeRects", [(PDIRECT3DSURFACE9, "pSrc"), (PDIRECT3DSURFACE9, "pDst"), (PDIRECT3DVERTEXBUFFER9, "pSrcRectDescs"), (UINT, "NumRects"), (PDIRECT3DVERTEXBUFFER9, "pDstRectDescs"), (D3DCOMPOSERECTSOP, "Operation"), (Int, "Xoffset"), (Int, "Yoffset")]), |
| 409 | StdMethod(HRESULT, "PresentEx", [(ConstPointer(RECT), "pSourceRect"), (ConstPointer(RECT), "pDestRect"), (HWND, "hDestWindowOverride"), (ConstPointer(RGNDATA), "pDirtyRegion"), (D3DPRESENT, "dwFlags")]), |
| 410 | StdMethod(HRESULT, "GetGPUThreadPriority", [Out(Pointer(INT), "pPriority")], sideeffects=False), |
| 411 | StdMethod(HRESULT, "SetGPUThreadPriority", [(INT, "Priority")]), |
| 412 | StdMethod(HRESULT, "WaitForVBlank", [(UINT, "iSwapChain")]), |
| 413 | StdMethod(HRESULT, "CheckResourceResidency", [(Array(PDIRECT3DRESOURCE9, "NumResources"), "pResourceArray"), (UINT32, "NumResources")]), |
| 414 | StdMethod(HRESULT, "SetMaximumFrameLatency", [(UINT, "MaxLatency")]), |
| 415 | StdMethod(HRESULT, "GetMaximumFrameLatency", [Out(Pointer(UINT), "pMaxLatency")], sideeffects=False), |
| 416 | StdMethod(HRESULT, "CheckDeviceState", [(HWND, "hDestinationWindow")], sideeffects=False), |
Jose Fonseca | 614c5da | 2016-02-19 12:32:45 +0000 | [diff] [blame] | 417 | StdMethod(HRESULT, "CreateRenderTargetEx", [(UINT, "Width"), (UINT, "Height"), (D3DFORMAT, "Format"), (D3DMULTISAMPLE_TYPE, "MultiSample"), (DWORD, "MultisampleQuality"), (BOOL, "Lockable"), Out(Pointer(PDIRECT3DSURFACE9), "ppSurface"), InOut(Pointer(SHARED_HANDLE), "pSharedHandle"), (D3DUSAGE, "Usage")]), |
| 418 | StdMethod(HRESULT, "CreateOffscreenPlainSurfaceEx", [(UINT, "Width"), (UINT, "Height"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), Out(Pointer(PDIRECT3DSURFACE9), "ppSurface"), InOut(Pointer(SHARED_HANDLE), "pSharedHandle"), (D3DUSAGE, "Usage")]), |
| 419 | StdMethod(HRESULT, "CreateDepthStencilSurfaceEx", [(UINT, "Width"), (UINT, "Height"), (D3DFORMAT, "Format"), (D3DMULTISAMPLE_TYPE, "MultiSample"), (DWORD, "MultisampleQuality"), (BOOL, "Discard"), Out(Pointer(PDIRECT3DSURFACE9), "ppSurface"), InOut(Pointer(SHARED_HANDLE), "pSharedHandle"), (D3DUSAGE, "Usage")]), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 420 | StdMethod(HRESULT, "ResetEx", [InOut(Pointer(D3DPRESENT_PARAMETERS), "pPresentationParameters"), Out(Pointer(D3DDISPLAYMODEEX), "pFullscreenDisplayMode")]), |
| 421 | StdMethod(HRESULT, "GetDisplayModeEx", [(UINT, "iSwapChain"), Out(Pointer(D3DDISPLAYMODEEX), "pMode"), Out(Pointer(D3DDISPLAYROTATION), "pRotation")], sideeffects=False), |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 422 | ] |
| 423 | |
| 424 | IDirect3DSwapChain9Ex.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 425 | StdMethod(HRESULT, "GetLastPresentCount", [Out(Pointer(UINT), "pLastPresentCount")], sideeffects=False), |
| 426 | StdMethod(HRESULT, "GetPresentStats", [Out(Pointer(D3DPRESENTSTATS), "pPresentationStatistics")], sideeffects=False), |
| 427 | StdMethod(HRESULT, "GetDisplayModeEx", [Out(Pointer(D3DDISPLAYMODEEX), "pMode"), Out(Pointer(D3DDISPLAYROTATION), "pRotation")], sideeffects=False), |
José Fonseca | 73f33cc | 2008-07-09 02:17:51 +0900 | [diff] [blame] | 428 | ] |
| 429 | |
José Fonseca | 8130193 | 2012-11-11 00:10:20 +0000 | [diff] [blame] | 430 | d3d9 = Module("d3d9") |
José Fonseca | 54f304a | 2012-01-14 19:33:08 +0000 | [diff] [blame] | 431 | d3d9.addFunctions([ |
José Fonseca | 90dd97e | 2010-11-23 21:35:55 +0000 | [diff] [blame] | 432 | StdFunction(PDIRECT3D9, "Direct3DCreate9", [(UINT, "SDKVersion")], fail='NULL'), |
| 433 | StdFunction(HRESULT, "Direct3DCreate9Ex", [(UINT, "SDKVersion"), Out(Pointer(PDIRECT3D9EX), "ppD3D")], fail='D3DERR_NOTAVAILABLE'), |
José Fonseca | e354d8d | 2015-02-06 10:30:01 +0000 | [diff] [blame] | 434 | ]) |
| 435 | d3d9.addInterfaces([ |
| 436 | IDirect3DSwapChain9Ex, |
| 437 | ]) |
| 438 | |
| 439 | # D3DPERF_* functions can also be used by D3D10 applications, so keep them in a |
| 440 | # separate module to be merged as necessary |
Jose Fonseca | d9092b3 | 2015-04-10 10:01:23 +0100 | [diff] [blame] | 441 | # See http://web.archive.org/web/20110510070258/http://msdn.microsoft.com/en-us/library/ee417071%28v=VS.85%29.aspx |
José Fonseca | e354d8d | 2015-02-06 10:30:01 +0000 | [diff] [blame] | 442 | d3dperf = Module("d3d9") |
| 443 | d3dperf.addFunctions([ |
José Fonseca | 1603732 | 2012-04-01 22:45:09 +0200 | [diff] [blame] | 444 | StdFunction(Int, "D3DPERF_BeginEvent", [(D3DCOLOR, "col"), (LPCWSTR, "wszName")], fail='-1', sideeffects=False), |
| 445 | StdFunction(Int, "D3DPERF_EndEvent", [], fail='-1', sideeffects=False), |
| 446 | StdFunction(Void, "D3DPERF_SetMarker", [(D3DCOLOR, "col"), (LPCWSTR, "wszName")], sideeffects=False), |
| 447 | StdFunction(Void, "D3DPERF_SetRegion", [(D3DCOLOR, "col"), (LPCWSTR, "wszName")], sideeffects=False), |
| 448 | StdFunction(BOOL, "D3DPERF_QueryRepeatFrame", [], fail='FALSE', sideeffects=False), |
| 449 | StdFunction(Void, "D3DPERF_SetOptions", [(DWORD, "dwOptions")], sideeffects=False), |
| 450 | StdFunction(DWORD, "D3DPERF_GetStatus", [], fail='0', sideeffects=False), |
José Fonseca | 87d1cc6 | 2010-11-29 15:57:25 +0000 | [diff] [blame] | 451 | ]) |