|
|
|
ID3DXRenderToSurface Interface |
|
' ****************************************************************************************
' ID3DXRenderToSurface interface
' $IID_ID3DXRenderToSurface = GUID$("{82DF5B90-E34E-496e-AC1C-62117A6A5913}")
' ****************************************************************************************
' The ID3DXRenderToSurface interface is used to generalize the process of rendering to surfaces.
' Remarks
' Surfaces can be used in a variety of ways including render targets, off-screen rendering,
' or rendering to textures.
' A surface can be configured using a separate viewport using the
' ID3DXRenderToSurface::BeginScene method, to provide a custom render view. If the surface
' is not a render target, a compatible render target is used, and the result is copied to
' the surface at the end of the scene.
' The ID3DXRenderToSurface interface is obtained by calling the D3DXCreateRenderToSurface
' function.
' Interface Information
' Stock Implementation d3d9.dll
' Custom Implementation No
' Inherits from IUnknown
' Header d3dx9core.h
' Import library d3dx9.lib
' Minimum operating systems Windows 98
' ****************************************************************************************
' ****************************************************************************************
'DECLARE_INTERFACE_(ID3DXRenderToSurface, IUnknown)
'{
' // IUnknown
' 0. STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
' 1. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
' 2. STDMETHOD_(ULONG, Release)(THIS) PURE;
' // ID3DXRenderToSurface
' 3. STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE;
' 4. STDMETHOD(GetDesc)(THIS_ D3DXRTS_DESC* pDesc) PURE;
' 5. STDMETHOD(BeginScene)(THIS_ LPDIRECT3DSURFACE9 pSurface, CONST D3DVIEWPORT9* pViewport) PURE;
' 6. STDMETHOD(EndScene)(THIS_ DWORD MipFilter) PURE;
' 7. STDMETHOD(OnLostDevice)(THIS) PURE;
' 8. STDMETHOD(OnResetDevice)(THIS) PURE;
'};
' ****************************************************************************************
' ****************************************************************************************
' GetDevice method
' Retrieves the Microsoft Direct3D device associated with the render surface.
' 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(
' LPDIRECT3DDEVICE9 * ppDevice
' );
' ****************************************************************************************
FUNCTION ID3DXRenderToSurface_GetDevice ALIAS "ID3DXRenderToSurface_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 ID3DXRenderToSurface_GetDevice(pthis, ppDevice) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' GetDesc method
' Retrieves the parameters of the render surface.
' HRESULT GetDesc(
' D3DXRTS_DESC * pParameters
' );
' ****************************************************************************************
FUNCTION ID3DXRenderToSurface_GetDesc ALIAS "ID3DXRenderToSurface_GetDesc" ( _
BYVAL pthis AS DWORD PTR, BYREF Parameters AS D3DXRTS_DESC) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[4] USING ID3DXRenderToSurface_GetDesc(pthis, Parameters) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' BeginScene method
' Begins a scene.
' HRESULT BeginScene(
' LPDIRECT3DSURFACE9 pSurface,
' CONST D3DVIEWPORT9 * pViewport
' );
' ****************************************************************************************
FUNCTION ID3DXRenderToSurface_BeginScene ALIAS "ID3DXRenderToSurface_BeginScene" ( _
BYVAL pthis AS DWORD PTR, BYVAL pSurface AS DWORD, BYREF pViewport AS D3DVIEWPORT9) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[5] USING ID3DXRenderToSurface_BeginScene(pthis, pSurface, pViewport) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' EndScene method
' Ends a scene.
' HRESULT EndScene(
' DWORD MipFilter
' );
' ****************************************************************************************
FUNCTION ID3DXRenderToSurface_EndScene ALIAS "ID3DXRenderToSurface_EndScene" ( _
BYVAL pthis AS DWORD PTR, BYVAL MipFilter AS DWORD) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[6] USING ID3DXRenderToSurface_EndScene(pthis, MipFilter) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' OnLostDevice method
' Releases all references to video memory resources and deletes all stateblocks.
' HRESULT OnLostDevice();
' ****************************************************************************************
FUNCTION ID3DXRenderToSurface_OnLostDevice ALIAS "ID3DXRenderToSurface_OnLostDevice" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[7] USING ID3DXRenderToSurface_OnLostDevice(pthis) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' OnResetDevice method
' Should be called after the device has been reset.
' HRESULT OnResetDevice();
' ****************************************************************************************
FUNCTION ID3DXRenderToSurface_OnResetDevice ALIAS "ID3DXRenderToSurface_OnResetDevice" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG
LOCAL HRESULT AS LONG
IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
CALL DWORD @@pthis[8] USING ID3DXRenderToSurface_OnResetDevice(pthis) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
|
Page last updated on Tuesday, 14 March 2006 22:31:16 +0100