IDirect3DSwapChain9 Interface

 

 

' ****************************************************************************************
' IDirect3DSwapChain9 interface
' $IID_IDirect3DSwapChain9 = GUID$("{794950F2-ADFC-458a-905E-10A10B0B503B}")
' ****************************************************************************************

' ****************************************************************************************
' Applications use the methods of the IDirect3DSwapChain9 interface to manipulate a swap chain.
' There is always at least one swap chain for each device, known as the implicit swap chain.
' However, an additional swap chain for rendering multiple views from the same device can be
' created by calling the IDirect3DDevice9::CreateAdditionalSwapChain method.
' ****************************************************************************************

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

'    /*** IDirect3DSwapChain9 methods ***/
'  3.  STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion,DWORD dwFlags) PURE;
'  4.  STDMETHOD(GetFrontBufferData)(THIS_ IDirect3DSurface9* pDestSurface) PURE;
'  5.  STDMETHOD(GetBackBuffer)(THIS_ UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) PURE;
'  6.  STDMETHOD(GetRasterStatus)(THIS_ D3DRASTER_STATUS* pRasterStatus) PURE;
'  7.  STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE* pMode) PURE;
'  8.  STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE;
'  9.  STDMETHOD(GetPresentParameters)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE;
'};
' ****************************************************************************************

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

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[3] USING IDirect3DSwapChain9_Present(pthis, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion, dwFlags) TO HRESULT
    FUNCTION = HRESULT

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

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

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

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

' ****************************************************************************************
' GetBackBuffer method
' Retrieves a back buffer from the swap chain of the device.
' HRESULT GetBackBuffer(
'   UINT BackBuffer,
'   D3DBACKBUFFER_TYPE Type,
'   IDirect3DSurface9 ** ppBackBuffer
' );
' ****************************************************************************************
FUNCTION IDirect3DSwapChain9_GetBackBuffer ALIAS "IDirect3DSwapChain9_GetBackBuffer" ( _
    BYVAL pthis AS DWORD PTR, 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[5] USING IDirect3DSwapChain9_GetBackBuffer(pthis, 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(
'   D3DRASTER_STATUS * pRasterStatus
' );
' ****************************************************************************************
FUNCTION IDirect3DSwapChain9_GetRasterStatus ALIAS "IDirect3DSwapChain9_GetRasterStatus" ( _
    BYVAL pthis AS DWORD PTR, BYREF pRasterStatus AS D3DRASTER_STATUS) EXPORT AS LONG

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

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

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

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

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

' ****************************************************************************************
' GetDevice method
' Retrieves the device associated with the swap chain.
' HRESULT GetDevice(
'   IDirect3DDevice9 **ppDevice
' );
' ****************************************************************************************
FUNCTION IDirect3DSwapChain9_GetDevice ALIAS "IDirect3DSwapChain9_GetDevice" ( _
    BYVAL pthis AS DWORD PTR, BYREF ppDevice AS DWORD) EXPORT AS LONG

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

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

' ****************************************************************************************
' GetPresentParameters method
' Retrieves the presentation parameters associated with a swap chain.
' HRESULT GetPresentParameters(
'   D3DPRESENT_PARAMETERS* pPresentationParameters
' );
' ****************************************************************************************
FUNCTION IDirect3DSwapChain9_GetPresentParameters ALIAS "IDirect3DSwapChain9_GetPresentParameters" ( _
    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[9] USING IDirect3DSwapChain9_GetPresentParameters(pthis, pPresentationParameters) TO HRESULT
    FUNCTION = HRESULT

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

 

Page last updated on Tuesday, 14 March 2006 20:24:27 +0100