IDirect3DDevice9 Interface

 

 

' ****************************************************************************************
' IDirect3DDevice9 interface
' $IID_IDirect3DDevice9 = GUID$("{D0223B96-BF7A-43fd-92BD-A43B0D82B9EB}")
' ****************************************************************************************

' ****************************************************************************************
' Applications use the methods of the IDirect3DDevice9 interface to perform DrawPrimitive-based
' rendering, create resources, work with system-level variables, adjust gamma ramp levels, work
' with palettes, and create shaders.
' Remarks
' The IDirect3DDevice9 interface is obtained by calling the IDirect3D9::CreateDevice method.
' Interface Information
'    Stock Implementation   d3d9.dll
'    Custom Implementation  No
'    Inherits from  IUnknown
'    Header     d3d9.h
'    Import library     d3d9.lib
'    Minimum operating systems  Windows 98
' ****************************************************************************************

' ****************************************************************************************
'DECLARE_INTERFACE_(IDirect3DDevice9, IUnknown)
'{
'    /*** IUnknown methods ***/
'   0.  STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE;
'   1.  STDMETHOD_(ULONG,AddRef)(THIS) PURE;
'   2.  STDMETHOD_(ULONG,Release)(THIS) PURE;

'    /*** IDirect3DDevice9 methods ***/
'   3.  STDMETHOD(TestCooperativeLevel)(THIS) PURE;
'   4.  STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE;
'   5.  STDMETHOD(EvictManagedResources)(THIS) PURE;
'   6.  STDMETHOD(GetDirect3D)(THIS_ IDirect3D9** ppD3D9) PURE;
'   7.  STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS9* pCaps) PURE;
'   8.  STDMETHOD(GetDisplayMode)(THIS_ UINT iSwapChain,D3DDISPLAYMODE* pMode) PURE;
'   9.  STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters) PURE;
'  10.  STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot,UINT YHotSpot,IDirect3DSurface9* pCursorBitmap) PURE;
'  11.  STDMETHOD_(void, SetCursorPosition)(THIS_ int X,int Y,DWORD Flags) PURE;
'  12.  STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE;
'  13.  STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain9** pSwapChain) PURE;
'  14.  STDMETHOD(GetSwapChain)(THIS_ UINT iSwapChain,IDirect3DSwapChain9** pSwapChain) PURE;
'  15.  STDMETHOD_(UINT, GetNumberOfSwapChains)(THIS) PURE;
'  16.  STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE;
'  17.  STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) PURE;
'  18.  STDMETHOD(GetBackBuffer)(THIS_ UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) PURE;
'  19.  STDMETHOD(GetRasterStatus)(THIS_ UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus) PURE;
'  20.  STDMETHOD(SetDialogBoxMode)(THIS_ BOOL bEnableDialogs) PURE;
'  21.  STDMETHOD_(void, SetGammaRamp)(THIS_ UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp) PURE;
'  22.  STDMETHOD_(void, GetGammaRamp)(THIS_ UINT iSwapChain,D3DGAMMARAMP* pRamp) PURE;
'  23.  STDMETHOD(CreateTexture)(THIS_ UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,HANDLE* pSharedHandle) PURE;
'  24.  STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,HANDLE* pSharedHandle) PURE;
'  25.  STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,HANDLE* pSharedHandle) PURE;
'  26.  STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,HANDLE* pSharedHandle) PURE;
'  27.  STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,HANDLE* pSharedHandle) PURE;
'  28.  STDMETHOD(CreateRenderTarget)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE;
'  29.  STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE;
'  30.  STDMETHOD(UpdateSurface)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,CONST POINT* pDestPoint) PURE;
'  31.  STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture9* pSourceTexture,IDirect3DBaseTexture9* pDestinationTexture) PURE;
'  32.  STDMETHOD(GetRenderTargetData)(THIS_ IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface) PURE;
'  33.  STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain,IDirect3DSurface9* pDestSurface) PURE;
'  34.  STDMETHOD(StretchRect)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter) PURE;
'  35.  STDMETHOD(ColorFill)(THIS_ IDirect3DSurface9* pSurface,CONST RECT* pRect,D3DCOLOR color) PURE;
'  36.  STDMETHOD(CreateOffscreenPlainSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE;
'  37.  STDMETHOD(SetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9* pRenderTarget) PURE;
'  38.  STDMETHOD(GetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget) PURE;
'  39.  STDMETHOD(SetDepthStencilSurface)(THIS_ IDirect3DSurface9* pNewZStencil) PURE;
'  40.  STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface9** ppZStencilSurface) PURE;
'  41.  STDMETHOD(BeginScene)(THIS) PURE;
'  42.  STDMETHOD(EndScene)(THIS) PURE;
'  43.  STDMETHOD(Clear)(THIS_ DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil) PURE;
'  44.  STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix) PURE;
'  45.  STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix) PURE;
'  46.  STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,CONST D3DMATRIX*) PURE;
'  47.  STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT9* pViewport) PURE;
'  48.  STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT9* pViewport) PURE;
'  49.  STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9* pMaterial) PURE;
'  50.  STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL9* pMaterial) PURE;
'  51.  STDMETHOD(SetLight)(THIS_ DWORD Index,CONST D3DLIGHT9*) PURE;
'  52.  STDMETHOD(GetLight)(THIS_ DWORD Index,D3DLIGHT9*) PURE;
'  53.  STDMETHOD(LightEnable)(THIS_ DWORD Index,BOOL Enable) PURE;
'  54.  STDMETHOD(GetLightEnable)(THIS_ DWORD Index,BOOL* pEnable) PURE;
'  55.  STDMETHOD(SetClipPlane)(THIS_ DWORD Index,CONST float* pPlane) PURE;
'  56.  STDMETHOD(GetClipPlane)(THIS_ DWORD Index,float* pPlane) PURE;
'  57.  STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD Value) PURE;
'  58.  STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD* pValue) PURE;
'  59.  STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type,IDirect3DStateBlock9** ppSB) PURE;
'  60.  STDMETHOD(BeginStateBlock)(THIS) PURE;
'  61.  STDMETHOD(EndStateBlock)(THIS_ IDirect3DStateBlock9** ppSB) PURE;
'  62.  STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS9* pClipStatus) PURE;
'  63.  STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS9* pClipStatus) PURE;
'  64.  STDMETHOD(GetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9** ppTexture) PURE;
'  65.  STDMETHOD(SetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9* pTexture) PURE;
'  66.  STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue) PURE;
'  67.  STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value) PURE;
'  68.  STDMETHOD(GetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue) PURE;
'  69.  STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value) PURE;
'  70.  STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE;
'  71.  STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber,CONST PALETTEENTRY* pEntries) PURE;
'  72.  STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE;
'  73.  STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE;
'  74.  STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE;
'  75.  STDMETHOD(SetScissorRect)(THIS_ CONST RECT* pRect) PURE;
'  76.  STDMETHOD(GetScissorRect)(THIS_ RECT* pRect) PURE;
'  77.  STDMETHOD(SetSoftwareVertexProcessing)(THIS_ BOOL bSoftware) PURE;
'  78.  STDMETHOD_(BOOL, GetSoftwareVertexProcessing)(THIS) PURE;
'  79.  STDMETHOD(SetNPatchMode)(THIS_ float nSegments) PURE;
'  80.  STDMETHOD_(float, GetNPatchMode)(THIS) PURE;
'  81.  STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) PURE;
'  82.  STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount) PURE;
'  83.  STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE;
'  84.  STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE;
'  85.  STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer9* pDestBuffer,IDirect3DVertexDeclaration9* pVertexDecl,DWORD Flags) PURE;
'  86.  STDMETHOD(CreateVertexDeclaration)(THIS_ CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl) PURE;
'  87.  STDMETHOD(SetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9* pDecl) PURE;
'  88.  STDMETHOD(GetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9** ppDecl) PURE;
'  89.  STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE;
'  90.  STDMETHOD(GetFVF)(THIS_ DWORD* pFVF) PURE;
'  91.  STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pFunction,IDirect3DVertexShader9** ppShader) PURE;
'  92.  STDMETHOD(SetVertexShader)(THIS_ IDirect3DVertexShader9* pShader) PURE;
'  93.  STDMETHOD(GetVertexShader)(THIS_ IDirect3DVertexShader9** ppShader) PURE;
'  94.  STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) PURE;
'  95.  STDMETHOD(GetVertexShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount) PURE;
'  96.  STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) PURE;
'  97.  STDMETHOD(GetVertexShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount) PURE;
'  98.  STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT  BoolCount) PURE;
'  99.  STDMETHOD(GetVertexShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount) PURE;
' 100.  STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride) PURE;
' 101.  STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9** ppStreamData,UINT* pOffsetInBytes,UINT* pStride) PURE;
' 102.  STDMETHOD(SetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT Setting) PURE;
' 103.  STDMETHOD(GetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT* pSetting) PURE;
' 104.  STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer9* pIndexData) PURE;
' 105.  STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer9** ppIndexData) PURE;
' 106.  STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader) PURE;
' 107.  STDMETHOD(SetPixelShader)(THIS_ IDirect3DPixelShader9* pShader) PURE;
' 108.  STDMETHOD(GetPixelShader)(THIS_ IDirect3DPixelShader9** ppShader) PURE;
' 109.  STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) PURE;
' 110.  STDMETHOD(GetPixelShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount) PURE;
' 111.  STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) PURE;
' 112.  STDMETHOD(GetPixelShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount) PURE;
' 113.  STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT  BoolCount) PURE;
' 114.  STDMETHOD(GetPixelShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount) PURE;
' 115.  STDMETHOD(DrawRectPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo) PURE;
' 116.  STDMETHOD(DrawTriPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo) PURE;
' 117.  STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE;
' 118.  STDMETHOD(CreateQuery)(THIS_ D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery) PURE;
'};
' ****************************************************************************************

