IDirect3DStateBlock9 Interface

 

 

' ****************************************************************************************
' IDirect3DStateBlock9 interface
' $IID_IDirect3DStateBlock9 = GUID$("{B07C4FE5-310D-4ba8-A23C-4F0F206F218B}")
' ****************************************************************************************

' ****************************************************************************************
' Applications use the methods of the IDirect3DStateBlock9 interface to encapsulate render states.
' This interface can be used to save and restore pipeline state. It can also be used to capture
' the current state.
' 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_(IDirect3DStateBlock9, IUnknown)
'{
'    /*** IUnknown methods ***/
'  0.  STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE;
'  1.  STDMETHOD_(ULONG,AddRef)(THIS) PURE;
'  2.  STDMETHOD_(ULONG,Release)(THIS) PURE;

'    /*** IDirect3DStateBlock9 methods ***/
'  3.  STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE;
'  4.  STDMETHOD(Capture)(THIS) PURE;
'  5.  STDMETHOD(Apply)(THIS) PURE;
'};
' ****************************************************************************************

' ****************************************************************************************
' GetDevice method
' Gets the device.
' Note  Calling this method will increase the internal reference count on the
' IDirect3DDevice9 interface. Be sure to call IUnknown::Release when you are done using
' this IDirect3DDevice9 interface or you will have a memory leak.
' HRESULT GetDevice(
'   IDirect3DDevice9 ** ppDevice
' );
' ****************************************************************************************
FUNCTION IDirect3DStateBlock9_GetDevice ALIAS "IDirect3DStateBlock9_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[3] USING IDirect3DStateBlock9_GetDevice(pthis, ppDevice) TO HRESULT
    FUNCTION = HRESULT

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

' ****************************************************************************************
' Capture method
' Capture the device's current state.
' HRESULT Capture();
' ****************************************************************************************
FUNCTION IDirect3DStateBlock9_Capture ALIAS "IDirect3DStateBlock9_Capture" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG

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

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

' ****************************************************************************************
' Apply method
' Apply the state block to the current device state.
' HRESULT Apply();
' ****************************************************************************************
FUNCTION IDirect3DStateBlock9_Apply ALIAS "IDirect3DStateBlock9_Apply" (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 IDirect3DStateBlock9_Apply(pthis) TO HRESULT
    FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
 

 

Page last updated on Tuesday, 14 March 2006 20:18:25 +0100