IDirect3DDevice9Ex = Interface("IDirect3DDevice9Ex", IDirect3DDevice9)
IDirect3DSwapChain9Ex = Interface("IDirect3DSwapChain9Ex", IDirect3DSwapChain9)
-PDIRECT3D9 = WrapPointer(IDirect3D9)
-PDIRECT3DDEVICE9 = WrapPointer(IDirect3DDevice9)
-PDIRECT3DSTATEBLOCK9 = WrapPointer(IDirect3DStateBlock9)
-PDIRECT3DSWAPCHAIN9 = WrapPointer(IDirect3DSwapChain9)
-PDIRECT3DRESOURCE9 = WrapPointer(IDirect3DResource9)
-PDIRECT3DVERTEXDECLARATION9 = WrapPointer(IDirect3DVertexDeclaration9)
-PDIRECT3DVERTEXSHADER9 = WrapPointer(IDirect3DVertexShader9)
-PDIRECT3DPIXELSHADER9 = WrapPointer(IDirect3DPixelShader9)
-PDIRECT3DBASETEXTURE9 = WrapPointer(IDirect3DBaseTexture9)
-PDIRECT3DTEXTURE9 = WrapPointer(IDirect3DTexture9)
-PDIRECT3DVOLUMETEXTURE9 = WrapPointer(IDirect3DVolumeTexture9)
-PDIRECT3DCUBETEXTURE9 = WrapPointer(IDirect3DCubeTexture9)
-PDIRECT3DVERTEXBUFFER9 = WrapPointer(IDirect3DVertexBuffer9)
-PDIRECT3DINDEXBUFFER9 = WrapPointer(IDirect3DIndexBuffer9)
-PDIRECT3DSURFACE9 = WrapPointer(IDirect3DSurface9)
-PDIRECT3DVOLUME9 = WrapPointer(IDirect3DVolume9)
-PDIRECT3DQUERY9 = WrapPointer(IDirect3DQuery9)
-PDIRECT3D9EX = WrapPointer(IDirect3D9Ex)
-PDIRECT3DDEVICE9EX = WrapPointer(IDirect3DDevice9Ex)
-PDIRECT3DSWAPCHAIN9EX = WrapPointer(IDirect3DSwapChain9Ex)
+PDIRECT3D9 = Pointer(IDirect3D9)
+PDIRECT3DDEVICE9 = Pointer(IDirect3DDevice9)
+PDIRECT3DSTATEBLOCK9 = Pointer(IDirect3DStateBlock9)
+PDIRECT3DSWAPCHAIN9 = Pointer(IDirect3DSwapChain9)
+PDIRECT3DRESOURCE9 = Pointer(IDirect3DResource9)
+PDIRECT3DVERTEXDECLARATION9 = Pointer(IDirect3DVertexDeclaration9)
+PDIRECT3DVERTEXSHADER9 = Pointer(IDirect3DVertexShader9)
+PDIRECT3DPIXELSHADER9 = Pointer(IDirect3DPixelShader9)
+PDIRECT3DBASETEXTURE9 = Pointer(IDirect3DBaseTexture9)
+PDIRECT3DTEXTURE9 = Pointer(IDirect3DTexture9)
+PDIRECT3DVOLUMETEXTURE9 = Pointer(IDirect3DVolumeTexture9)
+PDIRECT3DCUBETEXTURE9 = Pointer(IDirect3DCubeTexture9)
+PDIRECT3DVERTEXBUFFER9 = Pointer(IDirect3DVertexBuffer9)
+PDIRECT3DINDEXBUFFER9 = Pointer(IDirect3DIndexBuffer9)
+PDIRECT3DSURFACE9 = Pointer(IDirect3DSurface9)
+PDIRECT3DVOLUME9 = Pointer(IDirect3DVolume9)
+PDIRECT3DQUERY9 = Pointer(IDirect3DQuery9)
+PDIRECT3D9EX = Pointer(IDirect3D9Ex)
+PDIRECT3DDEVICE9EX = Pointer(IDirect3DDevice9Ex)
+PDIRECT3DSWAPCHAIN9EX = Pointer(IDirect3DSwapChain9Ex)
IDirect3D9.methods += [
Method(HRESULT, "RegisterSoftwareDevice", [(OpaquePointer(Void), "pInitializeFunction")]),
Method(HRESULT, "GetLightEnable", [(DWORD, "Index"), Out(Pointer(BOOL), "pEnable")]),
Method(HRESULT, "SetClipPlane", [(DWORD, "Index"), (ConstPointer(Float), "pPlane")]),
Method(HRESULT, "GetClipPlane", [(DWORD, "Index"), Out(Pointer(Float), "pPlane")]),
- Method(HRESULT, "SetRenderState", [(D3DRENDERSTATETYPE, "State"), (DWORD, "Value")]),
- Method(HRESULT, "GetRenderState", [(D3DRENDERSTATETYPE, "State"), Out(Pointer(DWORD), "pValue")]),
+ Method(HRESULT, "SetRenderState", [(D3DRENDERSTATETYPE, "State"), (D3DRENDERSTATEVALUE, "Value")]),
+ Method(HRESULT, "GetRenderState", [(D3DRENDERSTATETYPE, "State"), Out(Pointer(D3DRENDERSTATEVALUE), "pValue")]),
Method(HRESULT, "CreateStateBlock", [(D3DSTATEBLOCKTYPE, "Type"), Out(Pointer(PDIRECT3DSTATEBLOCK9), "ppSB")]),
Method(HRESULT, "BeginStateBlock", []),
Method(HRESULT, "EndStateBlock", [Out(Pointer(PDIRECT3DSTATEBLOCK9), "ppSB")]),
Method(HRESULT, "GetClipStatus", [Out(Pointer(D3DCLIPSTATUS9), "pClipStatus")]),
Method(HRESULT, "GetTexture", [(DWORD, "Stage"), Out(Pointer(PDIRECT3DBASETEXTURE9), "ppTexture")]),
Method(HRESULT, "SetTexture", [(DWORD, "Stage"), (PDIRECT3DBASETEXTURE9, "pTexture")]),
- Method(HRESULT, "GetTextureStageState", [(DWORD, "Stage"), (D3DTEXTURESTAGESTATETYPE, "Type"), Out(Pointer(DWORD), "pValue")]),
- Method(HRESULT, "SetTextureStageState", [(DWORD, "Stage"), (D3DTEXTURESTAGESTATETYPE, "Type"), (DWORD, "Value")]),
- Method(HRESULT, "GetSamplerState", [(DWORD, "Sampler"), (D3DSAMPLERSTATETYPE, "Type"), Out(Pointer(DWORD), "pValue")]),
- Method(HRESULT, "SetSamplerState", [(DWORD, "Sampler"), (D3DSAMPLERSTATETYPE, "Type"), (DWORD, "Value")]),
+ Method(HRESULT, "GetTextureStageState", [(DWORD, "Stage"), (D3DTEXTURESTAGESTATETYPE, "Type"), Out(Pointer(D3DTEXTURESTAGESTATEVALUE), "pValue")]),
+ Method(HRESULT, "SetTextureStageState", [(DWORD, "Stage"), (D3DTEXTURESTAGESTATETYPE, "Type"), (D3DTEXTURESTAGESTATEVALUE, "Value")]),
+ Method(HRESULT, "GetSamplerState", [(DWORD, "Sampler"), (D3DSAMPLERSTATETYPE, "Type"), Out(Pointer(D3DSAMPLERSTATEVALUE), "pValue")]),
+ Method(HRESULT, "SetSamplerState", [(DWORD, "Sampler"), (D3DSAMPLERSTATETYPE, "Type"), (D3DSAMPLERSTATEVALUE, "Value")]),
Method(HRESULT, "ValidateDevice", [Out(Pointer(DWORD), "pNumPasses")]),
Method(HRESULT, "SetPaletteEntries", [(UINT, "PaletteNumber"), (ConstPointer(PALETTEENTRY), "pEntries")]),
Method(HRESULT, "GetPaletteEntries", [(UINT, "PaletteNumber"), Out(Pointer(PALETTEENTRY), "pEntries")]),
Method(HRESULT, "DrawPrimitiveUP", [(D3DPRIMITIVETYPE, "PrimitiveType"), (UINT, "PrimitiveCount"), (OpaquePointer(Const(Void)), "pVertexStreamZeroData"), (UINT, "VertexStreamZeroStride")]),
Method(HRESULT, "DrawIndexedPrimitiveUP", [(D3DPRIMITIVETYPE, "PrimitiveType"), (UINT, "MinVertexIndex"), (UINT, "NumVertices"), (UINT, "PrimitiveCount"), (OpaquePointer(Const(Void)), "pIndexData"), (D3DFORMAT, "IndexDataFormat"), (OpaquePointer(Const(Void)), "pVertexStreamZeroData"), (UINT, "VertexStreamZeroStride")]),
Method(HRESULT, "ProcessVertices", [(UINT, "SrcStartIndex"), (UINT, "DestIndex"), (UINT, "VertexCount"), (PDIRECT3DVERTEXBUFFER9, "pDestBuffer"), (PDIRECT3DVERTEXDECLARATION9, "pVertexDecl"), (D3DPV, "Flags")]),
- Method(HRESULT, "CreateVertexDeclaration", [(ConstPointer(D3DVERTEXELEMENT9), "pVertexElements"), Out(Pointer(PDIRECT3DVERTEXDECLARATION9), "ppDecl")]),
+ Method(HRESULT, "CreateVertexDeclaration", [(Array(Const(D3DVERTEXELEMENT9), "_declCount(pVertexElements)"), "pVertexElements"), Out(Pointer(PDIRECT3DVERTEXDECLARATION9), "ppDecl")]),
Method(HRESULT, "SetVertexDeclaration", [(PDIRECT3DVERTEXDECLARATION9, "pDecl")]),
Method(HRESULT, "GetVertexDeclaration", [Out(Pointer(PDIRECT3DVERTEXDECLARATION9), "ppDecl")]),
Method(HRESULT, "SetFVF", [(D3DFVF, "FVF")]),
Method(D3DQUERYTYPE, "GetType", []),
Method(DWORD, "GetDataSize", []),
Method(HRESULT, "Issue", [(D3DISSUE, "dwIssueFlags")]),
- Method(HRESULT, "GetData", [Out(OpaquePointer(Void), "pData"), (DWORD, "dwSize"), (D3DGETDATA, "dwGetDataFlags")]),
+ Method(HRESULT, "GetData", [Out(Blob(Void, "dwSize"), "pData"), (DWORD, "dwSize"), (D3DGETDATA, "dwGetDataFlags")]),
]
IDirect3D9Ex.methods += [
]
d3d9 = API("d3d9")
-d3d9.add_functions([
+d3d9.addFunctions([
StdFunction(PDIRECT3D9, "Direct3DCreate9", [(UINT, "SDKVersion")], fail='NULL'),
StdFunction(HRESULT, "Direct3DCreate9Ex", [(UINT, "SDKVersion"), Out(Pointer(PDIRECT3D9EX), "ppD3D")], fail='D3DERR_NOTAVAILABLE'),
StdFunction(Int, "D3DPERF_BeginEvent", [(D3DCOLOR, "col"), (LPCWSTR, "wszName")], fail='-1'),