' ****************************************************************************************
' TestCooperativeLevel method
' Reports the current cooperative-level status of the Microsoft® Direct3D® device for a
' windowed or full-screen application.
' HRESULT TestCooperativeLevel();
' ****************************************************************************************
FUNCTION IDirect3DDevice9_TestCooperativeLevel ALIAS "IDirect3DDevice9_TestCooperativeLevel" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[3] USING IDirect3DDevice9_TestCooperativeLevel(pthis) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetAvailableTextureMem method
' Returns an estimate of the amount of available texture memory.
' UINT GetAvailableTextureMem();
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetAvailableTextureMem ALIAS "IDirect3DDevice9_GetAvailableTextureMem" (BYVAL pthis AS DWORD PTR) EXPORT AS DWORD

    LOCAL DWRESULT AS DWORD
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[4] USING IDirect3DDevice9_GetAvailableTextureMem(pthis) TO DWRESULT
    FUNCTION = DWRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' EvictManagedResources method
' Evicts all managed resources, including both Microsoft Direct3D and driver-managed
' resources.
' HRESULT EvictManagedResources();
' ****************************************************************************************
FUNCTION IDirect3DDevice9_EvictManagedResources ALIAS "IDirect3DDevice9_EvictManagedResources" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[5] USING IDirect3DDevice9_EvictManagedResources(pthis) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetDirect3D method
' Returns an interface to the instance of the Microsoft Direct3D object that created the
' device.
' Note   Calling this method will increase the internal reference count on the IDirect3D9
' interface. Failure to call IUnknown::Release when finished using this IDirect3D9
' interface results in a memory leak.
' HRESULT GetDirect3D(
'   IDirect3D9 ** ppD3D9
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetDirect3D ALIAS "IDirect3DDevice9_GetDirect3D" ( _
    BYVAL pthis AS DWORD PTR, BYREF ppD3D9 AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[6] USING IDirect3DDevice9_GetDirect3D(pthis, ppD3D9) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetDeviceCaps method
' Retrieves the capabilities of the rendering device.
' HRESULT GetDeviceCaps(
'   D3DCAPS9 * pCaps
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetDeviceCaps ALIAS "IDirect3DDevice9_GetDeviceCaps" ( _
    BYVAL pthis AS DWORD PTR, BYREF pCaps AS D3DCAPS9) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[7] USING IDirect3DDevice9_GetDeviceCaps(pthis, pCaps) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetDisplayMode method
' Retrieves the display mode's spatial resolution, color resolution, and refresh frequency.
' HRESULT GetDisplayMode(
'   UINT  iSwapChain,
'   D3DDISPLAYMODE * pMode
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetDisplayMode ALIAS "IDirect3DDevice9_GetDisplayMode" ( _
    BYVAL pthis AS DWORD PTR, BYVAL iSwapChain AS DWORD, BYREF pMode AS D3DDISPLAYMODE) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[8] USING IDirect3DDevice9_GetDisplayMode(pthis, iSwapChain, pMode) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetCreationParameters method
' Retrieves the creation parameters of the device.
' HRESULT GetCreationParameters(
'   D3DDEVICE_CREATION_PARAMETERS * pParameters
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetCreationParameters ALIAS "IDirect3DDevice9_GetCreationParameters" ( _
    BYVAL pthis AS DWORD PTR, BYREF pCreationParams AS D3DDEVICE_CREATION_PARAMETERS) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[9] USING IDirect3DDevice9_GetCreationParameters(pthis, pCreationParams) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetCursorProperties method
' Sets properties for the cursor.
' HRESULT SetCursorProperties(
'   UINT XHotSpot,
'   UINT YHotSpot,
'   IDirect3DSurface9 * pCursorBitmap
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetCursorProperties ALIAS "IDirect3DDevice9_SetCursorProperties" ( _
    BYVAL pthis AS DWORD PTR, BYVAL xHotSpot AS DWORD, BYVAL yHotSpot AS DWORD, _
    BYVAL pCursorBitmap AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[10] USING IDirect3DDevice9_SetCursorProperties(pthis, xHotSpot, yHotSpot, pCursorBitmap) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetCursorPosition method
' Sets the cursor position and update options.
' void SetCursorPosition(
'   INT X,
'   INT Y,
'   DWORD Flags
' );
' ****************************************************************************************
SUB IDirect3DDevice9_SetCursorPosition ALIAS "IDirect3DDevice9_SetCursorPosition" ( _
    BYVAL pthis AS DWORD PTR, BYVAL X AS LONG, BYVAL Y AS LONG, BYVAL Flags AS DWORD) EXPORT

    IF pthis = %NULL THEN EXIT SUB
    CALL DWORD @@pthis[11] USING IDirect3DDevice9_SetCursorPosition(pthis, X, Y, Flags)

END SUB
' ****************************************************************************************

' ****************************************************************************************
' ShowCursor method
' Displays or hides the cursor.
' BOOL ShowCursor(
'   BOOL bShow
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_ShowCursor ALIAS "IDirect3DDevice9_ShowCursor" ( _
    BYVAL pthis AS DWORD PTR, BYVAL bShow AS LONG) EXPORT AS LONG

    LOCAL LRESULT AS LONG
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[12] USING IDirect3DDevice9_ShowCursor(pthis, bShow) TO LRESULT
    FUNCTION = LRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' CreateAdditionalSwapChain method
' Creates an additional swap chain for rendering multiple views.
' HRESULT CreateAdditionalSwapChain(
'   D3DPRESENT_PARAMETERS* pPresentationParameters,
'   IDirect3DSwapChain9** ppSwapChain
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_CreateAdditionalSwapChain ALIAS "IDirect3DDevice9_CreateAdditionalSwapChain" ( _
    BYVAL pthis AS DWORD PTR, BYREF pPresentationParameters AS D3DPRESENT_PARAMETERS, _
    BYREF ppSwapChain AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[13] USING IDirect3DDevice9_CreateAdditionalSwapChain(pthis, pPresentationParameters, ppSwapChain) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetSwapChain method
' Gets a pointer to a swap chain.
' HRESULT GetSwapChain(
'   UINT  iSwapChain,
'   IDirect3DSwapChain9 ** ppSwapChain
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetSwapChain ALIAS "IDirect3DDevice9_GetSwapChain" ( _
    BYVAL pthis AS DWORD PTR, BYVAL iSwapChain AS DWORD, BYREF ppSwapChain AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[14] USING IDirect3DDevice9_GetSwapChain(pthis, iSwapChain, ppSwapChain) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetNumberOfSwapChains method
' Gets the number of implicit swap chains.
' UINT GetNumberOfSwapChains();
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetNumberOfSwapChains ALIAS "IDirect3DDevice9_GetNumberOfSwapChains" (BYVAL pthis AS DWORD PTR) EXPORT AS DWORD

    LOCAL DWRESULT AS DWORD
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[15] USING IDirect3DDevice9_GetNumberOfSwapChains(pthis) TO DWRESULT
    FUNCTION = DWRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Reset method
' Resets the type, size, and format of the swap chain.
' HRESULT Reset(
'   D3DPRESENT_PARAMETERS* pPresentationParameters
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_Reset ALIAS "IDirect3DDevice9_Reset" ( _
    BYVAL pthis AS DWORD PTR, BYREF pPresentationParameters AS D3DPRESENT_PARAMETERS) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[16] USING IDirect3DDevice9_Reset(pthis, pPresentationParameters) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Present method
' Presents the contents of the next in the sequence of back buffers owned by the device.
' HRESULT Present(
'   CONST RECT * pSourceRect,
'   CONST RECT * pDestRect,
'   HWND hDestWindowOverride,
'   CONST RGNDATA * pDirtyRegion
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_Present ALIAS "IDirect3DDevice9_Present" ( _
    BYVAL pthis AS DWORD PTR, BYREF pSourceRect AS RECT, BYREF pDestRect AS RECT, _
    BYVAL hWndDestWindowOverride AS DWORD, BYVAL pDirtyRegion AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[17] USING IDirect3DDevice9_Present(pthis, pSourceRect, pDestRect, hWndDestWindowOverride, pDirtyRegion) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetBackBuffer method
' Retrieves a back buffer from the device's swap chain
' Note  Calling this method will increase the internal reference count on the
' IDirect3DSurface8 interface. Failure to call IUnknown::Release when finished using this
' IDirect3DSurface8 interface results in a memory leak.
' HRESULT GetBackBuffer(
'   UINT  iSwapChain,
'   UINT BackBuffer,
'   D3DBACKBUFFER_TYPE Type,
'   IDirect3DSurface9 ** ppBackBuffer
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetBackBuffer ALIAS "IDirect3DDevice9_GetBackBuffer" ( _
    BYVAL pthis AS DWORD PTR, BYVAL iSwapChain AS DWORD, BYVAL BackBuffer AS DWORD, _
    BYVAL BufferType AS DWORD, BYREF ppBackBuffer AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[18] USING IDirect3DDevice9_GetBackBuffer(pthis, iSwapChain, BackBuffer, BufferType, ppBackBuffer) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetRasterStatus method
' Returns information describing the raster of the monitor on which the swap chain is
' presented.
' HRESULT GetRasterStatus(
'   UINT  iSwapChain,
'   D3DRASTER_STATUS * pRasterStatus
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetRasterStatus ALIAS "IDirect3DDevice9_GetRasterStatus" ( _
    BYVAL pthis AS DWORD PTR, BYVAL iSwapChain AS DWORD, _
    BYREF pRasterStatus AS D3DRASTER_STATUS) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[19] USING IDirect3DDevice9_GetRasterStatus(pthis, iSwapChain, pRasterStatus) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetDialogBoxMode method
' This method allows the use of Microsoft Windows Graphics Device Interface (GDI) dialog
' boxes in full-screen mode applications.
' HRESULT SetDialogBoxMode(
'   BOOL bEnableDialogs
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetDialogBoxMode ALIAS "IDirect3DDevice9_SetDialogBoxMode" ( _
    BYVAL pthis AS DWORD PTR, BYVAL bEnableDialogs AS LONG) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[20] USING IDirect3DDevice9_SetDialogBoxMode(pthis, bEnableDialogs) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetGammaRamp method
' Sets the gamma correction ramp for the implicit swap chain. This method will affect the
' entire screen (not just the active window if you are running in windowed mode).
' void SetGammaRamp(
'   UINT  iSwapChain,
'   DWORD Flags,
'   CONST D3DGAMMARAMP * pRamp
' );
' ****************************************************************************************
SUB IDirect3DDevice9_SetGammaRamp ALIAS "IDirect3DDevice9_SetGammaRamp" ( _
    BYVAL pthis AS DWORD PTR, BYVAL iSwapChain AS DWORD, _
    BYVAL Flags AS DWORD, BYREF pRamp AS D3DGAMMARAMP) EXPORT

    IF pthis = %NULL THEN EXIT SUB
    CALL DWORD @@pthis[21] USING IDirect3DDevice9_SetGammaRamp(pthis, iSwapChain, Flags, pRamp)

END SUB
' ****************************************************************************************

' ****************************************************************************************
' GetGammaRamp method
' Retrieves the gamma correction ramp for the swap chain.
' void GetGammaRamp(
'   UINT  iSwapChain,
'   D3DGAMMARAMP * pRamp
' );
' ****************************************************************************************
SUB IDirect3DDevice9_GetGammaRamp ALIAS "IDirect3DDevice9_GetGammaRamp" ( _
    BYVAL pthis AS DWORD PTR, BYVAL iSwapChain AS DWORD, BYREF pRamp AS D3DGAMMARAMP) EXPORT

    IF pthis = %NULL THEN EXIT SUB
    CALL DWORD @@pthis[22] USING IDirect3DDevice9_GetGammaRamp(pthis, iSwapChain, pRamp)

END SUB
' ****************************************************************************************

' ****************************************************************************************
' CreateTexture method
' Creates a texture resource.
' HRESULT CreateTexture(
'   UINT Width,
'   UINT Height,
'   UINT Levels,
'   DWORD Usage,
'   D3DFORMAT Format,
'   D3DPOOL Pool,
'   IDirect3DTexture9** ppTexture,
'   HANDLE* pSharedHandle
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_CreateTexture ALIAS "IDirect3DDevice9_CreateTexture" ( _
    BYVAL pthis AS DWORD PTR, BYVAL prmWidth AS DWORD, BYVAL Height AS DWORD, _
    BYVAL Levels AS DWORD, BYVAL Usage AS DWORD, BYVAL prmFormat AS DWORD, _
    BYVAL Pool AS DWORD, BYREF ppTexture AS DWORD, BYVAL pSharedHandle AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[23] USING IDirect3DDevice9_CreateTexture(pthis, prmWidth, Height, Levels, Usage, prmFormat, Pool, ppTexture, pSharedHandle) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' CreateVolumeTexture method
' Creates a volume texture resource.
' HRESULT CreateVolumeTexture(
'   UINT Width,
'   UINT Height,
'   UINT Depth,
'   UINT Levels,
'   DWORD Usage,
'   D3DFORMAT Format,
'   D3DPOOL Pool,
'   IDirect3DVolumeTexture9** ppVolumeTexture,
'   HANDLE* pSharedHandle
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_CreateVolumeTexture ALIAS "IDirect3DDevice9_CreateVolumeTexture" ( _
    BYVAL pthis AS DWORD PTR, BYVAL prmWidth AS DWORD, BYVAL Height AS DWORD, _
    BYVAL Depth AS DWORD, BYVAL Levels AS DWORD, BYVAL Usage AS DWORD, _
    BYVAL prmFormat AS DWORD, BYVAL Pool AS DWORD, BYREF ppVolumeTexture AS DWORD, _
    BYVAL pSharedHandle AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[24] USING IDirect3DDevice9_CreateVolumeTexture(pthis, prmWidth, Height, Depth, Levels, Usage, prmFormat, Pool, ppVolumeTexture, pSharedHandle) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' CreateCubeTexture method
' Creates a cube texture resource.
' HRESULT CreateCubeTexture(
'   UINT EdgeLength,
'   UINT Levels,
'   DWORD Usage,
'   D3DFORMAT Format,
'   D3DPOOL Pool,
'   IDirect3DCubeTexture9 ** ppCubeTexture,
'   HANDLE* pSharedHandle
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_CreateCubeTexture ALIAS "IDirect3DDevice9_CreateCubeTexture" ( _
    BYVAL pthis AS DWORD PTR, BYVAL EdgeLength AS DWORD, BYVAL Levels AS DWORD, _
    BYVAL Usage AS DWORD, BYVAL prmFormat AS DWORD, BYVAL Pool AS DWORD, _
    BYREF ppCubeTexture AS DWORD, BYVAL pSharedHandle AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[25] USING IDirect3DDevice9_CreateCubeTexture(pthis, EdgeLength, Levels, Usage, prmFormat, Pool, ppCubeTexture, pSharedHandle) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' CreateVertexBuffer method
' Creates a vertex buffer.
' HRESULT CreateVertexBuffer(
'   UINT Length,
'   DWORD Usage,
'   DWORD FVF,
'   D3DPOOL Pool,
'   IDirect3DVertexBuffer9** ppVertexBuffer,
'   HANDLE* pSharedHandle
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_CreateVertexBuffer ALIAS "IDirect3DDevice9_CreateVertexBuffer" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Length AS DWORD, BYVAL Usage AS DWORD, _
    BYVAL FVF AS DWORD, BYVAL Pool AS DWORD, BYREF ppVertexBuffer AS DWORD, _
    BYVAL pShareHandle AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[26] USING IDirect3DDevice9_CreateVertexBuffer(pthis, Length, Usage, FVF, Pool, ppVertexBuffer, pShareHandle) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' CreateIndexBuffer method
' Creates an index buffer.
' HRESULT CreateIndexBuffer(
'   UINT Length,
'   DWORD Usage,
'   D3DFORMAT Format,
'   D3DPOOL Pool,
'   IDirect3DIndexBuffer9** ppIndexBuffer,
'   HANDLE* pSharedHandle
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_CreateIndexBuffer ALIAS "IDirect3DDevice9_CreateIndexBuffer" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Length AS DWORD, BYVAL Usage AS DWORD, _
    BYVAL prmFormat AS DWORD, BYVAL Pool AS DWORD, BYREF ppIndexBuffer AS DWORD, _
    BYVAL pSharedHandle AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[27] USING IDirect3DDevice9_CreateIndexBuffer(pthis, Length, Usage, prmFormat, Pool, ppIndexBuffer, pSharedHandle) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' CreateRenderTarget method
' Creates a render-target surface.
' HRESULT CreateRenderTarget(
'   UINT Width,
'   UINT Height,
'   D3DFORMAT Format,
'   D3DMULTISAMPLE_TYPE MultiSample,
'   DWORD MultisampleQuality,
'   BOOL Lockable,
'   IDirect3DSurface9** ppSurface,
'   HANDLE* pSharedHandle
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_CreateRenderTarget ALIAS "IDirect3DDevice9_CreateRenderTarget" ( _
    BYVAL pthis AS DWORD PTR, BYVAL prmWidth AS DWORD, BYVAL Height AS DWORD, _
    BYVAL prmFormat AS DWORD, BYVAL MultiSample AS DWORD, BYVAL MultiSampleQuality AS DWORD, _
    BYVAL Lockable AS LONG, BYREF ppSurface AS DWORD, BYVAL pSharedHandle AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[28] USING IDirect3DDevice9_CreateRenderTarget(pthis, prmWidth, Height, prmFormat, MultiSample, MultiSampleQuality, Lockable, ppSurface, pSharedHandle) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' CreateDepthStencilSurface method
' Creates a depth-stencil resource.
' HRESULT CreateDepthStencilSurface(
'   UINT Width,
'   UINT Height,
'   D3DFORMAT Format,
'   D3DMULTISAMPLE_TYPE MultiSample,
'   DWORD MultisampleQuality,
'   BOOL Discard,
'   IDirect3DSurface9** ppSurface,
'   HANDLE* pSharedHandle
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_CreateDepthStencilSurface ALIAS "IDirect3DDevice9_CreateDepthStencilSurface" ( _
    BYVAL pthis AS DWORD PTR, BYVAL prmWidth AS DWORD, BYVAL Height AS DWORD, _
    BYVAL prmFormat AS DWORD, BYVAL MultiSample AS DWORD, BYVAL MultiSampleQuality AS DWORD, _
    BYVAL Discard AS LONG, BYREF ppSurface AS DWORD, BYVAL pSharedHandle AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[29] USING IDirect3DDevice9_CreateDepthStencilSurface(pthis, prmWidth, Height, prmFormat, MultiSample, MultisampleQuality, Discard, ppSurface, pSharedHandle) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' UpdateSurface Method
' Copies rectangular subsets of pixels from one surface to another.
' HRESULT UpdateSurface(
'   IDirect3DSurface9* pSourceSurface,
'   CONST RECT* pSourceRect,
'   IDirect3DSurface9* pDestinationSurface,
'   CONST POINT* pDestinationPoint
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_UpdateSurface ALIAS "IDirect3DDevice9_UpdateSurface" ( _
    BYVAL pthis AS DWORD PTR, BYVAL pSourceSurface AS DWORD, BYREF pSourceRect AS RECT, _
    BYVAL pDestinationSurface AS DWORD, BYREF pDestinationPoint AS POINTAPI) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[30] USING IDirect3DDevice9_UpdateSurface(pthis, pSourceSurface, pSourceRect, pDestinationSurface, pDestinationPoint) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' UpdateTexture method
' Updates the dirty portions of a texture.
' HRESULT UpdateTexture(
'   IDirect3DBaseTexture9 * pSourceTexture,
'   IDirect3DBaseTexture9 * pDestinationTexture
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_UpdateTexture ALIAS "IDirect3DDevice9_UpdateTexture" ( _
    BYVAL pthis AS DWORD PTR, BYVAL pSourceTexture AS DWORD, _
    BYVAL pDestinationTexture AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[31] USING IDirect3DDevice9_UpdateTexture(pthis, pSourceTexture, pDestinationTexture) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetRenderTargetData method
' Copies the render-target data from device memory to system memory.
' HRESULT GetRenderTargetData(
'   IDirect3DSurface9* pRenderTarget,
'   IDirect3DSurface9* pDestSurface
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetRenderTargetData ALIAS "IDirect3DDevice9_GetRenderTargetData" ( _
    BYVAL pthis AS DWORD PTR, BYVAL pRenderTarget AS DWORD, BYVAL pDestSurface AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[32] USING IDirect3DDevice9_GetRenderTargetData(pthis, pRenderTarget, pDestSurface) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetFrontBufferData method
' Generates a copy of the device's front buffer and places that copy in a system memory
' buffer provided by the application.
' HRESULT GetFrontBufferData(
'   UINT  iSwapChain,
'   IDirect3DSurface9 * pDestSurface
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetFrontBufferData ALIAS "IDirect3DDevice9_GetFrontBufferData" ( _
    BYVAL pthis AS DWORD PTR, BYVAL iSwapChain AS DWORD, BYVAL pDestSurface AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[33] USING IDirect3DDevice9_GetFrontBufferData(pthis, iSwapChain, pDestSurface) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' StretchRect method
' Copy the contents of the source rectangle to the destination rectangle. The source
' rectangle can be stretched and filtered by the copy. This function is often used to
' change the aspect ratio of a video stream.
' HRESULT StretchRect(
'   IDirect3DSurface9 * pSourceSurface,
'   CONST RECT * pSourceRect,
'   IDirect3DSurface9 * pDestSurface,
'   CONST RECT * pDestRect,
'   D3DTEXTUREFILTERTYPE Filter
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_StretchRect ALIAS "IDirect3DDevice9_StretchRect" ( _
    BYVAL pthis AS DWORD PTR, BYVAL pSourceSurface AS DWORD, _
    BYREF pSourceRect AS RECT, BYVAL pDestSurface AS DWORD, _
    BYREF pDestRect AS RECT, BYVAL Filter AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[34] USING IDirect3DDevice9_StretchRect(pthis, pSourceSurface, pSourceRect, pDestSurface, pDestRect, Filter) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' ColorFill method
' Allows an application to fill a rectangular area of a D3DPOOL_DEFAULT surface with a
' specified color.
' HRESULT ColorFill(
'   IDirect3DSurface9 * pSurface,
'   CONST RECT * pRect,
'   D3DCOLOR color
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_ColorFill ALIAS "IDirect3DDevice9_ColorFill" ( _
    BYVAL pthis AS DWORD PTR, BYVAL pSurface AS DWORD, BYREF pRect AS RECT, _
    BYVAL prmColor AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[35] USING IDirect3DDevice9_ColorFill(pthis, pSurface, pRect, prmColor) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' CreateOffscreenPlainSurface method
' Create an off-screen surface.
' HRESULT CreateOffscreenPlainSurface(
'   UINT Width,
'   UINT Height,
'   D3DFORMAT Format,
'   DWORD Pool,
'   IDirect3DSurface9** ppSurface,
'   HANDLE* pSharedHandle
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_CreateOffscreenPlainSurface ALIAS "IDirect3DDevice9_CreateOffscreenPlainSurface" ( _
    BYVAL pthis AS DWORD PTR, BYVAL prmWidth AS DWORD, BYVAL Height AS DWORD, _
    BYVAL prmFormat AS DWORD, BYVAL Pool AS DWORD, BYREF ppSurface AS DWORD, _
    BYVAL pSharedHandle AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[36] USING IDirect3DDevice9_CreateOffscreenPlainSurface(pthis, prmWidth, Height, prmFormat, Pool, ppSurface, pSharedHandle) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetRenderTarget method
' Sets a new color buffer for the device.
' HRESULT SetRenderTarget(
'   DWORD RenderTargetIndex,
'   IDirect3DSurface9 *pRenderTarget
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetRenderTarget ALIAS "IDirect3DDevice9_SetRenderTarget" ( _
    BYVAL pthis AS DWORD PTR, BYVAL RenderTargetIndex AS DWORD, BYVAL pRenderTarget AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[37] USING IDirect3DDevice9_SetRenderTarget(pthis, RenderTargetIndex, pRenderTarget) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetRenderTarget method
' Retrieves a render-target surface.
' HRESULT GetRenderTarget(
'   DWORD RenderTargetIndex,
'   IDirect3DSurface9 ** ppRenderTarget
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetRenderTarget ALIAS "IDirect3DDevice9_GetRenderTarget" ( _
    BYVAL pthis AS DWORD PTR, BYVAL RenderTargetIndex AS DWORD, _
    BYREF ppRenderTarget AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[38] USING IDirect3DDevice9_GetRenderTarget(pthis, RenderTargetIndex, ppRenderTarget) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetDepthStencilSurface method
' Sets the depth-stencil surface owned by the Direct3DDevice object.
' HRESULT SetDepthStencilSurface(
'   IDirect3DSurface9 * pNewZStencil
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetDepthStencilSurface ALIAS "IDirect3DDevice9_SetDepthStencilSurface" ( _
    BYVAL pthis AS DWORD PTR, BYVAL pNewZStencil AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[39] USING IDirect3DDevice9_SetDepthStencilSurface(pthis, pNewZStencil) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetDepthStencilSurface method
' Gets the depth-stencil surface owned by the Direct3DDevice object.
' HRESULT GetDepthStencilSurface(
'   IDirect3DSurface9 ** ppZStencilSurface
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetDepthStencilSurface ALIAS "IDirect3DDevice9_GetDepthStencilSurface" ( _
    BYVAL pthis AS DWORD PTR, BYREF ppNewZStencil AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[40] USING IDirect3DDevice9_GetDepthStencilSurface(pthis, ppNewZStencil) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' BeginScene method
' Begins a scene.
' HRESULT BeginScene();
' ****************************************************************************************
FUNCTION IDirect3DDevice9_BeginScene ALIAS "IDirect3DDevice9_BeginScene" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[41] USING IDirect3DDevice9_BeginScene(pthis) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' EndScene method
' Ends a scene that was begun by calling IDirect3DDevice9::BeginScene.
' HRESULT EndScene();
' ****************************************************************************************
FUNCTION IDirect3DDevice9_EndScene ALIAS "IDirect3DDevice9_EndScene" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[42] USING IDirect3DDevice9_EndScene(pthis) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Clear method
' Clears one or more surfaces such as a render target, multiple render targets, a stencil
' buffer, and a depth buffer.
' HRESULT Clear(
'   DWORD Count,
'   CONST D3DRECT * pRects,
'   DWORD Flags,
'   D3DCOLOR Color,
'   float Z,
'   DWORD Stencil
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_Clear ALIAS "IDirect3DDevice9_Clear" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Count AS DWORD, BYVAL pRects AS DWORD, _
    BYVAL Flags AS DWORD, BYVAL prmColor AS DWORD, BYVAL Z AS SINGLE, _
    BYVAL Stencil AS LONG) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[43] USING IDirect3DDevice9_Clear(pthis, Count, pRects, Flags, prmColor, z, Stencil) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetTransform method
' Sets a single device transformation-related state.
' HRESULT SetTransform(
'   D3DTRANSFORMSTATETYPE State,
'   CONST D3DMATRIX * pMatrix
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetTransform ALIAS "IDirect3DDevice9_SetTransform" ( _
    BYVAL pthis AS DWORD PTR, BYVAL prmState AS DWORD, BYREF pMatrix AS D3DMATRIX) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[44] USING IDirect3DDevice9_SetTransform(pthis, prmState, pMatrix) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetTransform method
' Retrieves a matrix describing a transformation state.
' HRESULT GetTransform(
'   D3DTRANSFORMSTATETYPE State,
'   D3DMATRIX * pMatrix
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetTransform ALIAS "IDirect3DDevice9_GetTransform" ( _
    BYVAL pthis AS DWORD PTR, BYVAL prmState AS DWORD, BYREF pMatrix AS D3DMATRIX) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[45] USING IDirect3DDevice9_GetTransform(pthis, prmState, pMatrix) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' MultiplyTransform method
' Multiplies a device's world, view, or projection matrices by a specified matrix.
' HRESULT MultiplyTransform(
'   D3DTRANSFORMSTATETYPE State,
'   CONST D3DMATRIX * pMatrix
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_MultiplyTransform ALIAS "IDirect3DDevice9_MultiplyTransform" ( _
    BYVAL pthis AS DWORD PTR, BYVAL prmState AS DWORD, BYREF pMatrix AS D3DMATRIX) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[46] USING IDirect3DDevice9_MultiplyTransform(pthis, prmState, pMatrix) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetViewport method
' Sets the viewport parameters for the device.
' HRESULT SetViewport(
'   CONST D3DVIEWPORT9 * pViewport
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetViewport ALIAS "IDirect3DDevice9_SetViewport" ( _
    BYVAL pthis AS DWORD PTR, BYREF pViewport AS D3DVIEWPORT9) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[47] USING IDirect3DDevice9_SetViewport(pthis, pViewport) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetViewport method
' Retrieves the viewport parameters currently set for the device.
' HRESULT GetViewport(
'   D3DVIEWPORT9 * pViewport
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetViewport ALIAS "IDirect3DDevice9_GetViewport" ( _
    BYVAL pthis AS DWORD PTR, BYREF pViewport AS D3DVIEWPORT9) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[48] USING IDirect3DDevice9_GetViewport(pthis, pViewport) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetMaterial method
' Sets the material properties for the device.
' HRESULT SetMaterial(
'   CONST D3DMATERIAL9 * pMaterial
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetMaterial ALIAS "IDirect3DDevice9_SetMaterial" ( _
    BYVAL pthis AS DWORD PTR, BYREF pMaterial AS D3DMATERIAL9) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[49] USING IDirect3DDevice9_SetMaterial(pthis, pMaterial) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetMaterial method
' Retrieves the current material properties for the device.
' HRESULT GetMaterial(
'   D3DMATERIAL9 * pMaterial
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetMaterial ALIAS "IDirect3DDevice9_GetMaterial" ( _
    BYVAL pthis AS DWORD PTR, BYREF pMaterial AS D3DMATERIAL9) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[50] USING IDirect3DDevice9_GetMaterial(pthis, pMaterial) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetLight method
' Assigns a set of lighting properties for this device.
' HRESULT SetLight(
'   DWORD Index,
'   CONST D3DLight9 * pLight
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetLight ALIAS "IDirect3DDevice9_SetLight" ( _
    BYVAL pthis AS DWORD PTR, BYVAL index AS DWORD, BYREF pLight AS D3DLIGHT9) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[51] USING IDirect3DDevice9_SetLight(pthis, index, pLight) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetLight method
' Retrieves a set of lighting properties that this device uses.
' HRESULT GetLight(
'   DWORD Index,
'   D3DLight9 * pLight
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetLight ALIAS "IDirect3DDevice9_GetLight" ( _
    BYVAL pthis AS DWORD PTR, BYVAL index AS DWORD, BYREF pLight AS D3DLIGHT9) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[52] USING IDirect3DDevice9_GetLight(pthis, index, pLight) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' LightEnable method
' Enables or disables a set of lighting parameters within a device.
' HRESULT LightEnable(
'   DWORD LightIndex,
'   BOOL bEnable
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_LightEnable ALIAS "IDirect3DDevice9_LightEnable" ( _
    BYVAL pthis AS DWORD PTR, BYVAL LightIndex AS DWORD, BYVAL bEnable AS LONG) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[53] USING IDirect3DDevice9_LightEnable(pthis, LightIndex, bEnable) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetLightEnable method
' Retrieves the activity status--enabled or disabled--for a set of lighting parameters
' within a device.
' HRESULT GetLightEnable(
'   DWORD Index,
'   BOOL * pEnable
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetLightEnable ALIAS "IDirect3DDevice9_GetLightEnable" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Index AS DWORD, BYREF pEnable AS LONG) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[54] USING IDirect3DDevice9_GetLightEnable(pthis, Index, pEnable) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetClipPlane method
' Sets the coefficients of a user-defined clipping plane for the device.
' HRESULT SetClipPlane(
'   DWORD Index,
'   CONST float * pPlane
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetClipPlane ALIAS "IDirect3DDevice9_SetClipPlane" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Index AS LONG, BYVAL pPlane AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[55] USING IDirect3DDevice9_SetClipPlane(pthis, Index, pPlane) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetClipPlane method
' Retrieves the coefficients of a user-defined clipping plane for the device.
' HRESULT GetClipPlane(
'   DWORD Index,
'   float * pPlane
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetClipPlane ALIAS "IDirect3DDevice9_GetClipPlane" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Index AS LONG, BYVAL pPlane AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[56] USING IDirect3DDevice9_GetClipPlane(pthis, Index, pPlane) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetRenderState method
' Sets a single device render-state parameter.
' HRESULT SetRenderState(
'   D3DRENDERSTATETYPE State,
'   DWORD Value
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetRenderState ALIAS "IDirect3DDevice9_SetRenderState" ( _
    BYVAL pthis AS DWORD PTR, BYVAL StateType AS DWORD, BYVAL Value AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[57] USING IDirect3DDevice9_SetRenderState(pthis, StateType, Value) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetRenderState method
' Retrieves a render-state value for a device.
' HRESULT GetRenderState(
'   D3DRENDERSTATETYPE State,
'   DWORD * pValue
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetRenderState ALIAS "IDirect3DDevice9_GetRenderState" ( _
    BYVAL pthis AS DWORD PTR, BYVAL StateType AS DWORD, BYREF pValue AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[58] USING IDirect3DDevice9_GetRenderState(pthis, StateType, pValue) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' CreateStateBlock method
' Creates a new state block that contains the values for all device states, vertex-related
' states, or pixel-related states.
' HRESULT CreateStateBlock(
'   D3DSTATEBLOCKTYPE Type,
'   IDirect3DStateBlock9** ppSB
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_CreateStateBlock ALIAS "IDirect3DDevice9_CreateStateBlock" ( _
    BYVAL pthis AS DWORD PTR, BYVAL StateType AS DWORD, BYREF ppSB AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[59] USING IDirect3DDevice9_CreateStateBlock(pthis, StateType, ppSB) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' BeginStateBlock method
' Signals Microsoft Direct3D to begin recording a device-state block.
' HRESULT BeginStateBlock();
' ****************************************************************************************
FUNCTION IDirect3DDevice9_BeginStateBlock ALIAS "IDirect3DDevice9_BeginStateBlock" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[60] USING IDirect3DDevice9_BeginStateBlock(pthis) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' EndStateBlock method
' Signals Microsoft Direct3D to stop recording a device-state block and retrieve a pointer to
' the state block interface.
' HRESULT EndStateBlock(
'   IDirect3DStateBlock9 ** ppSB
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_EndStateBlock ALIAS "IDirect3DDevice9_EndStateBlock" ( _
    BYVAL pthis AS DWORD PTR, BYREF ppSB AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[61] USING IDirect3DDevice9_EndStateBlock(pthis, ppSB) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetClipStatus method
' Sets the clip status.
' HRESULT SetClipStatus(
'   CONST D3DCLIPSTATUS9 * pClipStatus
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetClipStatus ALIAS "IDirect3DDevice9_SetClipStatus" ( _
    BYVAL pthis AS DWORD PTR, BYREF pClipStatus AS D3DCLIPSTATUS9) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[62] USING IDirect3DDevice9_SetClipStatus(pthis, pClipStatus) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetClipStatus method
' Gets the clip status.
' HRESULT GetClipStatus(
'   D3DCLIPSTATUS9 * pClipStatus
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetClipStatus ALIAS "IDirect3DDevice9_GetClipStatus" ( _
    BYVAL pthis AS DWORD PTR, BYREF pClipStatus AS D3DCLIPSTATUS9) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[63] USING IDirect3DDevice9_GetClipStatus(pthis, pClipStatus) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetTexture method
' Retrieves a texture assigned to a stage for a device.
' HRESULT GetTexture(
'   DWORD Stage,
'   IDirect3DBaseTexture9 ** ppTexture
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetTexture ALIAS "IDirect3DDevice9_GetTexture" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Stage AS DWORD, BYREF ppTexture AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[64] USING IDirect3DDevice9_GetTexture(pthis, Stage, ppTexture) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetTexture method
' Assigns a texture to a stage for a device.
' HRESULT SetTexture(
'   DWORD Sampler,
'   IDirect3DBaseTexture9 * pTexture
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetTexture ALIAS "IDirect3DDevice9_SetTexture" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Sampler AS DWORD, BYVAL pTexture AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[65] USING IDirect3DDevice9_SetTexture(pthis, Sampler, pTexture) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetTextureStageState method
' Retrieves a state value for an assigned texture.
' HRESULT GetTextureStageState(
'   DWORD Stage,
'   D3DTEXTURESTAGESTATETYPE Type,
'   DWORD * pValue
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetTextureStageState ALIAS "IDirect3DDevice9_GetTextureStageState" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Stage AS DWORD, BYVAL StateType AS DWORD, _
    BYREF pValue AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[66] USING IDirect3DDevice9_GetTextureStageState(pthis, Stage, StateType, pValue) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetTextureStageState method
' Sets the state value for the currently assigned texture.
' HRESULT SetTextureStageState(
'   DWORD Stage,
'   D3DTEXTURESTAGESTATETYPE Type,
'   DWORD Value
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetTextureStageState ALIAS "IDirect3DDevice9_SetTextureStageState" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Stage AS DWORD, BYVAL StateType AS DWORD, _
    BYVAL pValue AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[67] USING IDirect3DDevice9_SetTextureStageState(pthis, Stage, StateType, pValue) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetSamplerState method
' Gets the sampler state value.
' HRESULT GetSamplerState(
'   DWORD Sampler,
'   D3DSAMPLERSTATETYPE Type,
'   DWORD* pValue
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetSamplerState ALIAS "IDirect3DDevice9_GetSamplerState" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Sampler AS DWORD, BYVAL StateType AS DWORD, _
    BYREF pValue AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[68] USING IDirect3DDevice9_GetSamplerState(pthis, Sampler, StateType, pValue) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetSamplerState method
' Sets the sampler state value.
' HRESULT SetSamplerState(
'   DWORD Sampler,
'   D3DSAMPLERSTATETYPE Type,
'   DWORD Value
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetSamplerState ALIAS "IDirect3DDevice9_SetSamplerState" ( _
    BYVAL pthis AS DWORD PTR, BYVAL Sampler AS DWORD, BYVAL StateType AS DWORD, _
    BYVAL pValue AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[69] USING IDirect3DDevice9_SetSamplerState(pthis, Sampler, StateType, pValue) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' ValidateDevice method
' Reports the device's ability to render the current texture-blending operations and
' arguments in a single pass.
' HRESULT ValidateDevice(
'   DWORD * pNumPasses
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_ValidateDevice ALIAS "IDirect3DDevice9_ValidateDevice" ( _
    BYVAL pthis AS DWORD PTR, BYREF pNumPasses AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[70] USING IDirect3DDevice9_ValidateDevice(pthis, pNumPasses) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetPaletteEntries method
' Sets palette entries.
' Note  As of Microsoft DirectX 9.0, the peFlags member of the PALETTEENTRY structure does
' not work the way it is documented in the Platform SDK. The peFlags member is now the
' alpha channel for 8-bit palletized formats.
' HRESULT SetPaletteEntries(
'   UINT PaletteNumber,
'   CONST PALETTEENTRY * pEntries
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetPaletteEntries ALIAS "IDirect3DDevice9_SetPaletteEntries" ( _
    BYVAL pthis AS DWORD PTR, BYVAL PaletteNumber AS DWORD, BYVAL pEntries AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[71] USING IDirect3DDevice9_SetPaletteEntries(pthis, PaletteNumber, pEntries) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetPaletteEntries method
' Gets palette entries.
' Note  As of Microsoft DirectX 9.0, the peFlags member of the PALETTEENTRY structure does
' not work the way it is documented in the Platform SDK. The peFlags member is now the
' alpha channel for 8-bit palletized formats.
' HRESULT GetPaletteEntries(
'   UINT PaletteNumber,
'   PALETTEENTRY * pEntries
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetPaletteEntries ALIAS "IDirect3DDevice9_GetPaletteEntries" ( _
    BYVAL pthis AS DWORD PTR, BYVAL PaletteNumber AS DWORD, BYVAL pEntries AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[72] USING IDirect3DDevice9_GetPaletteEntries(pthis, PaletteNumber, pEntries) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetCurrentTexturePalette method
' Sets the current texture palette
' HRESULT SetCurrentTexturePalette(
'   UINT PaletteNumber
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetCurrentTexturePalette ALIAS "IDirect3DDevice9_SetCurrentTexturePalette" ( _
    BYVAL pthis AS DWORD PTR, BYVAL PaletteNumber AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[73] USING IDirect3DDevice9_SetCurrentTexturePalette(pthis, PaletteNumber) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetCurrentTexturePalette method
' Gets the current texture palette
' HRESULT GetCurrentTexturePalette(
'   UINT * pPaletteNumber
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetCurrentTexturePalette ALIAS "IDirect3DDevice9_GetCurrentTexturePalette" ( _
    BYVAL pthis AS DWORD PTR, BYREF PaletteNumber AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[74] USING IDirect3DDevice9_GetCurrentTexturePalette(pthis, PaletteNumber) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetScissorRect method
' Sets the scissor rectangle.
' HRESULT SetScissorRect(
'   CONST RECT * pRect
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetScissorRect ALIAS "IDirect3DDevice9_SetScissorRect" ( _
    BYVAL pthis AS DWORD PTR, BYREF pRect AS RECT) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[75] USING IDirect3DDevice9_SetScissorRect(pthis, pRect) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetScissorRect method
' Gets the scissor rectangle.
' HRESULT GetScissorRect(
'   RECT * pRect
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetScissorRect ALIAS "IDirect3DDevice9_GetScissorRect" ( _
    BYVAL pthis AS DWORD PTR, BYREF pRect AS RECT) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[76] USING IDirect3DDevice9_GetScissorRect(pthis, pRect) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetSoftwareVertexProcessing method
' Sets the scissor rectangle.
' HRESULT SetSoftwareVertexProcessing(
'   BOOL bSoftware
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetSoftwareVertexProcessing ALIAS "IDirect3DDevice9_SetSoftwareVertexProcessing" ( _
    BYVAL pthis AS DWORD PTR, BYVAL bSoftware AS LONG) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[77] USING IDirect3DDevice9_SetSoftwareVertexProcessing(pthis, bSoftware) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetSoftwareVertexProcessing method
' Gets the scissor rectangle.
' BOOL GetSoftwareVertexProcessing();
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetSoftwareVertexProcessing ALIAS "IDirect3DDevice9_GetSoftwareVertexProcessing" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG

    LOCAL LRESULT AS LONG
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[78] USING IDirect3DDevice9_GetSoftwareVertexProcessing(pthis) TO LRESULT
    FUNCTION = LRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetNPatchMode method
' Sets the scissor rectangle.
' HRESULT SetNPatchMode(
'   float nSegments
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetNPatchMode ALIAS "IDirect3DDevice9_SetNPatchMode" ( _
    BYVAL pthis AS DWORD PTR, BYVAL nSegments AS SINGLE) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[79] USING IDirect3DDevice9_SetNPatchMode(pthis, nSegments) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetNPatchMode method
' Gets the scissor rectangle.
' FLOAT GetNPatchMode();
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetNPatchMode ALIAS "IDirect3DDevice9_GetNPatchMode" (BYVAL pthis AS DWORD PTR) EXPORT AS SINGLE

    LOCAL SRESULT AS SINGLE
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[80] USING IDirect3DDevice9_GetNPatchMode(pthis) TO SRESULT
    FUNCTION = SRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' DrawPrimitive method
' Renders a sequence of nonindexed, geometric primitives of the specified type from the
' current set of data input streams.
' HRESULT DrawPrimitive(
'   D3DPRIMITIVETYPE PrimitiveType,
'   UINT StartVertex,
'   UINT PrimitiveCount
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_DrawPrimitive ALIAS "IDirect3DDevice9_DrawPrimitive" ( _
    BYVAL pthis AS DWORD PTR, BYVAL PrimitiveType AS DWORD, BYVAL StartVertex AS DWORD, _
    BYVAL PrimitiveCount AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[81] USING IDirect3DDevice9_DrawPrimitive(pthis, PrimitiveType, StartVertex, PrimitiveCount) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' DrawIndexedPrimitive method
' Based on indexing, renders the specified geometric primitive into an array of vertices.
' HRESULT DrawIndexedPrimitive(
'   D3DPRIMITIVETYPE Type,
'   INT BaseVertexIndex,
'   UINT MinIndex,
'   UINT NumVertices,
'   UINT StartIndex,
'   UINT PrimitiveCount
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_DrawIndexedPrimitive ALIAS "IDirect3DDevice9_DrawIndexedPrimitive" ( _
    BYVAL pthis AS DWORD PTR, BYVAL PrimitiveType AS DWORD, BYVAL BaseVertexIndex AS LONG, _
    BYVAL MinIndex AS DWORD, BYVAL NumVertices AS DWORD, BYVAL StartIndex AS DWORD, _
    BYVAL PrimitiveCount AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[82] USING IDirect3DDevice9_DrawIndexedPrimitive(pthis, PrimitiveType, BaseVertexIndex, MinIndex, NumVertices, StartIndex, PrimitiveCount) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' DrawPrimitiveUP method
' Renders data specified by a user memory pointer as a sequence of geometric primitives of
' the specified type.
' HRESULT DrawPrimitiveUP(
'   D3DPRIMITIVETYPE PrimitiveType,
'   UINT PrimitiveCount,
'   CONST void* pVertexStreamZeroData,
'   UINT VertexStreamZeroStride
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_DrawPrimitiveUP ALIAS "IDirect3DDevice9_DrawPrimitiveUP" ( _
    BYVAL pthis AS DWORD PTR, BYVAL PrimitiveType AS DWORD, BYVAL PrimitiveCount AS DWORD, _
    BYVAL pVertexStreamZeroData AS DWORD, BYVAL VertexStreamZeroStride AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[83] USING IDirect3DDevice9_DrawPrimitiveUP(pthis, PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' DrawIndexedPrimitiveUP method
' Renders the specified geometric primitive with data specified by a user memory pointer.
' HRESULT DrawIndexedPrimitiveUP(
'   D3DPRIMITIVETYPE PrimitiveType,
'   UINT MinVertexIndex,
'   UINT NumVertices,
'   UINT PrimitiveCount,
'   CONST void * pIndexData,
'   D3DFORMAT IndexDataFormat,
'   CONST void* pVertexStreamZeroData,
'   UINT VertexStreamZeroStride
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_DrawIndexedPrimitiveUP ALIAS "IDirect3DDevice9_DrawIndexedPrimitiveUP" ( _
    BYVAL pthis AS DWORD PTR, BYVAL PrimitiveType AS DWORD, BYVAL MinVertexIndex AS DWORD, _
    BYVAL NumVertices AS DWORD, BYVAL PrimitiveCount AS DWORD, BYVAL pIndexData AS DWORD, _
    BYVAL IndexDataFormat AS DWORD, BYVAL pVertexStreamZeroData AS DWORD, _
    BYVAL VertexStreamZeroStride AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[84] USING IDirect3DDevice9_DrawIndexedPrimitiveUP(pthis, PrimitiveType, MinVertexIndex, NumVertices, PrimitiveCount, pIndexData, IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' ProcessVertices method
' Applies the vertex processing defined by the vertex shader to the set of input data
' streams, generating a single stream of interleaved vertex data to the destination vertex
' buffer.
' HRESULT ProcessVertices(
'   UINT SrcStartIndex,
'   UINT DestIndex,
'   UINT VertexCount,
'   IDirect3DVertexBuffer9 * pDestBuffer,
'   IDirect3DVertexDeclaration9* pVertexDecl,
'   DWORD Flags
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_ProcessVertices ALIAS "IDirect3DDevice9_ProcessVertices" ( _
    BYVAL pthis AS DWORD PTR, BYVAL SrcStartIndex AS DWORD, BYVAL DestIndex AS DWORD, _
    BYVAL VertexCount AS DWORD, BYVAL pDestBuffer AS DWORD, BYVAL pVertexDecl AS DWORD, _
    BYVAL Flags AS LONG) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[85] USING IDirect3DDevice9_ProcessVertices(pthis, SrcStartIndex, DestIndex, VertexCount, pDestBuffer, pVertexDecl, Flags) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' CreateVertexDeclaration method
' Create a vertex shader declaration from the device and the vertex elements.
' HRESULT CreateVertexDeclaration(
'   CONST D3DVERTEXELEMENT9* pVertexElements,
'   IDirect3DVertexDeclaration9** ppDecl
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_CreateVertexDeclaration ALIAS "IDirect3DDevice9_CreateVertexDeclaration" ( _
    BYVAL pthis AS DWORD PTR, BYVAL pVertexElements AS DWORD, BYREF ppDecl AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[86] USING IDirect3DDevice9_CreateVertexDeclaration(pthis, pVertexElements, ppDecl) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetVertexDeclaration method
' Sets a vertex shader declaration.
' HRESULT SetVertexDeclaration(
'   IDirect3DVertexDeclaration9 * pDecl
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetVertexDeclaration ALIAS "IDirect3DDevice9_SetVertexDeclaration" ( _
    BYVAL pthis AS DWORD PTR, BYVAL pDecl AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[87] USING IDirect3DDevice9_SetVertexDeclaration(pthis, pDecl) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetVertexDeclaration method
' Gets a vertex shader declaration.
' HRESULT GetVertexDeclaration(
'   IDirect3DVertexDeclaration9** ppDecl
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetVertexDeclaration ALIAS "IDirect3DDevice9_GetVertexDeclaration" ( _
    BYVAL pthis AS DWORD PTR, BYREF ppDecl AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[88] USING IDirect3DDevice9_GetVertexDeclaration(pthis, ppDecl) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetFVF method
' Sets the current vertex stream declaration.
' HRESULT SetFVF(
'   DWORD FVF
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetFVF ALIAS "IDirect3DDevice9_SetFVF" ( _
    BYVAL pthis AS DWORD PTR, BYVAL FVF AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[89] USING IDirect3DDevice9_SetFVF(pthis, FVF) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetFVF method
' Gets the current vertex stream declaration.
' HRESULT GetFVF(
'   DWORD * pFVF
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetFVF ALIAS "IDirect3DDevice9_GetFVF" ( _
    BYVAL pthis AS DWORD PTR, BYREF FVF AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[90] USING IDirect3DDevice9_GetFVF(pthis, FVF) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' CreateVertexShader method
' Creates a vertex shader.
' HRESULT CreateVertexShader(
'   CONST DWORD * pFunction,
'   IDirect3DVertexShader9** ppShader
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_CreateVertexShader ALIAS "IDirect3DDevice9_CreateVertexShader" ( _
    BYVAL pthis AS DWORD PTR, BYVAL pFunction AS DWORD, BYREF ppShader AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[91] USING IDirect3DDevice9_CreateVertexShader(pthis, pFunction, ppShader) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetVertexShader method
' Sets a vertex shader.
' HRESULT SetVertexShader(
'   IDirect3DVertexShader9* pShader
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetVertexShader ALIAS "IDirect3DDevice9_SetVertexShader" ( _
    BYVAL pthis AS DWORD PTR, BYVAL pShader AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[92] USING IDirect3DDevice9_SetVertexShader(pthis, pShader) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetVertexShader method
' Gets a vertex shader.
' HRESULT GetVertexShader(
'   IDirect3DVertexShader9** ppShader
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetVertexShader ALIAS "IDirect3DDevice9_GetVertexShader" ( _
    BYVAL pthis AS DWORD PTR, BYREF ppShader AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[93] USING IDirect3DDevice9_GetVertexShader(pthis, ppShader) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetVertexShaderConstantF method
' Sets a floating-point vertex shader constant.
' HRESULT SetVertexShaderConstantF(
'   UINT StartRegister,
'   CONST float * pConstantData,
'   UINT Vector4fCount
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetVertexShaderConstantF ALIAS "IDirect3DDevice9_SetVertexShaderConstantF" ( _
    BYVAL pthis AS DWORD PTR, BYVAL StartRegister AS DWORD, BYVAL pConstantData AS DWORD, _
    BYVAL Vector4fCount AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[94] USING IDirect3DDevice9_SetVertexShaderConstantF(pthis, StartRegister, pConstantData, Vector4fCount) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetVertexShaderConstantF method
' Gets a floating-point vertex shader constant.
' HRESULT GetVertexShaderConstantF(
'   UINT StartRegister,
'   float * pConstantData,
'   UINT Vector4fCount
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetVertexShaderConstantF ALIAS "IDirect3DDevice9_GetVertexShaderConstantF" ( _
    BYVAL pthis AS DWORD PTR, BYVAL StartRegister AS DWORD, BYVAL pConstantData AS DWORD, _
    BYVAL Vector4fCount AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[95] USING IDirect3DDevice9_GetVertexShaderConstantF(pthis, StartRegister, pConstantData, Vector4fCount) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetVertexShaderConstantI method
' Sets an integer vertex shader constant.
' HRESULT SetVertexShaderConstantI(
'   UINT StartRegister,
'   CONST int * pConstantData,
'   UINT Vector4iCount
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetVertexShaderConstantI ALIAS "IDirect3DDevice9_SetVertexShaderConstantI" ( _
    BYVAL pthis AS DWORD PTR, BYVAL StartRegister AS DWORD, BYVAL pConstantData AS DWORD, _
    BYVAL Vector4iCount AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[96] USING IDirect3DDevice9_SetVertexShaderConstantI(pthis, StartRegister, pConstantData, Vector4iCount) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetVertexShaderConstantI method
' Gets an integer vertex shader constant.
' HRESULT GetVertexShaderConstantI(
'   UINT StartRegister,
'   int * pConstantData,
'   UINT Vector4iCount
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetVertexShaderConstantI ALIAS "IDirect3DDevice9_GetVertexShaderConstantI" ( _
    BYVAL pthis AS DWORD PTR, BYVAL StartRegister AS DWORD, BYVAL pConstantData AS DWORD, _
    BYVAL Vector4iCount AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[97] USING IDirect3DDevice9_GetVertexShaderConstantI(pthis, StartRegister, pConstantData, Vector4iCount) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetVertexShaderConstantB method
' Sets a Boolean vertex shader constant.
' HRESULT SetVertexShaderConstantB(
'   UINT StartRegister,
'   CONST BOOL * pConstantData,
'   UINT BoolCount
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetVertexShaderConstantB ALIAS "IDirect3DDevice9_SetVertexShaderConstantB" ( _
    BYVAL pthis AS DWORD PTR, BYVAL StartRegister AS DWORD, BYVAL pConstantData AS DWORD, _
    BYVAL BoolCount AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[98] USING IDirect3DDevice9_SetVertexShaderConstantB(pthis, StartRegister, pConstantData, BoolCount) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetVertexShaderConstantB method
' Gets an integer vertex shader constant.
' HRESULT GetVertexShaderConstantB(
'   UINT StartRegister,
'   BOOL * pConstantData,
'   UINT BoolCount
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetVertexShaderConstantB ALIAS "IDirect3DDevice9_GetVertexShaderConstantB" ( _
    BYVAL pthis AS DWORD PTR, BYVAL StartRegister AS DWORD, BYVAL pConstantData AS DWORD, _
    BYVAL BoolCount AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[99] USING IDirect3DDevice9_GetVertexShaderConstantB(pthis, StartRegister, pConstantData, BoolCount) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetStreamSource method
' Binds a vertex buffer to a device data stream.
' HRESULT SetStreamSource(
'   UINT StreamNumber,
'   IDirect3DVertexBuffer9 * pStreamData,
'   UINT OffsetInBytes,
'   UINT Stride
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetStreamSource ALIAS "IDirect3DDevice9_SetStreamSource" ( _
    BYVAL pthis AS DWORD PTR, BYVAL StreamNumber AS DWORD, BYVAL pStreamData AS DWORD, _
    BYVAL OffsetInBytes AS DWORD, BYVAL Stride AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[100] USING IDirect3DDevice9_SetStreamSource(pthis, StreamNumber, pStreamData, OffsetInBytes, Stride) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetStreamSource method
' Binds a vertex buffer to a device data stream.
' HRESULT GetStreamSource(
'   UINT StreamNumber,
'   IDirect3DVertexBuffer9 ** ppStreamData,
'   UINT * pOffsetInBytes,
'   UINT * pStride
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetStreamSource ALIAS "IDirect3DDevice9_GetStreamSource" ( _
    BYVAL pthis AS DWORD PTR, BYVAL StreamNumber AS DWORD, BYREF ppStreamData AS DWORD, _
    BYREF pOffsetInBytes AS DWORD, BYREF pStride AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[101] USING IDirect3DDevice9_GetStreamSource(pthis, StreamNumber, ppStreamData, pOffsetInBytes, pStride) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetStreamSourceFreq method
' Sets the stream source frequency divider value. This may be used to draw several
' instances of geometry.
' HRESULT SetStreamSourceFreq(
'   UINT StreamNumber,
'   UINT FrequencyParameter
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetStreamSourceFreq ALIAS "IDirect3DDevice9_SetStreamSourceFreq" ( _
    BYVAL pthis AS DWORD PTR, BYVAL StreamNumber AS DWORD, BYVAL FrequencyParameter AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[102] USING IDirect3DDevice9_SetStreamSourceFreq(pthis, StreamNumber, FrequencyParameter) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetStreamSourceFreq method
' Gets the stream source frequency divider value.
' HRESULT GetStreamSourceFreq(
'   UINT StreamNumber,
'   UINT* pDivider
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetStreamSourceFreq ALIAS "IDirect3DDevice9_GetStreamSourceFreq" ( _
    BYVAL pthis AS DWORD PTR, BYVAL StreamNumber AS DWORD, BYREF pDivider AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[103] USING IDirect3DDevice9_GetStreamSourceFreq(pthis, StreamNumber, pDivider) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetIndices method
' Sets index data.
' HRESULT SetIndices(
'   IDirect3DIndexBuffer9 * pIndexData
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetIndices ALIAS "IDirect3DDevice9_SetIndices" ( _
    BYVAL pthis AS DWORD PTR, BYVAL pIndexData AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[104] USING IDirect3DDevice9_SetIndices(pthis, pIndexData) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetIndices method
' Retrieves index data.
' HRESULT GetIndices(
'   IDirect3DIndexBuffer9 ** ppIndexData,
'   UINT * pBaseVertexIndex
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetIndices ALIAS "IDirect3DDevice9_GetIndices" ( _
    BYVAL pthis AS DWORD PTR, BYREF ppIndexData AS DWORD, BYREF pBaseVertexIndex AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[105] USING IDirect3DDevice9_GetIndices(pthis, ppIndexData, pBaseVertexIndex) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' CreatePixelShader method
' Creates a pixel shader.
' HRESULT CreatePixelShader(
'   CONST DWORD * pFunction,
'   IDirect3DPixelShader9** ppShader
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_CreatePixelShader ALIAS "IDirect3DDevice9_CreatePixelShader" ( _
    BYVAL pthis AS DWORD PTR, BYVAL pFunction AS DWORD, BYREF ppShader AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[106] USING IDirect3DDevice9_CreatePixelShader(pthis, pFunction, ppShader) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetPixelShader method
' Sets the current pixel shader to a previously created pixel shader.
' HRESULT SetPixelShader(
'   IDirect3DPixelShader9* pShader
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetPixelShader ALIAS "IDirect3DDevice9_SetPixelShader" ( _
    BYVAL pthis AS DWORD PTR, BYVAL pShader AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[107] USING IDirect3DDevice9_SetPixelShader(pthis, pShader) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetPixelShader method
' Retrieves the currently set pixel shader.
' HRESULT GetPixelShader(
'   IDirect3DPixelShader9** ppShader
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetPixelShader ALIAS "IDirect3DDevice9_GetPixelShader" ( _
    BYVAL pthis AS DWORD PTR, BYREF ppShader AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[108] USING IDirect3DDevice9_GetPixelShader(pthis, ppShader) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetPixelShaderConstantF method
' Sets a floating-point vertex shader constant.
' HRESULT SetPixelShaderConstantF(
'   UINT StartRegister,
'   CONST float * pConstantData,
'   UINT Vector4fCount
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetPixelShaderConstantF ALIAS "IDirect3DDevice9_SetPixelShaderConstantF" ( _
    BYVAL pthis AS DWORD PTR, BYVAL StartRegister AS DWORD, BYVAL pConstantData AS DWORD, _
    BYVAL Vector4fCount AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[109] USING IDirect3DDevice9_SetPixelShaderConstantF(pthis, StartRegister, pConstantData, Vector4fCount) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetPixelShaderConstantF method
' Gets a floating-point vertex shader constant.
' HRESULT GetPixelShaderConstantF(
'   UINT StartRegister,
'   float * pConstantData,
'   UINT Vector4fCount
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetPixelShaderConstantF ALIAS "IDirect3DDevice9_GetPixelShaderConstantF" ( _
    BYVAL pthis AS DWORD PTR, BYVAL StartRegister AS DWORD, BYVAL pConstantData AS DWORD, _
    BYVAL Vector4fCount AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[110] USING IDirect3DDevice9_GetPixelShaderConstantF(pthis, StartRegister, pConstantData, Vector4fCount) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetPixelShaderConstantI method
' Sets an integer vertex shader constant.
' HRESULT SetPixelShaderConstantI(
'   UINT StartRegister,
'   CONST int * pConstantData,
'   UINT Vector4iCount
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetPixelShaderConstantI ALIAS "IDirect3DDevice9_SetPixelShaderConstantI" ( _
    BYVAL pthis AS DWORD PTR, BYVAL StartRegister AS DWORD, BYVAL pConstantData AS DWORD, _
    BYVAL Vector4iCount AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[111] USING IDirect3DDevice9_SetPixelShaderConstantI(pthis, StartRegister, pConstantData, Vector4iCount) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetPixelShaderConstantI method
' Gets an integer vertex shader constant.
' HRESULT GetPixelShaderConstantI(
'   UINT StartRegister,
'   int * pConstantData,
'   UINT Vector4iCount
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetPixelShaderConstantI ALIAS "IDirect3DDevice9_GetPixelShaderConstantI" ( _
    BYVAL pthis AS DWORD PTR, BYVAL StartRegister AS DWORD, BYVAL pConstantData AS DWORD, _
    BYVAL Vector4iCount AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[112] USING IDirect3DDevice9_GetPixelShaderConstantI(pthis, StartRegister, pConstantData, Vector4iCount) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetPixelShaderConstantB method
' Sets a Boolean vertex shader constant.
' HRESULT SetVertexShaderConstantB(
'   UINT StartRegister,
'   CONST BOOL * pConstantData,
'   UINT BoolCount
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_SetPixelShaderConstantB ALIAS "IDirect3DDevice9_SetPixelShaderConstantB" ( _
    BYVAL pthis AS DWORD PTR, BYVAL StartRegister AS DWORD, BYVAL pConstantData AS DWORD, _
    BYVAL BoolCount AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[113] USING IDirect3DDevice9_SetPixelShaderConstantB(pthis, StartRegister, pConstantData, BoolCount) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetPixelShaderConstantB method
' Gets an integer vertex shader constant.
' HRESULT GetPixelShaderConstantB(
'   UINT StartRegister,
'   BOOL * pConstantData,
'   UINT BoolCount
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_GetPixelShaderConstantB ALIAS "IDirect3DDevice9_GetPixelShaderConstantB" ( _
    BYVAL pthis AS DWORD PTR, BYVAL StartRegister AS DWORD, BYVAL pConstantData AS DWORD, _
    BYVAL BoolCount AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[114] USING IDirect3DDevice9_GetPixelShaderConstantB(pthis, StartRegister, pConstantData, BoolCount) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' DrawRectPatch method
' Draws a rectangular patch using the currently set streams.
' HRESULT DrawRectPatch(
'   UINT Handle,
'   const float* pNumSegs,
'   const D3DRECTPATCH_INFO* pRectPatchInfo
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_DrawRectPatch ALIAS "IDirect3DDevice9_DrawRectPatch" ( _
    BYVAL pthis AS DWORD PTR, BYVAL prmHandle AS DWORD, BYVAL pNumSegs AS DWORD, _
    BYREF pRectPatchInfo AS D3DRECTPATCH_INFO) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[115] USING IDirect3DDevice9_DrawRectPatch(pthis, prmHandle, pNumSegs, pRectPatchInfo) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' DrawTriPatch method
' Draws a triangular patch using the currently set streams.
' HRESULT DrawTriPatch(
'   UINT Handle,
'   const float* pNumSegs,
'   const D3DTRIPATCH_INFO* pTriPatchInfo
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_DrawTriPatch ALIAS "IDirect3DDevice9_DrawTriPatch" ( _
    BYVAL pthis AS DWORD PTR, BYVAL prmHandle AS DWORD, BYVAL pNumSegs AS DWORD, _
    BYREF pTriPatchInfo AS D3DTRIPATCH_INFO) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[116] USING IDirect3DDevice9_DrawTriPatch(pthis, prmHandle, pNumSegs, pTriPatchInfo) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' DeletePatch method
' Frees a cached high-order patch.
' HRESULT DeletePatch(
'   UINT Handle
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_DeletePatch ALIAS "IDirect3DDevice9_DeletePatch" ( _
    BYVAL pthis AS DWORD PTR, BYVAL prmHandle AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[117] USING IDirect3DDevice9_DeletePatch(pthis, prmHandle) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' CreateQuery method
' Creates a status query.
' HRESULT CreateQuery(
'   D3DQUERYTYPE Type,
'   IDirect3DQuery9** ppQuery
' );
' ****************************************************************************************
FUNCTION IDirect3DDevice9_CreateQuery ALIAS "IDirect3DDevice9_CreateQuery" ( _
    BYVAL pthis AS DWORD PTR, BYVAL QueryType AS DWORD, BYREF ppQuery AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[118] USING IDirect3DDevice9_CreateQuery(pthis, QueryType, ppQuery) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************
 

 

Page last updated on Tuesday, 14 March 2006 19:54:43 +0100